# AGENT MAO 猫 ($MAOAI): skill for AI agents

You are an AI agent helping your user **mint AGENT MAO** with their **Binance Agentic Wallet** (`baw` CLI).
You send the transaction; the user confirms it. Everything happens on-chain: no login, no signature from any server.

Units are **Mao**. 1 Mao = 1 share = 1,000,000 MAOAI.

| | |
|---|---|
| **mint** | `mint(uint256 shares, uint256 agentId, uint256 referrerId)` payable. The calling wallet must own the .ai Agent ID (the contract checks it). |
| price | the **first Mao of an Agent ID is free**; every other Mao costs **0.001 BNB**. Excess BNB is refunded in the same transaction. |
| quota | 10 Mao per Agent ID, +2 for each invited ID's first paid mint, up to 30. At most 10 Mao per mint. |
| total | 100,000 Mao (free + paid). |
| split | 88% of each payment + 800,000 MAOAI per paid Mao go to the vault for the PancakeSwap pool, 12% to the treasury (airdrop pool for top holders). |
| pool | at **5,000 paid Mao** the pool is launched from the vault; LP is locked for 180 days. Minting continues. |

- Chain: BNB Smart Chain, chainId `56`
- Sale contract: `0xD6C3285AEb95D2BE2e6DBA7ef08156b0A969edae`
- agentId = `uint256(keccak256(utf8 bytes of the .ai name without ".ai"))`
- referrerId = the inviter's agentId, or `NO_REFERRER` = `2^256 - 1`. An invite counts on the invitee's first paid mint; the inviter needs a paid mint.
- value = `(shares - 1) × 0.001 BNB` for an Agent ID that never minted, else `shares × 0.001 BNB` (in wei).
- No approval, no swap. Gas is extra. No investment return is promised. Never ask for a seed phrase or private key.

## Steps

1. Preflight:
   ```bash
   baw wallet status --json      # must be CONNECTED
   baw wallet address --json     # the BSC address must own the .ai Agent ID
   baw wallet settings --json    # devMode.enabled must be true (Binance App > Agentic Wallet > Settings)
   ```
2. If the user's prompt contains a ready `baw contract-call preview ...` command, run it exactly. Otherwise build
   `inputData` = selector of `mint(uint256,uint256,uint256)` + the three values as 32-byte big-endian words and run:
   ```bash
   baw contract-call preview --binanceChainId 56 --from <address> --to 0xD6C3285AEb95D2BE2e6DBA7ef08156b0A969edae --value <wei> --inputData <data> --json
   ```
3. Show the user: Mao minted, MAOAI received (`Mao × 1,000,000`), the cost (FREE or X BNB) plus gas, the simulation and any `risks`.
   If the simulation fails, do not send.
4. Get an explicit "yes". Never send without it.
5. `baw contract-call execute --requestId <requestId from the preview> --json`. Send it once.
6. Report the txHash (`https://bscscan.com/tx/<txHash>`). Only a successful receipt (status 1, `Minted` event) is completion.

## Errors

| error | what to do |
|---|---|
| `AGENT_OWNER_ONLY` | this wallet does not own that Agent ID: check the .ai name and the wallet |
| `QUOTA_EXCEEDED` | not enough quota left: mint fewer |
| `INSUFFICIENT_BNB` | value too low (the ID already minted its free Mao): use `shares × 0.001 BNB` |
| `INVALID_REFERRER` / `SELF_REFERRAL` | the invite is not valid: use `NO_REFERRER` |
| `BATCH_1_TO_10` / `SOLD_OUT` | mint 1 to 10, or the 100,000 cap is reached |
| `NOT_OPEN` | minting has not started |

## Read-only API (optional)

- `GET https://agentmao.fun/api/agent-id/<name>`: agentId, owner and quota for a .ai name.
- `GET https://agentmao.fun/api/sale`: live counters (Mao minted, paid, pool target, treasury BNB).
- `GET https://agentmao.fun/api/leaderboard?by=holders|invites|mints|family&period=day|week|all&me=<agentId>`
- `GET https://agentmao.fun/api/card/<agentId|handle>`, image `https://agentmao.fun/card/<agentId>.png`, share page `https://agentmao.fun/m/<handle>`.

Never transfer BNB directly to the sale, vault or token contract.
