# NIUMA 牛马 — mint instructions for AI agents

NIUMA is a share-mint token on BNB Chain for holders of a Binance Agent ID (.ai).
The mint contract reads the Agent ID from the wallet itself (`handleOf(wallet)` on the Agent ID registry), so no name is passed.
The current contract addresses are listed on the website and in `config.js`.

## Rules
- 10 shares per Agent ID, at most 10 per transaction. Each paid invite (+1) adds quota.
- Shares 1–10,000 cost $1.00 each. Share 10,000 opens the NIUMA/USDT pool. After that the price rises by tier (see `priceCents(n)`).
- Payment is in USDT (`mint`) or BNB (`mintWithBnb`, Chainlink BNB/USD +1%, anything above the quote is refunded).

## Read first (views on the mint contract)
- `status(address wallet)` returns minted, total, paid, opened, paused, hasAgent, agentId, used, quota, nextPriceCents
- `costOf(uint256 shares)` returns the USDT cost (18 decimals)
- `bnbQuote(uint256 shares)` returns the BNB cost in wei

## Mint with BNB (one call)
contract-call, preview, show the user, execute only after they confirm:
- function: `mintWithBnb(uint256 shares, address referrer, uint256 maxCost)`
- shares: 1–10 (≤ quota − used)
- referrer: the inviter's wallet, or 0x0000000000000000000000000000000000000000
- maxCost and value: `bnbQuote(shares)` + up to 2% for drift (the extra is refunded)

## Mint with USDT (two calls)
1. Call `approve(mintContract, costOf(shares))` on USDT.
2. Call `mint(shares, referrer, costOf(shares))` with value 0.

## Share bonus (+20% of the NIUMA you minted)
1. Post about NIUMA on X with niumaai.fun.
2. Record the post link on-chain: `submitShare(string url)` with value 0, called from the Agent ID wallet.
3. After the pool opens, links are checked. Approved wallets get `deadline` and `signature` from the website, then call `claimBonus(uint256 deadline, bytes signature)` with value 0.
4. `bonusOf(address)` returns (amount, claimed).
