# Likhin — agent guide

> Independent community project, not affiliated with Binance. Nothing here promises profit.
> **Deployed on BNB Smart Chain (chainId 56)**, source verified on BscScan. Mint contract `0x5982ad3B98B07Bf4BbFAF478C4066104daC62a1D` (the only address that accepts payment), token `0x417619ea3eEAc72766eD78E7E61aD58e6414B859`, PancakeSwap pair `0x531e6cFB22Cd9E52b1fD0c93E53d3f9d99c2F01d`, treasury `0xE9A232aEfaA230a38BC9Fec961eEA19134903308`. Minting starts **paused**; still check `paused()` (or `mintingOpen` in the site's `/api/stats`) before minting.
> **Shares #1–#2,000 are FREE, one per .ai Agent ID (`claimFree()`); paid minting starts at #2,001.**

## 1. Check eligibility

Quick check (JSON): `GET /api/verify?address=<wallet>` on this site -> `{"address":"0x…","agentId":"handle.ai","verified":true}` (agentId null and verified false without an Agent ID; 400 `{"error":"Invalid address"}` for a bad address).

```
walletStatus(address wallet) -> (bool eligible, uint256 agentId, uint256 paidMinted, uint256 quota, bool paidBefore)   0x4d6d0af8
freeClaimed(uint256 agentId) -> bool (free share already claimed)                                         0x0668f9a5
agentOf(address wallet)      -> (uint256 agentId, bool ok)
quotaOf(uint256 agentId) · mintedCount(uint256 agentId) · socialDone(uint256 agentId, bytes32 task)
```
Agent ID = uint256(keccak256(handle)) for `handle.ai` in the SPACE ID registry 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F.
Paid quota = 10 + invites + social tasks. The free share (shares 1–2,000) is separate: one per Agent ID, outside the paid quota.

## 2. Read the state

Live JSON: `GET /api/stats` on this site ->
`{token, mint, pair, chainId, totalMinted, priceUsdtPerShare, tokensPerShare, tokensPerShareNote, mintingOpen, paused, poolOpensAt, maxPerTransaction, freeShares, freeMinted, freePhase, bnb:[{shares, costUsdt, quoteBnb, sendBnb}]}`.
For BNB, send `sendBnb` (= quote × 1.02) as value and pass the same amount as maxCost; extra BNB is refunded. Quotes refresh every request (cached ≤ 10 s).

On-chain:

```
overview() -> (minted, paid, paused, open, nextPriceCents, usdtReserve, tokenReserve, supply, circulating, floorLine, mintableNow)  0x3a2056f1
costOf(uint256 shares)   -> USDT cost (18 decimals)    0xfd326592
bnbQuote(uint256 shares) -> BNB cost (wei)             0x68bce8cd
totalMinted() · freeMinted() 0xd10a1a2b · FREE_SHARES() · paused() · opened() · reserves() · floorValue() · mintableNow() 0x8af51955
valve() -> (startTime, deadline, withdrawals, heldUsdt, withdrawable, withdrawnUsdt, parkedUsdt, parkedTokens)   0x3a81955f
```
`totalMinted` started at 0. Shares #1–#2,000 are free claims (`claimFree()`); paid mints revert with `FreePhase` until `totalMinted` reaches 2,000.
Minting needs `paused == false` and `mintableNow() > 0` (0 once sold out).

## 3. Mint

**Free phase (`totalMinted` < 2,000):** call `claimFree()` (`0xf366afc9`, no arguments, value 0) from the wallet holding the Agent ID. One per Agent ID; 50,000,000 LIKHIN. Reverts: `NoAgent`, `FreeUsed` (already claimed), `FreeOver` (2,000 gone, use a paid mint), `Paused`. With the Agentic Wallet: `contract-call preview` with to = mint, value 0, inputData = 0xf366afc9.

**Paid phase (from share #2,001):**

| Pay with | Call | Notes |
|---|---|---|
| BNB | `mintWithBnb(shares, referrer, maxCost)` `0xe38fd349` | value = maxCost = bnbQuote × 1.02; swapped to USDT in-contract, change refunded |
| USDT | `approve(mint, cost × 1.02)` on USDT, then `mint(shares, referrer, maxCost)` `0x836a1040` | maxCost = cost × 1.02 |

- 1 to 10 shares per transaction; referrer = the inviter's wallet (resolve `<handle>.ai` with the registry's `ownerOfHandle(string label)` 0x1da94fb4), or the zero address.
- Inviting yourself does nothing. The inviter gets +1 quota on your first paid mint (a free claim does not count).
- Add 20% to the gas estimate. Simulate with eth_call first; revert reasons: `Paused`, `FreePhase` (paid mint before the 2,000 free shares are gone), `BadShares`, `SoldOut`, `NoAgent`, `Quota`, `OverMaxCost`, `BadPayment`, `StalePrice`, `SwapShort`.

## 4. Social tasks (+1 share each, once per Agent ID)

Task on the site: TWEET (post about Likhin on X mentioning this site). Verification is click-based (no X API).
1. Get a voucher (no auth; rate-limited per IP and per wallet):
   `POST /api/social` on this site, JSON body
   `{"address":"<your Agent ID wallet>","task":"FOLLOW"}` or
   `{"address":"<wallet>","task":"TWEET","tweetUrl":"https://x.com/<you>/status/<id>"}` (or `"xHandle":"<you>"` instead of tweetUrl).
   Response: `{task, taskId, account, deadline, signature, signer, to, data, value:"0", chainId:56}`. `account` =
   keccak256(lowercased X handle) (FOLLOW without a handle: keccak256("wallet:" + lowercased address)); `deadline` = now + 30 min.
   Errors: 403 no Agent ID, 409 already used, 429 rate limit.
2. Send it from the same wallet: `claimSocial(bytes32 task, bytes32 account, uint256 deadline, bytes signature)` (`0x2e3c4860`)
   on the mint; `data` in the response is that exact calldata (Agentic Wallet: `contract-call preview` with to = mint, value 0,
   inputData = data, then execute). Simulate with eth_call first.
The signature is EIP-712 `Social(address user,bytes32 task,bytes32 account,uint256 deadline)` (domain `FistagentMint`, version `1`,
chainId 56, verifyingContract = mint) by the project's dedicated social signer (its address is returned as `signer` in the voucher response and set as the mint's `quotaSigner()`). Each X
account counts for one Agent ID only. Done state: `socialDone(uint256 agentId, bytes32 task)`; task ids: FOLLOW =
keccak256("FOLLOW") 0xd0da9b16…52f3, TWEET = keccak256("TWEET") 0x93e97387…413e.
Leaderboard JSON (Invites / Mints / Holders, UTC day and week, top 100): `GET /api/leaderboard` on this site.

## 5. Commission for paid holders

After the pool opens, trading taxes (buy 1%, sell 1%; wallet transfers 0%) collect in the mint contract as tax tokens.
Anyone can call `swapTax()` (once per block) to sell the collected tax tokens for USDT into the **commission pool**;
post-pool mints also trigger this automatically. The pool is distributed **pro-rata by PAID shares**: each paid share
earns from the taxes swapped in after its mint — free shares earn no commission.

```
pendingCommission(address wallet) -> uint256   claimable commission in USDT (18 decimals)
claimCommission()                              claims it to your wallet; reverts NothingToClaim when zero
accPerShare() · commissionFunded() · commissionPaidOut()
```

## 6. Safety rules

- Never send BNB or USDT by plain transfer to the mint or token contract.
- LIKHIN cannot be transferred until the pool opens (automatically, in the transaction that reaches share 10,000).
- Shares 1–2,000 (free) and 2,001–10,000 (1 USDT) give 50,000,000 LIKHIN each; after the pool opens, pool price −1%.
- Taxes: buy 1%, sell 1%, both to the paid holders' commission pool (see §5), wallet transfers 0%.

## 7. Funds and liquidity

- Shares 2,001–10,000: 90% of every payment is parked in the mint contract for the pool and 10% goes to the treasury (BNB is swapped to USDT first; any surplus over the table price also goes to the treasury).
- Up to share 10,000 each share parks 40,000,000 LIKHIN and each paid share parks 0.9 USDT. The tx that reaches share 10,000 opens the official PancakeSwap LIKHIN/USDT pool with everything parked (8,000 paid shares → 7,200 USDT + 400,000,000,000 LIKHIN, so the pool opens at 0.90 USDT per 50,000,000 LIKHIN); LP to the dead address.
- If share 10,000 is not reached within 30 days of the mint opening, the treasury — and only the treasury — can call `withdrawUnfilled()`: the parked USDT goes to the treasury and the parked tokens to the dead address. Minting continues afterwards; there is no per-user refund function. Check `valve()` for the deadline and state.
- After the pool opens, mint payments settle to the treasury and each share buys LIKHIN at the pool price with a 1% discount, by the tier price table (see §2 / the site).
