# Subsonic Tribe — skill for AI agents

You are an AI agent minting **Subsonic Tribe** for your user: 2,222 sound creatures on BNB Chain.
Only wallets holding a **.ai Agent ID** (Binance Agentic Wallet) can mint. You do the work; the user only confirms the transaction.

- Chain: BNB Smart Chain, chainId `56`
- Contract: `0x65DDB3E337c12E5964ead6Cb9b6469203EF4caf1`
- Currency: BNB. Always tell the user amounts in BNB.

## Rules

| | |
|---|---|
| who | only wallets with a **.ai Agent ID**. Others revert `NoAgentId`. |
| free mints | the first **1,111** wallets get their **1st mint free** (gas only) |
| every other mint | **0.0005 BNB each** (after the 1,111 free mints are gone, every mint costs 0.0005 BNB) |
| limit | **10 per wallet**, 2,222 total |
| caller | must be the wallet itself (no contracts in between), else `OnlyWallets` |

## 1. Plan first

Use the quantity the user asked for (1–10). If they gave none, suggest **5**.
Restate the job in 2–4 lines: wallet address, how many Subsonic Tribe, the total BNB (plus gas).
**Never send a transaction without the user's explicit confirmation.**

## 2. Wallet preflight (Binance Agentic Wallet — `baw`)

```bash
baw wallet status --json     # must be signed in
baw wallet address --json    # use the BSC (chainId 56) address
baw wallet balance --json    # enough BNB for gas + price
baw wallet settings --json   # devMode.enabled must be true (contract calls)
```

No Agent ID? Binance App → Agentic Wallet → claim the `.ai` Agent ID.
Developer Mode off? Binance App → Agentic Wallet → Settings → Developer Mode.

## 3. Read the price (always, right before minting)

Call `quote(address wallet, uint256 qty)` → BNB in wei you must send.
Also check `mintedBy(wallet)` (already minted, max 10), `hasFreeMint(wallet)`, `freeClaimed()` (of 1,111) and `totalSupply()` (of 2,222).

| function | selector |
|---|---|
| `quote(address,uint256)` | `0x8f79306e` |
| `mintedBy(address)` | `0x3cef28d2` |
| `hasFreeMint(address)` | `0xd5cde1f2` |
| `freeClaimed()` | `0x1b47ec3a` |
| `totalSupply()` | `0x18160ddd` |
| `mintOpen()` | `0x24bbd049` |

Public RPC: `https://bsc-dataseed.bnbchain.org`

## 4. Build the transaction

- `to`: `0x65DDB3E337c12E5964ead6Cb9b6469203EF4caf1`
- `data`: `mint(uint256 qty)` → selector `0xa0712d68` + qty as a 32-byte word
  - qty 5: `0xa0712d680000000000000000000000000000000000000000000000000000000000000005`
- `value`: **exactly** the wei from `quote(wallet, qty)`. Any other amount reverts `WrongPayment`.
  - wallet with a free mint, qty 5: `2000000000000000` (0.002 BNB)
  - otherwise: qty × `500000000000000` (0.0005 BNB each)

## 5. Send it

1. `baw contract-call preview` with the `to`, `data`, `value` above (chain 56), `--json`.
2. Show the user: quantity, BNB cost, gas, `parsedTx`, `risks`. Get an explicit "yes".
3. `baw contract-call execute --requestId <id> --json` → `BROADCASTED` + `txHash`
   (or `PENDING_CONFIRMATION` → the user approves in the Binance App).
4. Check the receipt.

## 6. Report

Tx hash (`https://bscscan.com/tx/<hash>`) and token id(s) from the `Summoned` / `Transfer` events.
Art and traits are live from the moment of mint: `tokenURI(id)` returns on-chain JSON, and the image is on IPFS.

## Errors

| error | selector | what to do |
|---|---|---|
| NoAgentId | `0xf947691f` | wallet has no .ai Agent ID — claim it in the Binance App |
| WrongPayment | `0x788a686f` | re-read `quote` and send exactly that value |
| WalletLimit | `0x5426a580` | wallet would pass 10 — mint fewer |
| SoldOut | `0x52df9fe5` | not enough supply left — stop and tell the user |
| MintClosed | `0x589ed34b` | mint is paused — stop and tell the user |
| OnlyWallets | `0x91d01199` | call from the wallet directly, not through a contract |
| BadQuantity | `0x888e58a8` | qty must be at least 1 |

Collectible only, not an investment.
