# QUOGENT — skill for AI agents

You are an AI agent minting **QUOGENT** for your user: 7,777 pixel computers 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: `0x611984D45b3FA757978449D40e3398aB7074D205`
- Currency: BNB. Always tell the user amounts in BNB.

## Rules

| | |
|---|---|
| who | only wallets with a **.ai Agent ID**. Others revert `NoAgentId`. |
| free mints | **1 free per wallet** (gas only), from a shared pool of **4,000** |
| every other mint | **0.0005 BNB each** (mints 2–20, or any mint once the free pool is gone) |
| limit | **20 per wallet**, 7,777 total |
| caller | must be the wallet itself (no contracts in between), else `OnlyWallets` |

## 1. Ask how many, then plan

Before anything else, ALWAYS ask the user how many QUOGENT they want to mint, even if their message already names a number. Offer exactly these options: 1, 5, 10, or 20.

First read mintedBy(wallet) and quote(wallet, qty) for each option, then ask like this:

How many QUOGENT do you want to mint?
• 1 = <quote> BNB
• 5 = <quote> BNB
• 10 = <quote> BNB
• 20 = <quote> BNB
(+ gas)

Rules:
• Show prices in BNB from quote(), never guess. A fresh wallet gets the first one free: 1 = 0 BNB, 5 = 0.002, 10 = 0.0045, 20 = 0.0095.
• Hide any option that would push the wallet past 20 (20 - mintedBy). If 20 - mintedBy is not 1, 5, 10, or 20, also offer that exact remaining number.
• If the wallet already holds 20, tell the user the wallet limit is reached and stop.
• Wait for the user's answer. Do not choose for them.

Then restate the job in 2 to 4 lines: wallet address, how many QUOGENT, 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)` (max 20), `freeLeft(wallet)` (0–1), `freeClaimed()` (of 4,000) and `totalSupply()` (of 7,777).

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

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

## 4. Build the transaction

- `to`: `0x611984D45b3FA757978449D40e3398aB7074D205`
- `data`: `mint(uint256 qty)` → selector `0xa0712d68` + qty as a 32-byte word
  - qty 1: `0xa0712d680000000000000000000000000000000000000000000000000000000000000001`
- `value`: **exactly** the wei from `quote(wallet, qty)`. Any other amount reverts `WrongPayment`.
  - fresh wallet, qty 1: `0` (free)
  - fresh wallet, qty 3: `1000000000000000` (0.001 BNB: 1 free + 2 paid)
  - paid mints: `500000000000000` wei (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 `Launched` / `Transfer` events.
Art and traits are live from the moment of mint: `tokenURI(id)` points to IPFS metadata, no reveal.

## 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 20 — 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.
