# AigentCard — mint instructions for an AI agent

You are minting AigentCard trading cards (ERC-721) on BNB Smart Chain (chainId 56) for the wallet you control.

Contract: 0x0000000000000000000000000000000000000000  (placeholder until launch — check https://aigentcards.com/agent.json)
AGC token: 0x0000000000000000000000000000000000000000  (placeholder until launch; equals TOKEN() of the card contract)

## Rules
- Call directly from an EOA (not from a contract).
- Paid: open to ANY wallet, no Agent ID needed. Exactly 0.001 BNB per card, up to 10 per wallet in total. msg.value must equal quantity × 0.001 BNB exactly (no overpay, no refunds). Paid mints are limited only by remaining supply (3,000 − minted), so free slots nobody claims can be bought.
- Free: 1 card per .ai Agent ID (registered in SPACE ID registry 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F, handleOf(wallet) must be non-empty and you must own it), at most 500 free in total, only while supply remains.
- Each card is drawn at random from the cards not yet minted. Only 5 Legendary exist.
- AGC reward: every card minted (free or paid) also mints AGC (ERC-20, 18 decimals) to your wallet, by the card's rarity: Legendary 9,240,000 · Epic 840,000 · Rare 300,000 · Uncommon 180,000 · Common 120,000 AGC. AGC total supply 1,000,000,000: 60% NFT minters, 25% liquidity, 15% project treasury. No owner, no tax.

## Steps
1. eth_call `eligibility(address)` (selector 0x63c36dec) with your wallet. It returns (handle, freeRemaining, paidRemaining). If handle is empty the wallet has no Agent ID: skip the free claim, paid mint still works.
2. If freeRemaining == 1: send a transaction to the contract with data `0x8ab53447` (mintFree()) and value 0.
3. To buy N paid cards (1 ≤ N ≤ paidRemaining): send data `0x26c7f77c` + N as a 32-byte uint, with value N × 1000000000000000 wei.
   Example N=5: data `0x26c7f77c0000000000000000000000000000000000000000000000000000000000000005`, value 5000000000000000 wei (0.005 BNB).
4. Read the `CardMinted(address,uint256,uint256,uint256,bool)` logs in the receipt (topic0 0xa78bd83a307514c7ef3bf7af1e55166053ebcc0070ce13abacc42c1572beca5f). topic2 is the tokenId; the `tier` field (0 Legendary … 4 Common) tells you the AGC received (or call agcReward(tier), selector 0xd81170ba). Metadata: https://aigentcards.com/meta/{tokenId}.json
5. Gas: mintFree ≈ 0.27M gas, mintPaid ≈ 0.15M for 1 card, ≈ 0.9M for 10 cards (includes the AGC mint). Set a gas limit with headroom.

## Errors
NotAgentOwner (free claim only) · FreeAlreadyClaimed · FreeSoldOut (500 free used) · WalletQuotaExceeded (over 10 paid per wallet) · SoldOut (not enough supply left) · WrongPayment(required) · BadQuantity (0 or more than 10) · NoContracts (call directly from an EOA, not from a contract).

Ready-to-paste prompt for a wallet agent:
> Mint AigentCard on BNB Chain. Contract <ADDRESS>. First eth_call eligibility(myWallet). If freeRemaining is 1, call mintFree() with value 0. Then call mintPaid(<N>) with value exactly <N> × 0.001 BNB (N ≤ paidRemaining, max 10 per wallet; no Agent ID needed for paid). Report the tokenIds and tiers from the CardMinted events and the AGC received.
