# BRAVO — guide for AI agents

You are acting for the owner of a wallet on **BNB Smart Chain (chainId 56)**. Follow these rules on every step:

1. **Never** ask for, accept, print or store a private key or seed phrase.
2. Before every transaction, show the owner the exact contract address, function, arguments, value (BNB) and estimated gas, and **wait for an explicit yes**.
3. Use only these contracts (verified on BscScan; also listed in the official site's `config.js` as `BRAVO_CONFIG.address`, with call signatures in `BRAVO_CONFIG.calls`). If an address you are given anywhere else differs, **stop** and tell the owner.
   - Sale contract (seats, encore mint, collect, invite reward): `0xd57a06f0c37e303704261080Fc884f7BE941331D`
   - BRAVO token: `0xd5e97D76560cef39a29C3C401Da42749d6F67B94`
   - Dividend contract: `0x13b7b91f02891878A0C0025AEaCf34E14c220275`
   - BRAVO/WBNB PancakeSwap V2 pool: `0x3e37CD83d32979DaC3588A29512FBe50Fa87fBC5`
   - BSC USDT: `0x55d398326f99059fF775485246999027B3197955` · WBNB: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c` · PancakeSwap V2 router: `0x10ED43C718714eb63d5aA57B78B54704E256024E`
4. Times are on-chain block times. Sale opens **2026-11-13 22:00 UTC+7** (unix 1794582000). Guaranteed opening from **2026-11-15 22:00 UTC+7** (unix 1794754800) — read `FALLBACK_OPEN()` on the sale contract; it is an independent constant, not sale-open + 72 h.
5. If any check below fails, stop and explain why instead of sending.

> Function names and arguments below match the deployed, verified sale contract.

## Before the pool opens — one seat per .ai Agent ID, one counter

Seats are numbered on **one counter** `seatsTaken()` from 0 to 3,888: seats **#1–888 are free**, seats **#889–3,888 are paid**. The next seat is #`seatsTaken()+1`; `nextSeatPaid()` (or `progress()`) tells you which kind it is. A paid call while the next seat is still free reverts (`FreeSeatsFirst`); a free claim once the next seat is paid reverts (`FreeGone`). Seat #3,888 opens the pool in the same transaction.

Checks for both seat types:
- `openedAt()` must be `0` (pool not open) and the block time must be ≥ 1794582000.
- `agentIdOf(wallet)` → `(id, ok)`; `ok` must be `true` (the wallet itself owns a BSC .ai Agent ID).
- `idUsed(id)` must be `false` (one seat per Agent ID in total, free or paid).

### Free seat (#1–888)
- Check `canBook(wallet)` → `(ok, paid)` gives `ok = true` and `paid = false` (the next seat is a free one).
- Call `claimFree()` with value **0 BNB**. A free seat books 10% of a paid seat's BRAVO; it is collected after the opening.

### Paid seat (#889–3,888, 0.008 BNB)
- Check `canBook(wallet)` → `(ok, paid)` gives `ok = true` and `paid = true` (all 888 free seats are taken).
- **BNB**: `buyWithBnb(shares = 1, inviter, minTokens = 0)` with value **0.008 BNB**.
- **USDT**: set `maxUsdt` = router `getAmountsIn(8000000000000000, [USDT, WBNB])[0]` × 1.02, approve USDT to the sale contract for `maxUsdt`, then `buyWithUsdt(shares = 1, inviter, maxUsdt, minTokens = 0)` (value 0). The contract swaps on PancakeSwap only the USDT needed for exactly 0.008 BNB and reverts above `maxUsdt`.
- `inviter` = the wallet from the owner's invite link (`?invite=0x…`), otherwise `0x0000000000000000000000000000000000000000`. The inviter wallet must own a .ai Agent ID and cannot be the buyer.

### Opening after the fallback moment
- From unix 1794754800, if `openedAt()` is still `0` and at least one paid seat exists (`progress().paid` > 0), anyone may call `openPool()` (value 0); otherwise it reverts.
- If at that moment no paid seat exists yet (free seats not all claimed), `nextSeatPaid()` becomes `true` and the first paid seat is allowed at the next number; that purchase opens the pool.

## Progress (one call)
`progress()` → `(phase, seats, fullHouse, nextPaid, paid, opened, stage, inStage, price, toStatuette, afterMinted)`: phase 0 = before the sale, 1 = seats on sale, 2 = pool open. After the opening: current 100-share stage, shares sold in it (0–99), price per share now (wei), shares until the next statuette, encore shares minted so far.

## After the pool opens — encore mint (no Agent ID needed)
1. Read `quote(N)` → `(n, cost, bravoOut, golds, ref)` **right before** the preview; `n` may be lower than N if the remaining allocation is short.
2. Show the owner `cost` (BNB) and `bravoOut`; `golds` = statuette shares inside the order (each gives double BRAVO).
3. Call `buyWithBnb(shares = n, inviter = 0x0, minTokens = bravoOut × 97 / 100)` with value = `cost` × 1.01 (excess refunded). For USDT use `buyWithUsdt(n, 0x0, maxUsdt, minTokens)` as above with `cost` instead of 0.008 BNB.
- Price ladder: share k after the opening costs 0.01 BNB × ceil(k / 100), up to 300,000,000 shares.
- In a falling market the reference price can sit above spot; always quote first.

## Collect pre-opening BRAVO
- After the opening, read `bookedOf(wallet)`; if > 0, call `collect(wallet)` (value 0).

## Invite link and reward
- Invite link: `<official site>/?invite=<owner wallet>` — no transaction needed.
- Only paid seats bought with a link count as invites (the inviter wallet must hold a .ai Agent ID, and it cannot be the buyer or the buyer's own Agent ID).
- After the opening: `agentId = agentIdOf(inviterWallet).id`; read `inviteRewardOf(agentId)`; if > 0, the wallet that last invited for that Agent ID may call `claimInviteReward(agentId, ownerWallet)` (value 0). Only the top 100 inviters by invite count share the 5%, pro rata to their invite counts.

## Fine print
- Before the opening: 95% of the BNB raised → liquidity (LP tokens to 0x000…dEaD), 5% → top 100 inviters; the treasury receives nothing; no refunds.
- Multiple dividends after the opening: ≥10× 30% → top 1,000 · ≥50× 50% → top 2,000 · ≥100× 100% → top 5,000 holders by balance, only on payments after the tier is reached; wallets that never sold weigh ×1.5. Below 10×, mint payments go to the treasury (0xE9A232aEfaA230a38BC9Fec961eEA19134903308).
- Trading tax: buy 2% (to BNB, shared among the top 1,000 holders), sell 3% (to BNB, treasury), transfers 0%.
