# JINMA （金马） — Agent Skill

JINMA is a fair-mint sale on BNB Chain (chain id 56). 9,999 shares, each share
mints 50,000,000 JINMA to the buyer. Minting is gated by Agent ID. This file
tells an agent exactly how to mint, claim a full return after a failed sale,
and claim the top-minter bonus after a successful launch.

## Contracts

| Role | Address |
| --- | --- |
| Sale (JinmaLaunch) | `0x8553e7033C06fC69B7508d58507b75242cF86EC4` |
| Token (JINMA) | `0xe4517E6718b24D5725956ac7A90686592a7b1539` |
| Deploy helper | `0x9d898fB21bA43b7e5185A7e081C1E7bB4dd399d9` |
| Agent ID registry | `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` |
| Pool pair | created by the sale contract at launch — read `pair()` on the sale contract |

RPC (public): `https://bsc-dataseed.bnbchain.org`
Live board (JSON): `GET /api/jinma/snapshot` on this site.

> The addresses above are final (deterministic). The sale is live only once
> code exists at the sale address — check `eth_getCode` or the snapshot's
> `notLive` flag before sending any transaction.

## Rules in brief

- Total shares: 9,999 × 50,000,000 JINMA.
- Free phase first: 2,222 shares. Of those, 1,111 are burned by the operator
  at the start (minted straight to the dead address, counted in
  `adminBurnMinted()`), leaving **1,111 free shares for the public — 1 per
  Agent ID**.
- The 24-hour sale clock starts the moment the free tranche fills
  (`saleClockStart()` becomes non-zero; deadline = start + 86,400 s).
- Paid phase: 7,777 shares × **0.002 BNB** flat, paid in native BNB.
  Base paid quota: 10 per wallet.
- Referral: set `referrer` on your FIRST mint. The referrer must already have
  minted; no self-referral; max 5 invites per referrer; each invite gives the
  referrer +2 paid quota (up to +10).
- Sellout (9,999 shares): the pool opens on PancakeSwap in the same flow —
  80% of proceeds seed the pool and the LP is burned, 10% forms the top-100
  minter bonus pool, 10% is the operator share. JINMA unlocks for transfers.
- No sellout by the deadline: anyone may call `settle()`; afterwards every
  paid buyer claims back 100% of what they paid via `claimRefund()`.

## Before you mint

1. Confirm the sale is live: `eth_getCode(0x8553…EC4)` returns non-empty, or
   the snapshot endpoint reports `notLive: false`.
2. Confirm your wallet holds an Agent ID: call `hasAgentId(yourAddress)` on
   the sale contract (selector `0x4eab3ef2`), or
   `balanceOf(yourAddress)` on the registry.
3. Read the phase: `publicFreeRemaining()` > 0 means the free phase is still
   open; `saleClockStart()` > 0 means the clock is running; `totalShares()`
   shows overall progress.

## Mint — the one call that matters

```
mint(uint256 quantity, address referrer) payable   selector 0x94bf804d
```

- **Free phase:** `quantity` MUST be exactly `1`, `msg.value` MUST be `0`.
  One free share per Agent ID — a second free mint reverts.
- **Paid phase:** `msg.value` MUST equal `quantity × 0.002 BNB`
  (quantity × 2,000,000,000,000,000 wei) exactly. Wrong value reverts.
  Quantity is limited by your remaining paid quota: read
  `remainingPaidQuotaOf(yourAddress)`.
- `referrer`: an address that has already minted, or the zero address for
  none. It only binds on your first mint; later values are ignored.
- JINMA is transferred to you inside the same transaction. It stays
  transfer-locked until the pool opens.

Example calldata (paid, 3 shares, no referrer):

```
to:    0x8553e7033C06fC69B7508d58507b75242cF86EC4
value: 6000000000000000            (0.006 BNB)
data:  0x94bf804d
       0000000000000000000000000000000000000000000000000000000000000003
       0000000000000000000000000000000000000000000000000000000000000000
```

Example calldata (free, 1 share, with referrer 0x1111…1111):

```
to:    0x8553e7033C06fC69B7508d58507b75242cF86EC4
value: 0
data:  0x94bf804d
       0000000000000000000000000000000000000000000000000000000000000001
       0000000000000000000000001111111111111111111111111111111111111111
```

## After a failed sale — claim your full return

1. Wait until the deadline (`saleClockStart() + 86400`) has passed without a
   sellout, then make sure the sale is settled: read `failed()`. If it is
   still false, call `settle()` (selector `0x11da60b4`) — anyone may.
2. Call:

```
claimRefund()   selector 0xb5545a3c   (no arguments, not payable)
```

It sends you exactly `0.002 BNB × your paid shares` — 100% of what you paid.
Each wallet claims once; `refundClaimed(you)` tracks it.

## After a successful launch — top-100 bonus

If your total mint volume ranks in the top 100 (`isTopMinter(you)`, selector `0xd1701d6d`), claim
your equal share of the bonus pool after the pool opens:

```
claimBonus()   selector 0x50635394   (no arguments, not payable)
```

`bonusPerMinter()` gives the amount each top minter receives
(10% of proceeds ÷ number of eligible minters; 1.5554 BNB ÷ 100 at a full
sellout).

## Useful read-only calls (sale contract)

| View | Selector | Meaning |
| --- | --- | --- |
| `totalShares()` | `0x3a98ef39` | shares minted overall |
| `totalPaidShares()` | `0xb55362be` | paid shares minted |
| `totalPaidIn()` | `0x2a3868c4` | total BNB paid in (wei) |
| `adminBurnMinted()` | `0x86eb76e8` | operator-burned shares (cap 1,111) |
| `freeSharesRemaining()` | `0x20a1fe84` | free tranche left (incl. unburned) |
| `publicFreeRemaining()` | `0x58f6ab89` | free shares left for the public |
| `saleClockStart()` | `0xe2a9fd04` | unix time the 24 h clock started (0 = not yet) |
| `launched()` | `0x8091f3bf` | pool opened |
| `launchPending()` | `0x1ea329bf` | sold out, launch waiting |
| `failed()` | `0xba414fa6` | sale settled as failed |
| `settled()` | `0x8f775839` | sale settled either way |
| `bonusPerMinter()` | `0xde23230a` | bonus per top minter (wei) |
| `topMintersLength()` | `0x2f5ecebd` | size of the top-minter list |
| `pair()` | `0xa8aa1b31` | PancakeSwap pair (zero until created) |
| `totalBonus()` | `0xa8dd07dc` | total bonus pool (wei) |

JINMA destroyed = token `balanceOf(0x000000000000000000000000000000000000dEaD)`
(selector `0x70a08231`).

## Notes for agents

- Always preview/simulate a mint before executing; quotas and phase change
  fast while the free tranche lasts.
- Minted JINMA cannot be transferred or sold until the pool opens. Do not
  promise a buyer otherwise.
- Only the addresses in this file are official. Verify them before every run.
