# ALLIN — AI-agent-only bonding curve on BNB Chain > ALLIN is a single-contract bonding curve token on BNB Smart Chain (chain id {{CHAIN_ID}}). > Until graduation only wallets holding a Binance Agent ID (the soulbound `.ai` handle of a Binance Agentic Wallet) can buy or sell, > and the token cannot be transferred. This file tells an AI agent how to trade ALLIN for its user with a Binance Agentic Wallet. ## Contract - ALLIN (token + curve, 18 decimals): {{ALLIN}} - Binance Agent ID registry (ERC-721, `balanceOf(wallet) > 0` = may trade): 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F No owner, no upgrade, no pause, no blacklist. Read the verified source on BscScan before trading. ## Rules the chain enforces - Buy: `buy(uint256 minTokensOut)` payable. 1% fee. Max `maxBuyNow()` BNB per transaction (smaller during the launch window). - Sell: `sell(uint256 tokensIn, uint256 minBnbOut)`. 1% fee. **No approve needed** — tokens are burned from the caller. - Wallet cap: a wallet can hold at most `WALLET_MAX()` (1% of the cap) through buys (`WalletCapReached`). Use `maxBuyFor(address)` to get the largest BNB amount that wallet can spend right now. - One block must pass between a wallet's buy and its next sell (`CooldownActive`). - Before graduation: caller must hold an Agent ID (`NotAgent`); transfers revert (`TransfersLocked`). - Graduation: when `GRAD_BNB()` net BNB is in the curve, the curve closes forever (`GraduatedNoBuys`). In the same transaction the contract migrates to PancakeSwap V2: all curve BNB (as WBNB) plus matching ALLIN at the final curve price go into the ALLIN/WBNB pair, and the LP tokens are sent to 0x000000000000000000000000000000000000dEaD (burned). `pair()` returns the pool; `migrated()` turns true. After that, transfers unlock and ALLIN trades on PancakeSwap like any token (curve `sell` reverts with `AlreadyMigrated`). The final buy is capped at the graduation line and the excess BNB is refunded in the same transaction. - If the automatic migration ever fails, anyone can call `migrate()` (selector 0x8fd3ab80). Until it happens, transfers stay locked and curve sells revert with `MigrationPending`; if nobody migrates for `FALLBACK_BLOCKS()` blocks, curve sells reopen so funds are never stuck. - Curve: supply(b) = CAP·b/(V+b), price(b) = (V+b)²/(CAP·V), b = net BNB in the curve (`bnbCum()`). ## Read-only calls - `quoteBuy(uint256 bnbIn) → (uint256 tokensOut, uint256 fee, uint256 refund)` selector 0x4beb394c - `quoteSell(uint256 tokensIn) → (uint256 bnbOut, uint256 fee)` selector 0xa64190c4 - `canTrade(address) → bool` selector 0x559f05dc - `state() → (bnbCum, supply, price, fees, graduated, maxBuyNow, startBlock, block)` selector 0xc19d93fb - `lastBuyBlock(address) → uint256` selector 0x37b28bfd - `maxBuyFor(address) → uint256` (max BNB incl. fee this wallet can spend now) selector 0x13e0247a ## Write calls - `buy(uint256 minTokensOut)` selector 0xd96a094a — value = BNB to spend in wei - `sell(uint256 tokensIn, uint256 minBnbOut)` selector 0xd79875eb Set `minTokensOut` / `minBnbOut` from a fresh quote minus 1–2% tolerance. ## Trade with the binance-agentic-wallet skill (baw CLI) Install: `npx skills add binance/binance-skills-hub --skill binance-agentic-wallet` 1. `baw auth signin --json` → show the user the login URL and pairing code → user confirms in the Binance App → `baw auth verify --qrCodeId `. 2. `baw wallet address --json` (EVM address for binanceChainId 56); `canTrade(address)` on ALLIN must be true. 3. `baw wallet settings --json` → `devMode.enabled` must be true. If not, tell the user: Binance App → Agentic Wallet → Settings → Developer Mode → confirm the risk warning → approve. 4. Buy: `baw contract-call preview --binanceChainId 56 --from --to {{ALLIN}} --value --inputData 0xd96a094a --json` Show the user the parsed call and risks, get explicit confirmation, then `baw contract-call execute --requestId --json`. 5. Sell (one call, no approve): `--value 0 --inputData 0xd79875eb`, at least one block after the last buy. 6. `execute` returns `BROADCASTED` with a `txHash`, or `PENDING_CONFIRMATION` (the user must confirm in the Binance App). Verify the `Buy` / `Sell` event on BscScan. ## Errors NotAgent, NotStarted, WalletCapReached(max), MigrationPending, AlreadyMigrated, TransfersLocked, BuyTooLarge(max), CooldownActive, GraduatedNoBuys, InsufficientOutput(actual, minimum), ZeroInput. Website: the same site lets a human connect a Binance Agentic Wallet by QR code and trade with preview → confirm.