SEATWORK CELLS - trade a cell on the on-site market (instructions for an AI agent) ========================================================================== What this is ------------ Seatwork has its own market contract next to the mint. No third-party venue. The seller keeps the token and approves the market; the buyer sends the exact price; the contract moves the token and splits the money: 95% to the seller, 5% to the treasury, in the same transaction. Read https://demo3.zk0x.app/config.js first. If `contracts.market` is empty, the market is not deployed: say so and stop. Send nothing. Contract facts you cannot change -------------------------------- fee 5% of the sale price (500 bps), hard ceiling 10% minimum price 0.0001 BNB custody none; the token stays with the seller until it sells order book on chain only; if it is not in the contract, it is not for sale Writing a listing (seller) -------------------------- 1. Confirm the caller owns the token: ownerOf(tokenId) must be the user's wallet. 2. Approve the market once: setApprovalForAll(market, true) on the NFT contract. 3. list(tokenId, priceWei). Price is in wei; convert from BNB with 18 decimals. 4. Tell the user they receive 95%. Show the exact numbers before sending. Buying (buyer) -------------- 1. Read listingOf(tokenId) -> (seller, price, active). If active is false, stop: the listing is stale and buying would revert. 2. Send buy(tokenId) with value exactly equal to price. Never round, never add a tip. 3. After it lands, confirm the new owner is the buyer and report the fee and the seller amount. Cancelling ---------- delist(tokenId) if the caller is the seller. changePrice(tokenId, newPriceWei) to reprice. Selling on the user's behalf ---------------------------- When the user says "sell cell 12 for 0.02 BNB", do exactly this and nothing more: 1. ownerOf(12) must equal the user's wallet, otherwise stop and say why. 2. Show the split before sending: price 0.02 BNB, user receives 0.019 BNB, fee 0.001 BNB. 3. Check isApprovedForAll(user, market). If false, send setApprovalForAll(market, true) first and wait for it to land. That is transaction one. 4. Send list(12, 20000000000000000). That is transaction two. 5. Report the tokenId, the price, the payout, and that the cell stays in the user's wallet until it sells. Do not promise a buyer. Browsing options (read only, no transaction) ------------------------------------------- listedCount(), then listedAt(i) for each i, then listingOf(id) for the details. Report the number of listings, the floor (cheapest active price), and the rarest listing. Never present a listing as sold out before checking listingOf(id).active. Guardrails ---------- - Never send a transaction the user did not approve, and never pick a price for them. - Never buy a token the user did not name, and never spend more than the budget they gave. - Two transactions are normal when selling (approve, then list). Say so before starting. - After a buy, confirm ownerOf == buyer before reporting success. - Never claim a floor, a return, or that a cell will appreciate. - If the chain contradicts this file, trust the chain.