PERMANENT COLLECTIONProtocol Reference

How to read these docs

Every contract page follows the same structure, generated from the deployed contract's ABI and merged with hand-written behavior notes. Because the mechanical parts are derived rather than written, a signature in these docs is the signature on chain.

Contract pages

Each page opens with the mainnet address (linked to evm.now, a multi-chain explorer) and the deploy block, then:

  • Concepts — the mental model for the contract, when it needs one
  • Write functions — every state-changing function, main entry points first. Each shows the Solidity signature, an Access line, behavior prose, and revert conditions
  • Read functions — every view function, alphabetical
  • Events — every event with its indexed fields and when it fires
  • Errors — every custom error and the condition that raises it

Access lines

Every write function declares who can call it:

  • permissionless — anyone. Several of these pay the caller a small reward; see Run a keeper
  • <contract>-only — callable only by another protocol contract (for example patron-only, module-only, hook-only)
  • admin-gated — gated by ProtocolAdmin, which auto-locks 1 year after deploy. Four scoped carve-outs survive the lock; each is labeled where it appears
  • deployer one-shot — a setup function that was called once during the deploy broadcast and is permanently closed

The full function-by-function table is at Access control.

Examples

Read examples use cast (Foundry) against a free public RPC:

bash
cast call 0x… "bidBalance()(uint256)" --rpc-url https://ethereum-rpc.publicnode.com

Write examples use viem. ABIs for every contract are served at /abis/<ContractName>.json and live in the repo at app/lib/abis/.

Units and terms

  • Amounts are wei unless stated otherwise; bps means basis points on the denominator stated at the use site (most contracts use 10,000; the hook's volume caps use 100,000)
  • Punk ids are uint16 (0..9999); trait ids are uint8 (0..110)
  • The ERC20 is written $111 in prose. Its on-chain symbol is 111
  • CryptoPunks themselves are not ERC721 tokens. They live in the 2017 CryptoPunksMarket contract and move via transferPunk, buyPunk, and offerPunkForSaleToAddress; sale proceeds queue in pendingWithdrawals and are collected with withdraw()

Machine-readable surfaces

Surface Path
Protocol manifest (addresses + ABIs + docs links) /protocol-manifest.json
Per-contract ABI /abis/<ContractName>.json
LLM orientation /llms.txt
Search corpus for this reference /docs-search-index.json

The markdown source of every page is in the public repo under docs/reference/, regenerated by scripts/generate-docs.ts.

How to read these docs · Permanent Collection