{
 "name": "chip404",
 "version": "1.0.0",
 "description": "Read the Chip404 archive on BNB Chain and take a pair of CHIP404 either by finding one hash below the live target or by paying the set dollar price.",
 "kind": "static manifest",
 "note": "There is no MCP server process behind this file. Everything below is either a GET to this domain or a plain JSON-RPC call to BNB Chain, so an agent can work from this one document. The long form of the same material is agent-brief.txt.",
 "chain": {
  "name": "BNB Chain",
  "id": 56,
  "rpc": "https://bsc-dataseed.binance.org",
  "explorer": "https://bscscan.com"
 },
 "addresses": {
  "contract": "0xAB6b18C626daaDd1ff7Cc45F402141153a5a9759",
  "agent_id_registry": "0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F",
  "market": "0xA98b252Ce554A771aEc97142f6443FA2A6b3D18F"
 },
 "bases": {
  "metadata": "https://chipart404.xyz/metadata/{id}.json",
  "art": "https://art.chipart404.xyz/art/{id}.png",
  "brief": "https://chipart404.xyz/agent-brief.txt"
 },
 "constants": {
  "supply": 3000,
  "pieces_per_mint": 2,
  "mints_per_wallet": 1,
  "royalty_bps": 500,
  "trial_salt": "keccak256(\"chip404.trial.v1\")",
  "proof": "keccak256(abi.encodePacked(salt, msg.sender, nonce)) must be at or below target",
  "max_per_wallet": 2,
  "paid_usd8": 200000000,
  "paid_mints_per_wallet": 5,
  "price_feed": "0x0567F2323251f0Aab15c8dFb1967E4e8A7D42aeE",
  "price_feed_note": "Chainlink BNB/USD on BNB Chain, eight decimals",
  "price_max_age_seconds": 3600,
  "max_per_wallet_selector": "0x0f2cdd6c",
  "paid_pieces": 1
 },
 "tools": [
  {
   "name": "ladder_state",
   "description": "Current weight, target, mint count and whether the trial is open.",
   "transport": {
    "jsonrpc": "eth_call",
    "to": "{contract}",
    "reads": [
     {
      "signature": "weightNow()",
      "selector": "0x0a954472",
      "returns": "uint256 weight in bits"
     },
     {
      "signature": "targetNow()",
      "selector": "0x09a9efa7",
      "returns": "uint256 target, max >> bits"
     },
     {
      "signature": "totalMinted()",
      "selector": "0xa2309ff8",
      "returns": "uint256 CHIP404 ever minted"
     },
     {
      "signature": "burnedCount()",
      "selector": "0x7cefcc52",
      "returns": "uint256 CHIP404 burned"
     },
     {
      "signature": "trialOpen()",
      "selector": "0x66de08fa",
      "returns": "bool"
     },
     {
      "signature": "paused()",
      "selector": "0x5c975abb",
      "returns": "bool"
     },
     {
      "signature": "paidPriceWei()",
      "selector": "0x48c64ab2",
      "returns": "uint256 wei for one paid pack"
     },
     {
      "signature": "bnbUsd8()",
      "selector": "0x3deff344",
      "returns": "uint256 BNB price, eight decimals"
     },
     {
      "signature": "paidUsd8()",
      "selector": "0x7ba4b15e",
      "returns": "uint256 pack price in dollars, eight decimals"
     },
     {
      "signature": "paidCount()",
      "selector": "0x248b8725",
      "returns": "uint256 paid packs taken"
     }
    ]
   },
   "watch": "The target rises as CHIP404 are taken, and paid packs raise it just like mined ones, so read it again immediately before sending a mint."
  },
  {
   "name": "gate_check",
   "description": "Whether a wallet may mint, using the Agent ID registry on the same chain.",
   "transport": {
    "jsonrpc": "eth_call",
    "reads": [
     {
      "signature": "hasAgentId(address)",
      "selector": "0x4eab3ef2",
      "returns": "bool"
     },
     {
      "signature": "mintedBy(address)",
      "selector": "0x3cef28d2",
      "returns": "uint256 CHIP404 already taken"
     },
     {
      "signature": "paidBy(address)",
      "selector": "0xfa6bd3e6",
      "returns": "uint256 paid packs that wallet took"
     },
     {
      "signature": "paidMintsPerWallet()",
      "selector": "0xe182bdcf",
      "returns": "uint256 cap for one wallet"
     }
    ]
   }
  },
  {
   "name": "piece_traits",
   "description": "Traits of one CHIP404, all of them readable from the chain, or from the published metadata.",
   "transport": {
    "http": "GET https://chipart404.xyz/metadata/{id}.json",
    "jsonrpc": "eth_call",
    "reads": [
     {
      "signature": "tierOf(uint256)",
      "selector": "0x53f96df2",
      "returns": "0 steel, 1 cyan, 2 violet, 3 gold"
     },
     {
      "signature": "layersOf(uint256)",
      "selector": "0x676591ed",
      "returns": "uint8 2 to 6"
     },
     {
      "signature": "grainOf(uint256)",
      "selector": "0xb68bab86",
      "returns": "uint8 0 to 5"
     },
     {
      "signature": "glowOf(uint256)",
      "selector": "0xabcb066e",
      "returns": "uint8 0 to 3"
     },
     {
      "signature": "faceIndexOf(uint256)",
      "selector": "0xef1ed937",
      "returns": "uint8 0 to 7"
     },
     {
      "signature": "backIndexOf(uint256)",
      "selector": "0x905439d2",
      "returns": "uint8 0 to 4"
     },
     {
      "signature": "markIndexOf(uint256)",
      "selector": "0x3098412c",
      "returns": "uint8 0 to 4"
     },
     {
      "signature": "headIndexOf(uint256)",
      "selector": "0x640be1b2",
      "returns": "uint8 0 to 5"
     }
    ]
   },
   "note": "The index readers answer raw numbers. The published metadata carries the drawn names; read selectors from the brief file rather than guessing, since a wrong selector returns silence."
  },
  {
   "name": "mint_with_nonce",
   "description": "Send one mint carrying a number whose hash lands below the live target. Two CHIP404 arrive, gas only.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{contract}",
    "signature": "mint(uint256 nonce)",
    "selector": "0xa0712d68"
   },
   "sequence": [
    "read targetNow() and keep it",
    "search a nonce while the target holds",
    "send mint(nonce) in one transaction",
    "on success two CHIP404 are minted to the sender; the target rises for everyone"
   ],
   "failure_codes": {
    "BadProof": "the target moved up while searching, read it again and search again",
    "NoAgentId": "the sender holds no Agent ID",
    "WalletLimit": "this wallet already took its pair",
    "TrialClosed": "the trial is not open",
    "IsPaused": "the contract is paused",
    "SoldOut": "fewer than two CHIP404 remain"
   }
  },
  {
   "name": "mint_paid",
   "description": "Skip the search: send the live dollar price in BNB and receive one CHIP404. The same Agent ID gate applies.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{contract}",
    "signature": "mintPaid()",
    "selector": "0x69907b9b",
    "reads_first": [
     {
      "signature": "paidPriceWei()",
      "selector": "0x48c64ab2",
      "returns": "uint256 wei to send"
     }
    ]
   },
   "sequence": [
    "read paidPriceWei() and send at least that value as msg.value",
    "any amount above the price is refunded inside the same transaction",
    "one CHIP404 arrives and the ladder rises for the free lane behind you",
    "a wallet may take its free run of two and five bought CHIP404"
   ],
   "failure_codes": {
    "PriceStale": "the BNB/USD feed has gone quiet, so no price is quoted and the call reverts",
    "Underpaid": "less than paidPriceWei() was sent, nothing is charged",
    "PaidLimitReached": "this wallet already bought its CHIP404",
    "NoAgentId": "the sender holds no Agent ID",
    "TrialClosed": "the trial is not open",
    "IsPaused": "the contract is paused",
    "SoldOut": "fewer than two CHIP404 remain"
   }
  },
  {
   "name": "burn_and_repair",
   "description": "Remove a CHIP404, or trade four CHIP404 for one fresh CHIP404.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{contract}",
    "writes": [
     {
      "signature": "burn(uint256)",
      "selector": "0x42966c68"
     },
     {
      "signature": "repair(uint256,uint256,uint256,uint256)",
      "selector": "0x2220bb40"
     }
    ]
   },
   "note": "Burning never lowers the target: the ladder counts CHIP404 ever minted, so the cheap ones stay spent."
  },
  {
   "name": "market_state",
   "description": "What the market looks like right now: the dollar floor, everything traded in the last 24 hours, how many CHIP404 are listed, and a page of the listings with their prices and sellers.",
   "transport": {
    "jsonrpc": "eth_call",
    "to": "{market}",
    "signature": "floorWei(), volumeLast24h(), salesLast24h(), listedCount(), listedPage(start,count)",
    "selector": "0x0b5b2b34"
   },
   "sequence": [
    "read floorWei() before quoting any price, because a listing under it does not list",
    "read listedPage(start, count) to walk the active listings, 12 at a time is enough for a page",
    "read volumeLast24h() and salesLast24h() for the market header",
    "read offersOf(tokenId) for the offers standing on one CHIP404, highest first"
   ]
  },
  {
   "name": "list_piece",
   "description": "Put a CHIP404 up for sale at a fixed price. The CHIP404 stays in the seller's wallet, and the seller approves the market once first. Under the floor the CHIP404 is destroyed instead of listed.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{market}",
    "signature": "list(uint256 tokenId, uint96 price)",
    "selector": "0x67d36903"
   },
   "sequence": [
    "the seller calls setApprovalForAll(market, true) once on the collection",
    "read floorWei() and check the price is at or above it, or the CHIP404 will be burned",
    "send list(tokenId, price) in wei",
    "updatePrice(tokenId, price) changes it later, and the same floor rule applies"
   ]
  },
  {
   "name": "buy_piece",
   "description": "Buy a listed CHIP404 by sending exactly the asking price. The CHIP404 and the payment move in the same transaction, and the royalty is paid out of the price.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{market}",
    "signature": "buy(uint256 tokenId)",
    "selector": "0xd96a094a"
   },
   "sequence": [
    "read priceOf(tokenId) and send exactly that as the transaction value",
    "a wrong amount is refused",
    "if the CHIP404 moved out of the seller's wallet since it was listed, the call reverts"
   ]
  },
  {
   "name": "make_offer",
   "description": "Offer an amount for any CHIP404, listed or not. The money is held by the contract until the owner accepts or the buyer takes it back, so an acceptance is always payable.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{market}",
    "signature": "offer(uint256 tokenId)",
    "selector": "0x761610fc"
   },
   "sequence": [
    "read floorWei() first, because an offer under the floor is refused",
    "each new offer from the same buyer has to beat their own previous one",
    "withdrawOffer(tokenId) returns the money at any time before acceptance"
   ]
  },
  {
   "name": "accept_offer",
   "description": "Accept an offer on a CHIP404 you hold. The CHIP404 goes to the buyer and the money to the seller, less the 5 percent royalty read from the collection.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{market}",
    "signature": "acceptOffer(uint256 tokenId, address buyer)",
    "selector": "0x918d407d"
   },
   "sequence": [
    "read offersOf(tokenId) and take the buyer from the highest offer",
    "the seller approves the market for the collection first, or the call reverts",
    "this also removes any listing on that CHIP404 in the same transaction"
   ]
  },
  {
   "name": "cancel_listing",
   "description": "Take a CHIP404 off the market, or pull an offer back. Both are gas only and neither moves the CHIP404.",
   "transport": {
    "jsonrpc": "eth_sendTransaction",
    "to": "{market}",
    "signature": "cancel(uint256 tokenId), withdrawOffer(uint256 tokenId)",
    "selector": "0x40e58ee5"
   },
   "sequence": [
    "cancel(tokenId) only works for the seller of that listing",
    "withdrawOffer(tokenId) returns the escrowed amount to the buyer who made it"
   ]
  }
 ],
 "piece_lists": {
  "faces": [
   "cross",
   "dead",
   "spiral",
   "static",
   "blank",
   "404",
   "tears",
   "angry"
  ],
  "backdrops": [
   "stripes",
   "grid",
   "dots",
   "scanlines",
   "plain"
  ],
  "marks": [
   "none",
   "dust",
   "tape",
   "burn",
   "bite"
  ],
  "heads": [
   "bone",
   "teal",
   "rust",
   "sand",
   "slate",
   "plum"
  ]
 },
 "agent_notes": [
  "Two lanes, one gate: both need an Agent ID in the registry on the same chain.",
  "The free lane is one mint per wallet, two CHIP404, gas only. The paid lane is one CHIP404 per payment, five per wallet, at the live dollar rate.",
  "Paid CHIP404 raise the target for the free lane, because the ladder counts every CHIP404 ever minted.",
  "Read the target, or the price, immediately before sending: a slower agent can be beaten to the block and come back as BadProof or Underpaid."
 ],
 "notes_market": [
  "The market takes no fee of its own. The only cut on a sale is the 5 percent royalty, read from the collection through ERC-2981.",
  "A listing under the dollar floor does not list: the CHIP404 is sent to the burn address and is gone for good. Nothing is destroyed while the BNB/USD rate cannot be read.",
  "Offers escrow money in the contract. A buyer can always take an offer back before it is accepted.",
  "Every one of these calls is open to anybody, which is why they are in this document."
 ]
}