# DOGGO AGENT — agent skill

Night-shift share board on BNB Smart Chain (chain id 56). One share = 100,000 DOGGO.
Only wallets holding a Binance .ai Agent ID may mint. No owner keys, no transfer tax,
no upgrade, no refund, no deadline. 30% of every paid fare goes to the treasury in the
same transaction; there is no team token allocation.

> Contract status: **live on BNB Smart Chain** (block 133042215). The numbers in this
> file are the constants compiled into `DoggoMint`.

## Addresses

| item | address |
|---|---|
| sale / mint contract | `0x5073f2977275ffa0c76c365fda1975c2443585ce` |
| token (BEP-20, DOGGO) | `0x4f134de4c026a0f06fbaf95a29bc71475ea2d510` |
| PancakeSwap V2 pair (DOGGO/WBNB) | `0x8cc2f28bd4db388a9cd350131b63555e82b6ba0d` (created in the constructor) |
| agent registry (read only) | `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` |
| LP sink | `0x000000000000000000000000000000000000dEaD` |
| treasury (immutable) | `0x4061a3815f08d5daC1D1f3FdddBf760986E31279` |

Verify every address on bscscan.com before signing anything.

## Constants

```
FREE_SHARES       1,000      free lane, outside the ladder
PAID_SHARES      49,000      ladder: 4 x 10,000 + 9,000
TOTAL_SHARES     50,000      FREE + PAID
TRANCHE_SIZE     10,000
TRANCHE_STEP     0.001 ether
FREE_FARE        0.0001 ether   exact msg.value for freeMint()
PER_WALLET       10          free lane counted
LAUNCH_AT        10,000      paid shares (end of tranche 1)
FEE_BPS          3,000       of every paid fare -> treasury
TOKENS_PER_SHARE 100,000e18
SINK             0x...dEaD
```

## Gate

`agentOk(wallet)` returns true when `IAgentRegistry.balanceOf(wallet) > 0` on the
registry above. A registry address of zero is only allowed on testnet (chain 97).

## Reads

| signature | selector |
|---|---|
| `saleOpen()` | `0x99288dbb` |
| `launched()` | `0x8091f3bf` |
| `minted()` | `0x4f02c420` |
| `freeTaken()` | `0xc5ef7668` |
| `paidSold()` | `0x10b985d4` |
| `heldBnb()` | `0x2d28fa7d` |
| `sharesLeft()` | `0x64fcc8b2` |
| `freeLeft()` | `0xe6842b12` |
| `currentPrice()` | `0x9d1b464a` |
| `priceAt(uint256)` | `0x9dab2054` |
| `quote(uint256)` | `0xed1bd76c` |
| `walletLeft(address)` | `0x631013a0` |
| `agentOk(address)` | `0xaff0f7a2` |
| `freeCount(address)` | `0x958c8848` |
| `paidCount(address)` | `0x3e8f8723` |
| `launchReady()` | `0x7632016a` |

`currentPrice()` returns 0 when the paid ladder is sold out.

## Free lane — `freeMint()`

```
freeMint()   selector 0x5b70ea9f
msg.value  = 0.0001 BNB exactly (100% forwarded to treasury in the same tx)
result     = 1 share = 100,000 DOGGO
limits     = 1 per wallet, 1,000 shares total, wallet cap 10 shares incl. paid
```

Reverts: `SaleClosed`, `AgentOnly`, `FreeOnce`, `WalletCap`, `FreeLaneFull`,
`TotalFull`, `FareMismatch`, `FeeStuck`.

The free lane sits outside the ladder, so claiming does not move the price.

## Paid ladder — `buy(uint256 n)`

```
buy(n)       selector 0xd96a094a
cost       = quote(n)
msg.value  = quote(n) exactly
result     = n shares = n * 100,000 DOGGO
```

Tranche prices, by paid index (0-based):

| shares | price / share | market cap (50,000 shares) |
|---|---|---|
| 0 – 9,999 | 0.001 BNB | 50 BNB |
| 10,000 – 19,999 | 0.002 BNB | 100 BNB |
| 20,000 – 29,999 | 0.003 BNB | 150 BNB |
| 30,000 – 39,999 | 0.004 BNB | 200 BNB |
| 40,000 – 48,999 | 0.005 BNB | 250 BNB |

A single `buy(n)` may cross a tranche; each share pays the price of its own tranche,
which is exactly what `quote(n)` returns. 30% of `cost` goes to the treasury in the
same transaction, 70% is held for the pool.

Reverts: `SaleClosed`, `AgentOnly`, `ZeroShares`, `WalletCap`, `LadderFull`,
`TotalFull`, `FareMismatch`, `FeeStuck`.

Example: with `paidSold = 9,998`, `quote(3)` = 2 × 0.001 + 1 × 0.002 = 0.004 BNB.

## Launch

```
launch()     selector 0x01339c21
```

- Callable by anyone once `paidSold >= 10,000`.
- Launch ends the sale (`saleOpen()` turns false); no share can be bought afterwards.
- Fires automatically when `paidSold == 49,000`.
- Uses `address(this).balance` as the BNB side, so stray BNB also enters the pool.
- `lastPrice = priceAt(paidSold - 1)`; `tokenIn = balance * 100,000e18 / lastPrice`.
- Wraps BNB to WBNB, transfers to the pair, mints `tokenIn` DOGGO to the pair,
  `pair.mint(0x…dEaD)`, then `token.open()`.
- Transfers are locked until `open()`.

Reverts: `AlreadyLaunched`, `NotReady`, `NoFares`, `PoolStuck`.

## Events

| event | fields |
|---|---|
| `FreeMinted(address indexed wallet, uint256 fareWei, uint256 tokensOut)` | fare is always 0.0001 BNB |
| `ShareBought(address indexed wallet, uint256 shares, uint256 paidWei, uint256 feeWei, uint256 tokensOut)` | `feeWei = paidWei * 30%` |
| `Launched(address pair, uint256 bnbIn, uint256 tokenIn)` | pool seed |

## Rules for an agent

1. Read `backing state` before acting: `launched()`, `paidSold()`, `freeLeft()`,
   `quote(n)`, `walletLeft(wallet)`, `agentOk(wallet)`.
2. Every payable call needs the exact `msg.value`. Overpay and underpay both revert
   with `FareMismatch` — never "round" a value.
3. Never retry a reverted mint with a stale `msg.value`; re-read `quote(n)` first,
   because a buy in between can move the price into the next tranche.
4. There is no refund path. Do not promise one.
5. Tokens cannot move until launch. Do not attempt transfers before `launched()`.
6. After `paidSold >= 10,000`, `launch()` is part of the flow: it is permissionless
   and it burns the LP.

## Build a call

```
to:      <MINT>
value:   quote(n)                # buy
         0.0001 ether           # freeMint
data:    0xd96a094a + uint256(n)
         0x5b70ea9f
```

## Revert table

| error | meaning |
|---|---|
| `SaleClosed` | the shutter is down (launched) |
| `AgentOnly` | wallet has no .ai Agent ID |
| `FreeOnce` | this wallet already took its free share |
| `FreeLaneFull` | all 1,000 free shares are gone |
| `WalletCap` | 10 shares per wallet, free counted |
| `LadderFull` | the 49,000 paid shares are gone |
| `TotalFull` | all 50,000 shares are gone |
| `FareMismatch` | `msg.value` is not exactly the required amount |
| `FeeStuck` | treasury refused the transfer (mint reverts with it) |
| `AlreadyLaunched` | shutter already down |
| `NotReady` | `launch()` before 10,000 paid shares |
| `NoFares` | nothing was ever sold, nothing to seed |
| `PoolStuck` | WBNB transfer to the pair failed |
| `Locked` | token transfer before launch |

## Numbers an agent should quote

- 50,000 shares total: 1,000 free + 49,000 ladder.
- 1 share = 100,000 DOGGO.
- Ladder: 0.001 / 0.002 / 0.003 / 0.004 / 0.005 BNB per share per 10,000.
- Market cap at each step: 50 / 100 / 150 / 200 / 250 BNB (50,000 × step price).
- Full ladder raise: 145 BNB paid + 0.1 BNB free.
- Launch at 10,000 paid shares: 10 BNB raised, 7 BNB into the pool,
  0.7B DOGGO beside it, pool opens at 0.001 BNB per share (MC 50 BNB, LP 14% of it).
- If nobody launches early, the ladder keeps climbing and the pool opens at the last
  filled tranche price when it does.
- Full sale: 145 BNB raised, 101.5 BNB into the pool, 2.03B DOGGO beside it,
  pool opens at 0.005 BNB per share, total supply 7.03B of an 8.5B cap.
