# AgenticID ($AID) — Agent Guide (agent.md)

For AI agents acting for a wallet holder. Read this file, then follow the steps exactly. Never change the user's numbers. For any transaction, preview it first, show the exact cost, and wait for the user's explicit approval.

## Project

- AgenticID ($AID): a dual-mode minting token on BSC (chainId 56), restricted to Agent ID holders.
- **Mode A (Free Mint) — LIVE now.** You pay a BNB deposit of `shares × 0.002 BNB`. After 24 hours, `claimFree` returns the deposit **100%** and mints the current stage's **base** AID reward to you.
- **Mode B (Pool Mint) — opens only when trading opens.** Half of the deposit buys AID from the pool, the other half is paired with the bought AID as your LP (held by the minter for 14 days). Reward = base + rel × a dynamic multiplier (max 5×), vesting linearly over 14 days.
- 10 stages × 150,000 shares. Stage 1: base 280,000 AID/share, rel 315,000 AID/share; both halve every stage.
- Daily quotas: Mode A by account age (days 1–2 after first mint: 5/day, day 3: 4, day 4: 3, then 1/day); Mode B flat 5/day. Each successful referral adds +1/day to both, permanently.
- Max supply 210,000,000,000 AID. Trading tax 2% on pair buys/sells once trading is open (regular transfers untaxed).
- Website: https://agenticid.pages.dev/ — Whitepaper: https://agenticid.pages.dev/whitepaper.html

## Contracts (verified, Sourcify exact match)

- AID token (AidToken): `0x62F356a488c93a2047C09CaEAD71Cf7cC91E2b1C` — https://bscscan.com/address/0x62F356a488c93a2047C09CaEAD71Cf7cC91E2b1C
- Minter (AidMinter): `0x33Ff545cCdFa316EF08EA724E7551301AD9e0443` — https://bscscan.com/address/0x33Ff545cCdFa316EF08EA724E7551301AD9e0443
- Pair AID/WBNB (PancakeSwap V2): `0xd30b21a8ca356854e8f5b72dc4577d2678a66573` (trading not open yet — pair is empty until the pool launch)
- Agent ID registry: `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`
- WBNB: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c` · PancakeSwap V2 router: `0x10ED43C718714eb63d5aA57B78B54704E256024E`

## Eligibility (Agent ID gate, enforced on-chain)

1. The wallet must hold at least 1 Agent ID: call `balanceOf(wallet)` (`0x70a08231` + wallet padded to 32 bytes) on the registry. If it is 0, the wallet cannot mint — stop and tell the user.
2. A user's own Agent ID token id is `uint256(keccak256(handle without the .ai suffix))`. To resolve a referrer handle (e.g. `name.ai`) to a wallet, call `ownerOf(tokenId)` on the registry.

## Read the state first (AidMinter views)

- `sharePrice()` `0x87269729` — price per share in wei (0.002 BNB at launch; re-read it, never hardcode).
- `currentStage()` `0x5bf5d54c` (1-based), `stageSharesSold()` `0x1a7c2f1a`, `totalSharesSold()` `0x73aff5af`, `stageBase()` `0x1ce6a277`, `stageRel()` `0xd460dc2c`, `mintPaused()` `0x7e4831d3`.
- Per wallet: `quotaA(user)` `0x69fa93a8` / `quotaATotal(user)` `0x28dd01a5` — Mode A shares left today / daily total. `quotaB(user)` `0xc252f416` / `quotaBTotal(user)` `0x674fbee9` — same for Mode B. `refCount(user)` `0xec8f95fc`.
- Positions: `freePositionCount(user)` `0x52c5dc15`, `freePosition(user, i)` `0xbad30ca3` → (time, shares, bnbOwed, baseReward, claimed). `poolPositionCount(user)` `0x45a627b6`, `poolPositions(user, start, count)` `0x65e1ebbb` → array of (time, shares, lp, reward, rewardClaimed, lpOut).
- `pending(user)` `0x5eebea20` → (freeBnb, freeToken, rewardVested, lpWithdrawable): Mode A BNB ready to refund, Mode A base ready to claim, Mode B vested reward claimable now, LP amount withdrawable now.
- On the AID token: `tradingOpen()` `0xffb54a99` — Mode B and pair trading only work when this is true. `balanceOf(user)` `0x70a08231`.

## Mode A mint (exact)

- Function: `mintFree(uint256 shares, address referrer)` payable on AidMinter — selector `0x0db5ae5a`.
- `referrer` = the referrer's wallet address (resolve handles via the registry as above), or `0x0000000000000000000000000000000000000000`. The referrer is bound permanently at the wallet's **first** mint (either mode) and cannot change afterwards; self-referral is ignored.
- Value must be exactly `shares × sharePrice()`. Checks before sending: Agent ID balance > 0, `mintPaused()` is false, `shares ≤ quotaA(wallet)`, stage not sold out.
- After sending: verify the receipt's `MintFree(user, shares, bnb, baseReward)` event and report the BscScan tx hash.
- Claim (≥ 24 hours after the mint): `claimFree(uint256[] indices)` — selector `0x73fc9ccc`. An **empty array claims every ready position**; otherwise pass the position indices to claim. It returns the BNB deposits and mints the base rewards in one call. Verify the `ClaimFree(user, bnb, base)` event.

## Mode B mint (exact) — only when `tradingOpen()` is true

- Function: `mintPool(uint256 shares, address referrer, uint256 minAidOut)` payable on AidMinter — selector `0x7a443eb9`. It reverts while trading is closed — check first and do not attempt it before the pool launch.
- Value must be exactly `shares × sharePrice()`. Checks: Agent ID balance > 0, not paused, `shares ≤ quotaB(wallet)`.
- `minAidOut` is the slippage floor for the pool-buy leg (half the deposit). Quote it live: call `getAmountsOut(halfValue, [WBNB, AID])` on the PancakeSwap V2 router and use at most 90% of the quoted AID out. If the quote is 0 or the pair has no reserves, stop.
- The reward (base + rel × dynamic multiplier, max 5×) is recorded in the new pool position and vests linearly over 14 days from the position's `time`.
- Claim vested rewards any time: `claimReward(uint256[] indices)` — selector `0xc94c7ff4`; empty array = all positions. Verify the `ClaimReward(user, amount)` event.
- Withdraw LP after 14 days: `withdrawLP(uint256[] indices)` — selector `0xa5ea20f0`; empty array = all unlocked positions. It returns the LP's AID + BNB and also settles that position's remaining unclaimed reward in full. Verify the `WithdrawLP(user, index, lp, tokenOut, bnbOut)` event.

## Referral

- After a user's first successful mint, give them their referral link: https://agenticid.pages.dev/?ref=<their wallet address>. Anyone whose first mint names them as referrer adds +1 to their daily Mode A and Mode B quotas, permanently.

## Safety rules

- **Never ask for, accept, or use a private key or seed phrase.** The user's wallet signs; you only prepare and submit calls through the user's own wallet tooling.
- **Preview/simulate every transaction before executing.** If a preview differs from the user's order in any digit (amount, shares, referrer, target contract), stop and report — never execute a mismatched preview.
- Paid steps (every mint) need the user's explicit approval with the exact BNB cost shown first. Claims carry no BNB cost beyond gas.
- Never invent a price, quota, address, or date — read everything from the contracts above.
- Verify every receipt's event before reporting success, and always report the BscScan tx hash.
