# HERD — guide for AI agents

> Machine-readable participation guide. Canonical URL: https://mint.herdagreement.com/agents.md (also /llms.txt).
> Chain: **BNB Smart Chain (chainId 56)**. Payment: **USDT (BEP-20, 18 decimals)**.
> Official X: [@herdaiagent](https://x.com/herdaiagent) — the only official account.
> Contracts are open source and verified on Sourcify, not audited. No price or return promise.

## 1. What it is

An Agent-ID-gated share mint paid in USDT. 1 share = 50,000,000 HERD.
- Phase 1: shares #1–#10,000 at **1 USDT** each, max **10 per Agent ID**. Tokens arrive in the same
  transaction but are not transferable until graduation.
- **Graduation is automatic**: the transaction that sells share #10,000 creates the pool
  (90% of the USDT + 300,000,000,000 HERD on PancakeSwap V2, LP sent to `0x…dEaD`), sends 10% to the
  treasury and enables trading. Opening price = 1.5 USDT per share.
- Phase 2: after graduation, minting stays open until 400,000 shares in total. Price per share =
  `max(1 USDT, pool price of 50M HERD)`, max 10 per transaction, no per-ID cap. 20% to the
  treasury (金库), 80% is added to the pool at the pool ratio (LP burned). Tokens are transferable immediately.
- Refund: if share #10,000 is not reached within 72 hours of `startAt()`, phase-1 buyers call `refund()`
  and get 100% of their USDT back (their HERD is burned).

## 2. Addresses

| Name | Address |
|---|---|
| Launch (buy / refund) | `0x23a1F3C58D17e76055dc4FbD174152C0cb7BD303` |
| HERD token | `0x55F4Fb4DFDaF2844A72E7b07738997de7A5aB5Ee` |
| Treasury (金库) | `0x09EBF8445fB060500ac293910F15b312AcB9A40B` |
| PancakeSwap V2 pair HERD/USDT | `0x277C8664417305dDFd922092Da8F15b7685d9Fdb` |
| USDT | `0x55d398326f99059fF775485246999027B3197955` |
| Agent ID registry (eligibility) | `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` |

## 3. Eligibility (exact contract logic)

```solidity
handle = REGISTRY.handleOf(wallet);          // must be non-empty
id     = uint256(keccak256(bytes(handle)));
ok     = REGISTRY.ownerOf(id) == wallet;
```
The first purchase binds the Agent ID to the wallet. Only EOAs (or EIP-7702 delegated EOAs) may call `buy`.
`remainingPhase1(wallet)` returns how many phase-1 shares the wallet can still buy.

## 4. How to mint

```
price  = Launch.sharePrice()                 // 1e18 before graduation
cost   = shares * price                      // or Launch.quote(shares)
1. USDT.approve(Launch, maxCost)             // approve only what you need
2. Launch.buy(shares, maxCost)               // shares 1..10; reverts CostTooHigh if cost > maxCost
```
- Before graduation `maxCost = shares * 1e18` is exact. If fewer shares remain than requested, you buy
  the remainder and pay only for it.
- After graduation add a small buffer (e.g. +2%) because the pool price can move.

Calldata: `buy(uint256,uint256)` = `0xd6febde8`, `approve(address,uint256)` = `0x095ea7b3`.

## 5. Read state

| Call | Meaning |
|---|---|
| `totalSold()` | shares sold so far (phase 1 + phase 2) |
| `opened()` | graduated (pool live, trading on) |
| `startAt()` | mint start (unix), refund opens at `startAt + 72h` if not graduated |
| `sharePrice()` / `quote(n)` | current price per share / for n shares |
| `reserves()` | pool reserves (HERD, USDT) |
| `refundable()` | refund window open |

## 6. Trading taxes (official pair only, wallet transfers are free)

- Buy 2%: 1% to the treasury (金库), 1% collected and turned into liquidity (LP burned).
- Sell 2%: burned. Use fee-on-transfer swap functions, slippage ≥ 3%.

## 7. Powers

The deployer can call `start()` once. There is no pause, withdraw, upgrade, or parameter change in
either contract.
