---
name: agentlode-mint
description: Use when the user wants to mine LODE, Mint with an AgentID or ordinary EVM wallet, check AgentLode balances, quota, orders or unlocks, or interact with AgentLode contracts.
---

# AgentLode

Install from npm (Node.js 22.18+). Deployment, ABIs and instructions are bundled. Use RPC and the user's wallet directly; no website server, configuration download or project API is needed.

```sh
npm install -g agentlode-cli
agentlode skill
```

## Rules

- AgentID means the participating EOA holds the qualifying SBT: 0.002 or 0.02 BNB; full reward available after opening. Ordinary EVM: 0.02 BNB; target 50% immediate availability after opening, otherwise the full reward unlocks linearly over 24 hours from the later of Mint and opening. Wallet brand does not determine eligibility.
- Both receive all tokens in the Mint transaction. No claim. Only direct EOAs without deployed/delegated code. 100,000 slots, ten lifetime Mints per address; either tier uses one slot. Everyone mines; ten minutes is a reference-device average.
- Opening at slot 10,000, or after `openDeadline` (Unix seconds, `progress` shows it) when anyone calls `open()` with the accrued liquidity. Before opening every slot pays 500,000,000 LODE/BNB. Later: `payment / (0.99 × spot)`, where spot is the pair's current reserve price (Controller `spotPrice`, BNB wei per whole token). Reserves at inclusion determine the final amount; same-block trades move them, so `mint(proof, minReward)` reverts when the issued reward is below the floor. `prepare` sets the floor to the quote (exact before opening, 1% below it afterwards); `--min-reward WEI` overrides it. 90% of payment goes to liquidity, 10% to Dev; gas is extra. Configured-pair buy tax: 1% Dev; sell: 1% Dev + 1% burn.
- On PancakeSwap, set sell slippage to at least 2% and buy slippage to at least 1%. Sells must use a fee-on-transfer-aware route with an exact input amount; otherwise the swap can revert or deliver less.

## Mint

Use the user's authorized address. Read `agent`, `allowedPayments`, `remaining`, `nativeBalance` and `blocker`. Proceed only if `blocker` is null. Agree on amount, count and spending budget before payment. This example is one AgentID slot; ordinary EVM uses 0.02.

```sh
agentlode status --address 0xYOUR_EOA
agentlode quote --address 0xYOUR_EOA --payment 0.002
agentlode mine --address 0xYOUR_EOA --payment 0.002 --out proof-1.json
agentlode prepare --address 0xYOUR_EOA --proof proof-1.json --out transaction-1.json
```

These commands do not spend funds. Submit the exported `transaction` through the user's existing EVM wallet/signer: preserve `chainId/from/to/value/data/gas`. `value` is decimal wei; gas limit is 1,200,000, and unused gas is not charged. Convert numeric fields to hex quantities only if the wallet's RPC interface requires it. Never ask the user to paste a private key or seed phrase. If no signer is connected, return the prepared transaction for signing.

### Signer options

Preferred: Binance Agentic Wallet (`baw-preview` / `baw-send`) or the user's own EVM wallet/signer. Before signing, verify `chainId=56`, `from` is the intended EOA, `to` is the Controller, `value` is the agreed payment, `gas=1200000`, the call data starts with the mint selector, and `minReward` is the current quote (exact before opening).

For isolated automation only, the CLI has an explicit local env signer. It does not auto-discover keys:

```sh
cat > .env <<'EOF'
AGENTLODE_PRIVATE_KEY=<YOUR_PRIVATE_KEY>
EOF
chmod 600 .env
agentlode send --tx transaction.json --signer env --env .env --yes
```

- Reads only a `.env` directly in the current working directory, mode `600`, and only `AGENTLODE_PRIVATE_KEY`.
- Accepts only a prepared AgentLode mint transaction; verifies chain, sender, Controller, value, gas and selector.
- Sends exactly once and waits for the receipt; it does not retry or resubmit.
- Never commit `.env`, never use a main treasury key, and remove the file after the test.
- The private key is read inside the signer process only; it is never printed or passed as a command-line argument.
- Fee choice is left to the signer; BSC accepts EIP-1559 transactions, and `gas=1200000` is the contract limit.

```sh
agentlode receipt --address 0xYOUR_EOA --tx 0xTRANSACTION_HASH
agentlode orders --address 0xYOUR_EOA
```

Only `CONFIRMED` completes Mint. Mine afresh for each next slot, with new output filenames. On pending/unknown submission, check the existing hash, wallet history and orders before retrying. `STALE_PROOF`: refresh state and mine again. `WORK_LIMIT`: continue with `--start-nonce` set to `details.nextNonce` only while the challenge remains current.

## Query and contract access

| Need | Command |
|---|---|
| Global progress, without a wallet | `agentlode progress` |
| Identity, quota, BNB, total/locked/transferable LODE | `agentlode status --address EOA` |
| Orders and each reward's unlock schedule | `agentlode orders --address EOA` |
| Any single order | `agentlode order --id 1` |
| Mint receipt / other transaction receipt | `agentlode receipt --address EOA --tx HASH` / `agentlode tx --tx HASH` |
| Bundled deployment / full reference | `agentlode deployment` / `agentlode docs` |
| All interfaces / one full ABI | `agentlode contracts` / `agentlode contracts --contract token` |

`balance`, `locked`, `transferable` are raw token units (`decimals` is in status); BNB amounts are wei, timestamps are Unix seconds. Per-order `unlock.unlocked` is vested issuance, not the wallet's unspent balance; use `status.transferable` to spend. Before opening, unlock timestamps are null.

All four project contracts are covered: `controller`, `token`, `verifier`, `identity`. List their ABIs, then use `read` for any view/pure function and `prepare-call` for other transactions. Supply integer arguments as decimal strings in a JSON array. Example:

```sh
agentlode read --contract token --function totalSupply
agentlode read --contract token --function allowance --args '["0xOWNER","0xSPENDER"]'
agentlode prepare-call --address 0xYOUR_EOA --contract token --function approve --args '["0xSPENDER","1000000000000000000"]' --out approval.json
```

`prepare-call` simulates and exports; it does not broadcast. Submit through the wallet only for the user's requested operation, then verify with `tx`. It cannot bypass contract permissions. Mint uses the proof-aware `prepare` command. Token `configure/mint/mintReward/enableTrading` are contract-only lifecycle calls; `withdrawDev` requires treasury.

Optional wallet adapter: `--wallet baw` discovers the connected address; `baw-preview` and `baw-send` handle approved Mint execution. Run `agentlode docs` for setup. Every command supports `--rpc URL` and `--deployment FILE` overrides when needed; defaults are embedded. Commands return JSON except `skill/docs/help`; exit codes are 0 complete, 1 error/reverted, 2 pending/unknown, 130 interrupted.
