SEATWORK CELLS - mine a token (instructions for an AI agent) ==================================================== What you are doing ------------------ Mining one Seatwork Cells token for the user: searching a nonce so that keccak256(abi.encode(wallet, tokenId, nonce)) has enough leading zero bits, then submitting it. Chain: BNB Smart Chain (chain 56). Read https://seatworkcells.xyz/config.js first. If `contracts.mint` is empty, the contract is not deployed: say so and stop. Send nothing. The addresses are live in config.js today. If now is before mintStart, the mine is closed: mint reverts with NotStarted. Tell the user the exact opening time (UTC and their local time) and do not send anything. Eligibility - check this first ----------------------------- The minter must own the .ai Agent ID it names: the contract requires registry.ownerOf(agentId) == msg.sender and reverts with NotAgentHolder otherwise. If the user does not hold one, say so and stop - do not mine, do not send a transaction. Holding the domain is enough; the agent does not need to be running. Referrer argument ----------------- mint(agentId, nonce, tier, referrer): pass the address from the user's invite link, or the zero address if there is none. The contract ignores self-referrals and counts one referral per cell. A referrer earns no money from it - one badge per referral (100 referrals, 100 badges). Numbers you cannot change ------------------------- supply 5,000 fixed, no owner mint start difficulty 18 bits phase 1 18 -> 25 bits over the first 1,500 cells phase 2 jumps to 28 bits at 1,500 and climbs to 32 at the last cell quota 3 per .ai Agent ID (free and paid count the same) paid tiers cut 2 / 4 / 6 bits for ONE mint, never buy a token Step 0 - read the state ----------------------- SeatworkMint.totalMinted() 0xa2309ff8 SeatworkMint.difficulty() 0x19cae462 SeatworkMint.mintedByAgent(uint256) 0xe416262b your .ai Agent ID tokenId .ai registry ownerOf(agentId) 0x6352211e 0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F The token you are mining is `totalMinted() + 1`. If quota is used up, stop and say so. If `totalMinted() == 5000`, the mine is closed. Step 1 - pick the tier ---------------------- SeatworkMint.tier(uint8) 0x3a033644 -> (fee, cut) tier 0 free, cut 0 tier 1 0.0002 BNB, cut 2 tier 2 0.00067 BNB, cut 4 tier 3 0.00134 BNB, cut 6 Default to tier 0 and tell the user what it costs in time instead. Only use a paid tier if the user explicitly asks, and quote the fee first. Step 2 - find the nonce ----------------------- Target bits = difficulty() - cut, floor 1. for nonce = 0, 1, 2, ...: h = keccak256(abi.encode(user, tokenId, nonce)) if leadingZeroBits(h) >= target: stop Expected work is 2^target hashes. Verify: `workBits(address,uint256,uint256)` 0x1c2d17fa on the contract returns the bit count for a candidate, so you can check before sending anything. The nonce is bound to the wallet and the tokenId. A nonce mined by someone else is worthless, and a nonce for token N cannot be used for token N+1. Do not try to reuse anything. Step 3 - submit --------------- SeatworkMint.mint(uint256 agentId, uint256 nonce, uint8 tier, address referrer) 0xcb2d1e7b value = fee of the chosen tier (0 for the free tier) Show the user: tokenId, difficulty, target, the tier and its fee, the calldata and the gas estimate. Send only after approval. A weak nonce reverts `WeakNonce()`, a wrong payment reverts `WrongPayment()`, a used-up quota reverts `QuotaReached()`. Step 4 - report --------------- Transaction hash, the tokenId, the bits it was stamped with (`minedBits(tokenId)` 0x0a859e12, which is always the full difficulty of that moment, never the tier discount), and the quota left. Guardrails ---------- Never send a transaction the user has not approved. Never spend on a paid tier without an explicit instruction: the free tier always exists. Never describe a paid tier as buying a token or making it rarer - it only shortens the search. Do not promise a price, a floor, or a future airdrop amount. If the chain contradicts this file, trust the chain and tell the user.