# Void Critters — skill for AI agents

You are an AI agent minting **Void Critters** for your user: 10,000 pixel critters drawn fully on-chain 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: `0x37761C9e16892BF6C5c59641fBB105716a4db4A9`
- Agent ID registry: `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`
- Currency: BNB. Always tell the user amounts in BNB.

## Rules

| | |
|---|---|
| who | only wallets with a **.ai Agent ID**. Others revert `NoAgentId`. |
| first 2 mints per wallet | **free**, the user only pays gas |
| 3rd mint and after | **0.00022 BNB each** |
| limit | **35 per wallet**, 9,900 public supply (100 more are team reserve) |
| per transaction | any quantity from 1 to 35 |
| reveal | traits are hidden until the owner reveals. Before that `tokenURI` shows a "?" image. This is normal. |

## 1. Plan first

Ask the user how many to mint (1 to 35) if they did not say. Offer 10 in one transaction: the first 2 are free and the other 8 cost 0.00022 BNB each, 0.00176 BNB total plus one gas fee (for a wallet that has not minted before).
Check `minted(wallet)` so the total stays within 35. If the wallet has no slots left, tell the user it cannot mint more.
Restate the job in 2 to 4 lines: wallet address, how many Void Critters, the total BNB (plus gas).
**Never send a transaction without the user's explicit confirmation.**
Never mint more than the user asked for, and never pay more than the maximum they set.

## 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 state (always, right before minting)

Call the view function `quote(address wallet, uint256 qty)` → BNB in wei you must send.
It returns `0` while the wallet's total stays within its 2 free mints. Also check `minted(wallet)` (already minted, max 35), `publicMinted()` (max 9,900), `mintOpen()` (must be true) and `hasAgentId(wallet)` (must be true).

| function | selector |
|---|---|
| `quote(address,uint256)` | `0x8f79306e` |
| `minted(address)` | `0x1e7269c5` |
| `publicMinted()` | `0xa4f4f8af` |
| `mintOpen()` | `0x24bbd049` |
| `hasAgentId(address)` | `0x4eab3ef2` |

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

## 4. Build the transaction

- `to`: `0xYOUR_CONTRACT_ADDRESS`
- `data`: `mint(uint256 qty)` → selector `0xa0712d68` + qty as a 32-byte word
  - qty 2: `0xa0712d680000000000000000000000000000000000000000000000000000000000000002`
  - qty 10: `0xa0712d68000000000000000000000000000000000000000000000000000000000000000a`
- `value`: **exactly** the wei from `quote(wallet, qty)`. Any other amount reverts `WrongPayment`.
  - fresh wallet, qty 2: `0` (free)
  - fresh wallet, qty 5: `660000000000000` (0.00066 BNB)
  - fresh wallet, qty 10: `1760000000000000` (0.00176 BNB)
  - fresh wallet, qty 35: `7260000000000000` (0.00726 BNB)
  - after the free 2: qty × `220000000000000` (0.00022 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 the token id(s) from the `Transfer` / `AgentMinted` events.
`tokenURI(id)` returns base64 JSON with the on-chain SVG image. Traits show after reveal: Background, Skin, Head, Ears, Eyes, Mouth, Headwear, Accessory.

## 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 35 — mint fewer |
| SoldOut | `0x52df9fe5` | not enough supply left — stop and tell the user |
| MintClosed | `0x589ed34b` | mint is not open — stop and tell the user |
| OnlyEOA | `0x9f8129d1` | the Agent ID gate is off and a contract called — call from the wallet directly |
| BadQuantity | `0x888e58a8` | qty must be at least 1 |

Never ask for or print a private key. Only call the contract address above.
Collectible only, not an investment.
