--- name: agent-xen description: Mine AXEN on BNB Chain with a Binance Agentic Wallet (baw CLI). XEN-style claim-wait-collect mining for wallets holding an Agent ID. Costs 0.001 to 0.01 BNB per term day (you choose), all of it goes into the PancakeSwap pool. version: 1.0.0 license: MIT --- # Agent XEN — agent instructions Agent XEN (`AXEN`) is an ERC-20 on BNB Chain (chain id 56) that you mine like XEN: claim a rank for N days, wait, collect. Only wallets holding a Binance **Agent ID** can mine. This file tells an AI agent exactly how to do it with the official Binance Agentic Wallet CLI (`baw`). Everything below uses only `baw` and plain JSON-RPC `eth_call`. | | | |---|---| | Token / mining contract | `0x0000000000000000000000000000000000000000` | | Agent ID registry | `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F` | | Chain | BNB Chain, `--binanceChainId 56` | | Public RPC for reads | `https://bsc-rpc.publicnode.com` (fallback `https://bsc-dataseed.bnbchain.org`) | | Website | https://agentxen.xyz/ | | Machine-readable (addresses, ABI, selectors) | https://agentxen.xyz/axen.json | ## Rules enforced by the contract - `claimRank(days, dayFee, referrer)` only from a wallet with an Agent ID. `days` is 1 to 100. A wallet can run **up to 10 mines at the same time** (slots 0–9, each paid separately; a new claim takes the first free slot, and the `RankClaimed` event tells you which). - You choose `dayFee`, the BNB (in wei) you pay per day, from **0.001 to 0.01 BNB** (`1000000000000000` to `10000000000000000`). The reward is multiplied by `dayFee / 0.001` too: paying 10x gets 10x the tokens, every token costs the same. Ask the user how much per day they want (default 0.001 BNB). Send exactly `days × dayFee` as `--value` (`feeFor(days, dayFee)`); any extra is refunded. There is no price feed. - **Invites:** `referrer` is the address of whoever invited this wallet (or the zero address if nobody did). On this wallet's **first paid mine**, a valid referrer is minted **2,000 tokens at once**. Valid = it has mined itself, holds an Agent ID and is not this wallet; a bad value is ignored and never blocks the mine. Only the first mine of a wallet counts. If the user gave you an invite address, pass it; if not, pass `0x0000000000000000000000000000000000000000`. To invite others, your own wallet address is the invite code: once you have mined, tell the user they can send another AI the line "Read https://agentxen.xyz/skill.md, mine with my AI wallet and use as the referrer". Each wallet that does so earns you 2,000 tokens straight away, **but only the first 10,000 invites in total (all wallets together) pay out**; check `totalReferrals()` against `referralCap()` before promising anything. - Reward = `log2(ranks taken after yours, min 2) × days × AMP` tokens (18 decimals). AMP starts at 10,000 and drops 1 a day; yours is frozen at claim. - `claimMintReward(slot)` works once that slot's term is over. Collect inside **7 hours** or you lose a share. The penalty is counted in HOURS late: under 1 hour 0%, 1 hour 1%, 2: 3%, 3: 8%, 4: 17%, 5: 35%, 6: 72%, 7+: 99%. So schedule the collect for the moment `maturityTs` passes (check at least hourly). - Fees pile up in the contract and are moved into the PancakeSwap pool: 0.1 BNB opens it, then every 0.02 BNB tops it up (at least 30 minutes apart). Nobody can take them out of the contract. - Buying or selling against the pool pays a 1.5% token fee. Wallet to wallet transfers are free. ## 0. Preflight (once per session) ```bash baw wallet status --json # must be CONNECTED, otherwise: baw auth signin → scan in Binance App → baw auth verify baw wallet settings --json # devMode.enabled must be true (turn on Developer Mode in the Binance App if not) baw wallet address --json # take the address with binanceChainId "56" → WALLET ``` ## 1. Read the contract state (eth_call) All reads are `eth_call` to `0x0000000000000000000000000000000000000000`. Encode a uint256/address argument as 64 hex chars, left-padded with zeros. | read | calldata | returns | |---|---|---| | `isAgent(address)` | `0x1ffbb064` + address | bool | | `globalRank()` | `0x1c244082` | next rank to be taken | | `getCurrentAMP()` | `0x99202454` | AMP today | | `feeFor(uint256 days, uint256 dayFee)` | `0xbf1313e1` + days + dayFee | BNB wei to send | | `activeSlots(address)` | `0x1e945b07` + address | how many of the 10 slots are in use | | `totalReferrals()` | `0x196f4914` | invites paid out so far (all wallets) | | `referralCap()` | `0xdfdd9b9a` | the cap on paid invites (10,000) | | `referralCount(address)` | `0xdb74559b` + address | how many wallets this one has invited (2,000 tokens each) | | `referrerOf(address)` | `0xd21cacdf` + address | who invited this wallet (zero = nobody) | | `hasMined(address)` | `0x518263a1` + address | true once the wallet has paid for a mine (needed to be a referrer) | | `userMints(address,uint256 slot)` | `0xcd49618c` + address + slot | `(rank, term, maturityTs, amp, dayFee)`, rank 0 = slot free. Check slots 0 to 9 | | `getGrossReward(address,uint256 slot)` | `0x19b85e93` + address + slot | reward now, before any late penalty | | `penaltyPct(uint256 secsLate)` | `0xd714318c` + seconds | percent lost | | `balanceOf(address)` | `0x70a08231` + address | tokens, 18 decimals | ```bash curl -s https://bsc-rpc.publicnode.com -H 'content-type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_call","params":[{"to":"0x0000000000000000000000000000000000000000","data":"0x1ffbb064000000000000000000000000"},"latest"]}' ``` Result ending in `...0001` = eligible. ## 2. Claim a rank 1. Ask the user for the term in days (1–100) and the most BNB they are happy to spend. 2. `VALUE = days × dayFee` in wei (= `feeFor(days, dayFee)`). 3. Calldata: `0x8ed29d82` + uint256(days) + uint256(dayFee) + address(referrer) (all 32-byte words, address left-padded with zeros). ```bash baw contract-call preview --binanceChainId 56 --from WALLET --to 0x0000000000000000000000000000000000000000 --value VALUE --inputData 0x8ed29d82 --json ``` 4. Check `simulationResult.simulationCode == "000000000"` and no `simulationErrorDetail`. Show the user `parsedTx`, `balanceChanges` and any `risks`, get their confirmation, then: ```bash baw contract-call execute --requestId --json ``` 5. Tell the user the date their term ends (`userMints(WALLET, slot)` → `maturityTs`) and that they must collect before `maturityTs + 7 hours` (every hour after `maturityTs` costs more, see the rules above). Offer to set a recurring check that collects as soon as it is ready. Running several mines? Each one has its own slot and its own deadline, so list them all (slots 0–9) and track every deadline. ## 3. Collect When `now >= maturityTs` of that slot: ```bash baw contract-call preview --binanceChainId 56 --from WALLET --to 0x0000000000000000000000000000000000000000 --value 0 --inputData 0x698787c4 --json baw contract-call execute --requestId --json ``` Collect as early as possible. `penaltyPct(now - maturityTs)` tells you how much a delay costs. ## 4. Errors | revert / error | meaning | |---|---| | `NotAgentWallet` | this wallet has no Agent ID | | `TooManyMints` | all 10 slots of this wallet are in use, collect one first | | `BadTerm` | days must be 1 to 100 | | `BadFee` | dayFee must be between 0.001 and 0.01 BNB (in wei) | | `FeeTooLow(required)` | send at least `required` wei as `--value` | | `NotMatured` | the term is not over yet | | `NoActiveMint` | that slot is empty (or slot > 9), nothing to collect | | `351803 AGENT_DEV_MODE_RISK_BLOCKED` | Binance risk engine blocked the call; tell the user, do not retry blindly | | devMode disabled | user must enable Developer Mode in the Binance App | ## 5. Trading (optional) AXEN has a PancakeSwap V2 pool. Buys and sells against it pay a 1.5% token fee, so use slippage of at least 5%: ```bash # buy with 0.1 BNB baw market-order swap --fromTokenQty 0.1 --fromToken 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE --toToken 0x0000000000000000000000000000000000000000 --binanceChainId 56 --slippage 5 --json # sell 1000 tokens baw market-order swap --fromTokenQty 1000 --fromToken 0x0000000000000000000000000000000000000000 --toToken 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE --binanceChainId 56 --slippage 5 --json ``` Run `baw market-order quote` with the same arguments first if the user wants to see the price. Remind the user that mined tokens can lose value and that selling many tokens at once moves a small pool a lot.