---
name: binance-ai-mint
description: Inspect and prepare a paid mint of the independent community token 币安ai on BNB Smart Chain.
---

# 币安ai — protocol specification

Independent community project. Not affiliated with or endorsed by Binance. Token name: 币安ai. Chain: BNB Smart Chain, chain ID 56.

STATUS: deployed
TOKEN: 0xD0143F4868E80c46370b5411eAFe2F7F4f127A52
MINT: 0xCED968dAA5C941c200EA7b2eB45b562Ab1eeCFdF
PAIR: 0xB3c563FD8Ae05d9Ca32C44BD123d79efAfB6C221
AGENT ID REGISTRY: 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F
USDT (18 decimals): 0x55d398326f99059fF775485246999027B3197955
BNB/USD FEED: 0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE

## Fixed economics
18,000 tokens, 18 decimals. All supply exists at deployment in the immutable mint contract. 10,000 paid mint units each distribute 1 token for exactly 1 USDT. 8,000 tokens are reserved exclusively for initial liquidity. No additional issuance or team token allocation.

Each Agent ID has 10 base paid allowances. agentId = uint256(keccak256(UTF8(lowercase handle WITHOUT .ai))). Verify registry.ownerOf(agentId) equals the transaction sender. A wallet migration never resets counts. The first successful payment by a new ID may credit an existing, previously paying referrer ID with one extra PAID mint allowance. Self/same-wallet referrals are rejected. A referred ID rewards once; extra allowances stack; every mint still costs 1 USDT and counts toward the same global 10,000 cap. A referrer must have minted previously. The referral choice is fixed on the first mint.

Each prepared intent MUST freeze expectedMinted = mintedByAgent(agentId). Both mint entrypoints reject StaleMintCount if that count has changed. This prevents a new transaction with replayed calldata from charging for another mint; replaying an identical signed transaction is already idempotent at the EVM nonce level. A reverted replay can still spend network gas. Never refresh the expected count after an unknown wallet result until the original hash is reconciled.

USDT payment: approve only the exact quantity * 10^18 to MINT, then mintUSDT(agentId,quantity,expectedMinted,useReferral,referrerId). If useReferral=false, pass referrerId=0.
BNB payment: call quoteBNB(quantity); it returns (required,maximum). Use required plus at most 1% quote buffer, capped by maximum. Call mintBNB(agentId,quantity,expectedMinted,useReferral,referrerId,deadline) with that wei value; deadline must be current chain time to +15 minutes. Exact-output PancakeSwap WBNB/USDT purchase delivers exactly quantity USDT; extra BNB is refunded. A failed refund becomes a sender-only claimBNBRefund() credit. Prefer a fresh chain timestamp +900 seconds for the deadline; do not execute an expired preview. The BNB/USD feed caps maximum payment at 103% of USD reference, maximum feed age one hour. Gas is separate. Price convention: 1 USDT, nominally one dollar; no guaranteed USDT peg.

At the 10,000th paid unit, the mint attempts finalization. 80% of collected USDT buys WBNB through PancakeSwap V2, protected by a 97% BNB/USD reference minimum. All WBNB received plus exactly 8,000 tokens seeds the designated token/WBNB V2 pair. LP goes to 0x000000000000000000000000000000000000dEaD, with the V2 mandatory minimum liquidity at the zero address. A preexisting WBNB donation and sync cannot prevent initial LP creation. The remaining 20% USDT enters the treasury. Treasury allocations are fixed in the verified contract.

No owner, upgradeability, fee setters, blacklist, privileged withdrawals or external minting. The immutable mint can only open token transfers once after the LP exists and its token balance is zero. Before that, holders cannot transfer their minted tokens. There is no funding deadline, refund mechanism, or administrative rescue. If the target is never reached, funds remain locked and tokens remain non-transferable indefinitely.

The designated PancakeSwap V2 token/WBNB pool charges 1% buy tax and 2% sell tax; ordinary post-launch wallet transfers are untaxed. Other trading venues/pools are not covered by this tax logic. Collected token tax is converted to BNB for the treasury. Conversion uses an 18-token maximum batch, a mature 15-minute V2 cumulative price average, no more than two-hour-old observation, and 5% execution tolerance. Anyone may updateTaxOracle(), processTaxes() or distributeTreasury(). Automatic conversion is attempted on sells after at least 18 tokens accrue; failures do not block the sell. Conversion may be delayed, and these limits do not eliminate MEV risk. There is no deployed keeper in this source delivery.

A finalization subcall that runs out of gas near the EIP-150 boundary reverts the mint with InsufficientFinalizationGas, so standard gas estimation must budget the nested call. No mint payment or count commits in this case. Normal early DEX/oracle errors still defer finalization.

If the last mint emits FinalizationDeferred, it remains a successful mint and funds remain in the mint contract. Anyone may retry finalize() when dependencies and prices are valid. Contracts cannot execute without a transaction. No guarantee of immediate finalization during DEX/oracle failure. No keeper service has been deployed yet.

## Before authorizing any action
Check chain ID, code at both addresses, verified source, mint.minted(), mint.finalized(), registry.ownerOf(id), mint.remainingAllowance(id), balances and USDT allowance. Simulate and estimate the exact transaction. Show destination, quantity, payment, allowance, gas and transfer-lock/no-refund condition. Get user authorization. Do not send plain BNB/USDT transfers: use the mint entrypoints. Do not request a seed or key. Observe wallet security and Developer Mode controls.

USDT, oracle, Agent ID registry and DEX are external dependencies with their own controls. This source has automated tests; it has not received an independent security audit. Public docs do not imply Binance listing/endorsement or automatic discovery.

## Binance Agentic Wallet integration
Use the official installed binance-agentic-wallet skill, not a custom private-key signer. Check baw wallet status --json, then baw wallet agent-id --json once to discover the .ai handle automatically. The user does not need an injected browser wallet or to type the handle. If the user provided a handle, compare it to the official result. Only claimed=true is a successful identity pre-check; a service error or timeout is UNKNOWN, never not-claimed. If claimed=false, guide the user to the official Binance App Agent ID flow. A just-claimed ID can take tens of seconds to confirm and up to 60 seconds of cache; recheck later without polling in a loop. Check the connected wallet address and verify registry.ownerOf(id) equals it. Enable Developer Mode through the official Binance App flow if required. Check baw wallet settings --json immediately before external contract-call preview.

Fetch https://bnai.trade/config.json and both ABIs. Stop if status is not deployed or contract addresses are null. Derive and verify the ID onchain. Build calldata locally with ethers Interface.encodeFunctionData. Preview exact approvals separately and wait for their confirmed receipt before previewing the mint. Do not use unlimited approvals.

Official CLI syntax (verify against installed skill):

    baw contract-call preview --binanceChainId 56 --from WALLET --to CONTRACT --value WEI --inputData CALLDATA --json

Display the parsed preview, payment and risks, obtain user confirmation, then:

    baw contract-call execute --requestId REQUEST_ID --json

Inspect preview.expiresAt and the BNB deadline immediately before execute. Never fill --gasLimit without the user explicitly requesting a custom cap; use the official backend estimation. After execute, BROADCASTED with txHash is only broadcast; PENDING_CONFIRMATION with no hash means the user still needs to approve in the App. A network timeout is UNKNOWN, not failed. Do not call execute again, create a new preview, or refresh expectedMinted after an unknown result. Use baw wallet tx-lock --binanceChainId 56 --json and baw wallet tx-history --type pending --binanceChainId 56 --json to reconcile; if a hash is known, baw wallet tx-history --tx HASH --binanceChainId 56 --json and chain receipts are read-only checks. Wait for two canonical confirmations and the exact Minted(wallet,agentId,quantity,paidBNB,paidUSDT) event. Approval and Mint are separate; do not send Mint until the exact approval has confirmed. If approval finishes after a pause, request a fresh review for the same intent. Never retry a write automatically.

Use only the requestId from the successful preview. A preview error blocks execute. A confirmed receipt and Minted event establish a successful mint; an execute request alone does not. Check finalized() separately for liquidity creation. Never bypass wallet confirmation or security controls.

## Read-only companion CLI
The source package includes node scripts/agent.cjs inspect, prepare --wallet ADDRESS --handle NAME.ai --quantity 1 --currency USDT, and receipt --intent intent.json --hash HASH --stage mint. It emits unsigned calldata and official baw preview argument arrays only. It never reads a private key or signs. Preserve the emitted plan and expectedMinted across retries.
