[{"path":"/docs/introduction/overview","page":"Overview","heading":"Overview","anchor":"","text":"This is the API reference for the onchain protocols PND ships for artists. Each protocol is a self-contained set of contracts with its own section below: an overview, the concepts behind it, a per-contract reference, task-oriented guides, and cross-cutting indexes of its functions, events, and error"},{"path":"/docs/introduction/overview","page":"Overview","heading":"The protocols","anchor":"the-protocols","text":"- Surface: artist-owned ERC721 collections. The current V2 system separates a sequential token, fixed-price sale, gate, clone factories, and launcher. The token has one minter and stores its seed at mint; owners renounce ownership for permanence. V1 also supports pooled collections and uses differen"},{"path":"/docs/introduction/overview","page":"Overview","heading":"Status","anchor":"status","text":"Surface V1, the current Surface V2 primitives, Auctions, and Catalog have Ethereum mainnet deployments recorded. See Addresses and the protocol manifest. V2 deployed on October 30, 2026; its record was committed on November 12. The September V2 testnet implementation was superseded. V1 collections r"},{"path":"/docs/introduction/addresses","page":"Addresses","heading":"Addresses","anchor":"","text":"The shared singletons of each PND onchain protocol on Ethereum mainnet (chain id 1). Per-owner clones (an artist collection, an auction house) are deployed through a factory and have no entry here; look their address up on-chain."},{"path":"/docs/introduction/addresses","page":"Addresses","heading":"Surface","anchor":"surface","text":"Contract Address Docs --- --- --- SurfaceFactory 0xdB81d3F33EF3D84685486916E0d372E247558094 reference AllowlistGate 0xb3b0aBfeb588ab905f984a20e05784be8a35eF4f reference surfaceFactoryV2 0xA104803fc2151BE0BFF18da7bb31938a5fdEd83c reference saleFactoryV2 0xc474809F9cDB51A01d757aA90fbfC245Ca8A5B66 refe"},{"path":"/docs/introduction/addresses","page":"Addresses","heading":"Auctions","anchor":"auctions","text":"Contract Address Docs --- --- --- SovereignAuctionHouseFactory 0xaE712abcA452901A74D1FBC0c3919F2cc060EF9f reference SovereignAuctionHouseV2Factory 0x77aB853543286C9Cdd7dd6c01222A7cC4Ac93d63 reference"},{"path":"/docs/introduction/addresses","page":"Addresses","heading":"Catalog","anchor":"catalog","text":"Contract Address Docs --- --- --- Catalog 0x467a9c39e03C595EC3075D856f19C7386b6b915d reference A machine-readable version of these tables (addresses + ABI + docs links) is served at /protocol-manifest.json."},{"path":"/docs/introduction/conventions","page":"Conventions","heading":"Conventions","anchor":"","text":""},{"path":"/docs/introduction/conventions","page":"Conventions","heading":"Addresses and transaction links","anchor":"addresses-and-transaction-links","text":"Every address and transaction link in this reference points at evm.now, a multi-chain explorer: - Address: https://evm.now/address/<address ?chainId=1 - Transaction: https://evm.now/tx/<hash ?chainId=1 A shared-singleton address is written as a {{addr:<key }} placeholder in the source and substitute"},{"path":"/docs/introduction/conventions","page":"Conventions","heading":"Currency and units","anchor":"currency-and-units","text":"Amounts read from the contracts are wei unless stated otherwise. bps means basis points out of 10,000; the referral share (referralShareBps) starts at its cap, MAX REFERRAL SHARE BPS = 1000 (10%)."},{"path":"/docs/introduction/conventions","page":"Conventions","heading":"Examples","anchor":"examples","text":"Read examples use cast (Foundry) against a free public RPC. A singleton uses the {{addr:...}} form; a per-owner clone uses a placeholder address: Write examples use viem. ABIs come from the @pin/abi package or from /abis/<ContractName .json: or, fetching the ABI directly:"},{"path":"/docs/introduction/conventions","page":"Conventions","heading":"Glossary","anchor":"glossary","text":"Term Meaning --- --- Collection One artist's work, deployed as one Surface contract Clone A collection's contract: an immutable EIP-1167 proxy pointing at the shared implementation Slot A swappable module: the renderer slot on the token, and the price-strategy slot inside the canonical minter Minter"},{"path":"/docs/surface/overview","page":"Overview","heading":"Overview","anchor":"","text":"Surface is PND's artist-owned ERC721 collection protocol. Each collection is an immutable EIP-1167 clone with its own storage and owner. The current V2 system separates the token, sale, gate, and deployment plumbing into small contracts. The launcher wires a collection and sale in one transaction. V"},{"path":"/docs/surface/overview","page":"Overview","heading":"Choose the right version","anchor":"choose-the-right-version","text":"Behavior V1 Current V2 --- --- --- Token reference Surface Surface (V2) Deployment SurfaceFactory Token and sale CloneFactory, normally composed by Launcher Canonical sale FixedPriceMinter FixedPriceSale Ids Sequential or pooled Sequential only; burned ids are never reused Mint authority Authorized "},{"path":"/docs/surface/overview","page":"Overview","heading":"The current primitives","anchor":"the-current-primitives","text":"- Surface holds ERC721 ownership, stored seeds, renderer, minter, supply cap, name/symbol, and EIP-2981 royalty. It has no sale logic or admin role - FixedPriceSale holds price, mint window, caps, gate, payout, and pull-payment balances. Its configuration authority comes from the collection's owner "},{"path":"/docs/surface/overview","page":"Overview","heading":"Deployment status","anchor":"deployment-status","text":"These are repository deployment records, not a fresh check of the factories' current state. Both V2 factories landed paused. Read each factory's live paused() and deprecated() before preparing a launch. These gates affect new clones, not existing collections or sales. Current V2 contract Ethereum ma"},{"path":"/docs/surface/overview","page":"Overview","heading":"Permanence and live artwork","anchor":"permanence-and-live-artwork","text":"V2 owners may change the renderer, minter, supply cap, royalty, name, and symbol. Renouncing ownership removes that authority, including the authority borrowed by the canonical sale and gate. Do it only after choosing the final configuration: there are no independent locks or recovery admin. Renounc"},{"path":"/docs/surface/overview","page":"Overview","heading":"Payments and referrals","anchor":"payments-and-referrals","text":"The V2 sale requires exactly price quantity. mint(quantity) uses its stored default referrer; mintWithReferral(to, quantity, referrer, data) allows an explicit referrer and gate data. The referral is a constant 5%. A zero referrer, the collection itself, or the sale itself receives no referral alloc"},{"path":"/docs/surface/concepts/four-slots","page":"Slots and modules","heading":"Slots and modules","anchor":"","text":"This page describes the v1 module model. V1 has a renderer slot, an address-based minter set, and an optional price strategy in its canonical minter. Current Surface v2 instead has exactly one minter() address, set by the owner with setMinter(address), and an owner-set renderer. Its FixedPriceSale h"},{"path":"/docs/surface/concepts/four-slots","page":"Slots and modules","heading":"Renderer (`IRenderer`)","anchor":"renderer-irenderer","text":"- Type : IRenderer, stored in the collection's SurfaceConfig.renderer - Set by : setRenderer(address), owner or admin, only while the renderer is not locked (lockRenderer pins it permanently, optional and off by default) - Fallback : the slot always holds a nonzero address. When the artist sets none"},{"path":"/docs/surface/concepts/four-slots","page":"Slots and modules","heading":"Minter","anchor":"minter","text":"- Type : an address the owner authorizes, tracked in mapping(address = bool). The token trusts a minter for one thing: permission to call its non-payable mint entrypoint. The value-facing shape a minter presents to frontends is IMinter, but the token does not enforce that interface - Set by : setMin"},{"path":"/docs/surface/concepts/four-slots","page":"Slots and modules","heading":"Price strategy (`IPriceStrategy`)","anchor":"price-strategy-ipricestrategy","text":"- Type : IPriceStrategy, stored on the canonical minter as priceStrategy, not on the token - Set by : setPriceStrategy(address) on the minter, owner or admin (the collection's, borrowed by the minter), no freeze gate - Fallback : when unset, the minter charges its stored price times quantity and req"},{"path":"/docs/surface/concepts/id-modes","page":"Id modes","heading":"Id modes","anchor":"","text":"V1 supports the sequential and pooled forms below. V2 is sequential only : ids equal mint order and mintTo(to, quantity) assigns them. It exposes neither idMode() nor mintToId; minters cannot choose ids or supply seeds. See Surface v2 and the Surface v2 token reference. Every v1 collection is one of"},{"path":"/docs/surface/concepts/id-modes","page":"Id modes","heading":"Sequential","anchor":"sequential","text":"The core assigns every id itself, counting up from 1. - The token exposes one mint entrypoint, mintTo(to, quantity), callable only by an authorized minter. It draws the next id from the core's counter; the minter can never choose one. One call mints quantity consecutive ids and emits one Minted even"},{"path":"/docs/surface/concepts/id-modes","page":"Id modes","heading":"Pooled","anchor":"pooled","text":"An authorized minter supplies every id explicitly. - The token exposes one mint entrypoint, mintToId(to, tokenId), callable only by the authorized minter. tokenId is caller-supplied (the pool's own id scheme; tokenId == sourceId is the typical form, and 0 is a legal id) - burn(tokenId) is restricted"},{"path":"/docs/surface/concepts/id-modes","page":"Id modes","heading":"Comparison","anchor":"comparison","text":"Sequential Pooled --- --- --- Who assigns ids The core (mint order) The minter (mintToId) Mint entrypoint mintTo(to, quantity) mintToId(to, tokenId) Burn authority Owner or approved Authorized minter only Burned id Never reused May be re-minted as a new instance Supply cap bounds Mints ever Live sup"},{"path":"/docs/surface/concepts/id-modes","page":"Id modes","heading":"The redeem cycle","anchor":"the-redeem-cycle","text":"Pooled mode exists for works whose ids are drawn from and returned to a pool over the work's lifetime, rather than minted once and kept: an id is drawn and minted (mintToId), a holder later redeems it (the minter burns it, typically after releasing whatever it backed), and the same id becomes eligib"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"Seed and provenance","anchor":"","text":"Both versions store a mint-time seed on the collection. Read tokenSeed(tokenId) rather than reconstructing it: the formulas differ, and v1 pooled ids can be minted again after burning."},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"V2 seed resolution","anchor":"v2-seed-resolution","text":"The current Surface v2 token assigns sequential ids and stores: There is no external seed source or seeded-mint entrypoint. tokenSeed rejects id 0 and ids above mints-ever, and stays readable after burning. Transfers and burns do not change the seed. Minted(minter, to, firstTokenId, quantity) record"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"V1 stored seed","anchor":"v1-stored-seed","text":"A v1 token stores one additional per-token fact beyond ERC721 ownership: its seed , a bytes32 written once at mint. Everything else about a token's provenance, its mint order and first/final standing, is either derivable from the id and the live config or recorded permanently in the Minted event. Th"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"Provenance (derived)","anchor":"provenance-derived","text":"In Sequential mode the token id IS the mint order: ids are assigned 1, 2, 3... and never reused after burn, so: Fact Derivation --- --- Mint order tokenId (1-based) First mint tokenId == 1 Final mint the cap is set and full and this is the last id: cap != 0 && minted == cap && tokenId == cap A custo"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"The seed (`tokenSeed`)","anchor":"the-seed-tokenseed","text":"tokenSeed(uint256 tokenId) returns a bytes32, computed once at mint time as: - The only per-token storage : the seed is the one fact that can never be reconstructed later, since randomness only exists at mint time. Everything else about a mint is derivable or event-recorded, so nothing else is store"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"Bring-your-own mint-time data","anchor":"bring-your-own-mint-time-data","text":"A work that needs mint-time facts the core does not store, the mint block for time-based mechanics, pooled mint order, a timestamp, records them through its own minter, which receives the mint call and can write to its own storage or a companion, then reads them back in its renderer. Only works that"},{"path":"/docs/surface/concepts/mint-marks-and-entropy","page":"Seed and provenance","heading":"What reads these","anchor":"what-reads-these","text":"- Renderers read tokenSeed as the entropy input to the algorithm, and derive order/first/final from the id against the version-specific config() result when they want provenance attributes - Indexers read the Minted event, which carries the issuing minter, the recipient and id range without per-toke"},{"path":"/docs/surface/concepts/types","page":"Types","heading":"Types","anchor":"","text":"This page documents v1 types. The current v2 primitives do not use SurfaceConfig, InitParams, or IdMode. V2 config() returns six flat values: renderer, minter, supply cap, royalty rate, royalty receiver, and mints-ever. It is not ABI-compatible with the v1 struct return. The v2 owner sets these prop"},{"path":"/docs/surface/concepts/types","page":"Types","heading":"Enums","anchor":"enums","text":""},{"path":"/docs/surface/concepts/types","page":"Types","heading":"`IdMode`","anchor":"idmode","text":"Token id assignment model, fixed at initialize and never changed after. It is not a config field; each form is a separate contract, and idMode() reports which. Value Meaning --- --- Sequential The core assigns ids 1, 2, 3... in mint order; a minter mints through mintTo but never chooses ids; ids are"},{"path":"/docs/surface/concepts/types","page":"Types","heading":"Structs","anchor":"structs","text":""},{"path":"/docs/surface/concepts/types","page":"Types","heading":"`SurfaceConfig`","anchor":"surfaceconfig","text":"The live token configuration. Set at initialize and, except the two lock flags once set, updatable afterward through the setters (setRenderer, setRoyalty, setSupplyCap), so the struct config() returns is always the single current truth. There is no price, mint window, payout, or referral field here:"},{"path":"/docs/surface/concepts/types","page":"Types","heading":"`InitParams`","anchor":"initparams","text":"Everything initialize() needs, bundled into one struct so the call stays within legacy-codegen stack limits and can grow without signature churn. Field Type Meaning --- --- --- name string ERC721 name symbol string ERC721 symbol owner address The collection's owner (the artist); required, cannot be "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Surface","anchor":"","text":"Implementation 0xd0cC38cB3BD18FbdAD278f14AD1f40E513f846Ef · view on evm.now · Ethereum mainnet Deployed per artist as an EIP-1167 clone of the implementation above through the factory. A collection has no canonical address of its own; substitute your collection address for <COLLECTION ADDRESS in the"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Token and minter","anchor":"token-and-minter","text":"The token authorizes a minter for one operation: calling mintTo. It does not constrain minter internals. The token-side invariants hold for every minter: the supply cap bounds all mints, ids are assigned sequentially, and each mint emits Minted with the calling minter. Payment, referral, and gating "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Primary minter","anchor":"primary-minter","text":"primaryMinter names one granted minter as the frontend-discovery default, so a generic client can go from a collection address to its intended mint module without enumerating every grant. It is metadata, not a payment router: minting still calls the named minter directly, and every other granted min"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Owner and admins","anchor":"owner-and-admins","text":"The owner may grant admin keys with addAdmin. An admin can call every management function the owner can except managing the admin set, transferring ownership, and changing the minter set on a pooled collection. A grant records the granting owner and is valid only while that account is the current ow"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Creator attribution","anchor":"creator-attribution","text":"Attribution is a two-sided onchain check with no shared registry write. The owner lists creators with setCreators, an assertion. A listed creator confirms by claiming the collection in the Catalog from their own address. isConfirmedCreator(who) is the intersection: listed and claimed. Either side ca"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Id modes","anchor":"id-modes","text":"The id mode is fixed per contract form; idMode() reports it. See id modes. - Sequential (Surface): ids are assigned 1, 2, 3... in mint order and not reused after a burn, so the id equals the mint order. The supply cap bounds mints ever. mintTo is batch-native: one call mints a contiguous id range an"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Seed","anchor":"seed","text":"Each mint writes one bytes32, read with tokenSeed: keccak256(prevrandao, collection, tokenId, mintIndex), per docs/injection-convention.md. It is the only per-token storage; a nonzero seed is also the was-minted sentinel. The recipient is not in the formula, so the seed does not depend on the minter"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Locks","anchor":"locks","text":"lockRenderer (optional) pins the renderer pointer. The token does not verify a renderer's internals, so a locked pointer at an immutable renderer fixes presentation, while a locked pointer at a mutable renderer leaves that renderer's output changeable. lockSupply freezes the supply cap, which bounds"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Live reads","anchor":"live-reads","text":"`bash"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Live supply (minted minus burned)","anchor":"","text":"cast call <COLLECTION ADDRESS \"totalSupply()(uint256)\" \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"The active renderer","anchor":"","text":"cast call <COLLECTION ADDRESS \"renderer()(address)\" \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Whether an address may mint","anchor":"","text":"cast call <COLLECTION ADDRESS \"isMinter(address)(bool)\" <MINTER ADDRESS \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"The frontend-discovery default minter","anchor":"","text":"cast call <COLLECTION ADDRESS \"primaryMinter()(address)\" \\ --rpc-url https://ethereum-rpc.publicnode.com A collection is a per-artist clone with no canonical address, so the examples use a <COLLECTION ADDRESS placeholder. Collection addresses come from the factory's SurfaceCreated` events."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"mintTo","anchor":"mintto","text":"Access: minter-only (msg.sender must be an authorized minter, else NotMinter) The sequential form's mint entrypoint. Non-payable: the calling minter handles payment before calling. Mints quantity tokens to to with ids firstTokenId .. firstTokenId + quantity - 1, where firstTokenId is one past the mi"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"burn","anchor":"burn","text":"Access: owner-or-approved on the sequential form, minter-only on the pooled form (else NotAuthorized) Burns a token and decrements live supply. On the sequential form the holder or an approved address may burn; on the pooled form only an authorized minter may burn, so a holder cannot burn a pooled t"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setRenderer","anchor":"setrenderer","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Sets the renderer pointer. Reverts RendererIsLocked after lockRenderer, RendererRequired for the zero address, and RendererNotContract for an address with no code. Emits RendererSet, an ERC-4906 BatchMetadataUpdate over all tokens, and an"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setRoyalty","anchor":"setroyalty","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Sets the EIP-2981 royalty read by royaltyInfo. Capped at 50% (RoyaltyTooHigh above 5000 bps); a zero receiver resolves to owner() at read time. Emits RoyaltySet."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setSupplyCap","anchor":"setsupplycap","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Sets the supply cap; 0 means open supply. Reverts SupplyIsLocked after lockSupply, and BadSupplyCap for a nonzero cap below current usage (mints ever on the sequential form, live supply on the pooled form). The cap determines which token "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setCreators","anchor":"setcreators","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Lists (listed = true) or unlists creators, the owner's side of attribution. A listing is an assertion; a creator is confirmed once they also claim the collection in the Catalog. Emits CreatorListed per address."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setMinter","anchor":"setminter","text":"Access: owner-only on the pooled form; owner or admin on the sequential form (else NotAuthorized) Grants (allowed = true) or revokes an authorized minter. Reverts ZeroMinter for the zero address and MinterIsLocked after lockMinter; a call that does not change the state is a no-op. The pooled form ho"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setPrimaryMinter","anchor":"setprimaryminter","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Sequential-only: repoints the frontend-discovery default at minter, or clears it with the zero address. Reverts OnlySequential on the pooled form, whose primary tracks its sole granted minter automatically instead; MinterIsLocked once loc"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"lockRenderer","anchor":"lockrenderer","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) One-way: pins the renderer pointer, so tokenURI/contractURI are answered by the current renderer from then on. The token does not verify a renderer's internals: a locked pointer at an immutable renderer fixes presentation, while a locked "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"lockSupply","anchor":"locksupply","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) One-way: freezes the supply cap. The cap bounds every mint path, so no later minter grant can exceed it. Reverts SupplyIsLocked if already locked. Emits SupplyLocked."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"lockMinter","anchor":"lockminter","text":"Access: owner-only on the pooled form; owner or admin on the sequential form (else NotAuthorized) One-way: freezes the minter set, so no minter is granted or revoked afterward. On a backed pooled collection this prevents granting a later minter that could burn tokens the current minter backs. Revert"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"addAdmin","anchor":"addadmin","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Grants an admin key. An admin can call every management function the owner can except managing the admin set, transferring ownership, and changing the minter set on a pooled collection. Reverts ZeroAccount for the zero address and Alrea"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"removeAdmin","anchor":"removeadmin","text":"Access: owner, or the admin itself (else NotAuthorized) Revokes an admin. The owner may remove any admin; an admin may remove itself by passing its own address. Reverts NotAnAdmin when the account holds no grant. Emits AdminSet."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"notifyMetadataUpdate","anchor":"notifymetadataupdate","text":"Access: the current renderer, or owner/admin (else NotAuthorized) Emits an ERC-4906 BatchMetadataUpdate for metadata changes the token cannot observe: an onchain-live work whose output changed with chain state, a reveal, new captures. The event is emitted on the token, so the renderer calls this rat"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"rescueStrayETH","anchor":"rescuestrayeth","text":"Access: owner or admin (onlyOwnerOrAdmin, else NotAuthorized) Sends to the contract's full ETH balance. The token has no payable function, so any balance was force-fed (selfdestruct or a pre-funded address) and nothing is owed. Reverts ZeroAccount for the zero address, NoStrayETH for a zero balance,"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization) Sets the clone up once: name, symbol, owner, the SurfaceConfig, the factory's default renderer (used when the config names none), initial minters, the Catalog address, and an initial creator listing. Reverts OwnerRequired for a zero"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"transferOwnership","anchor":"transferownership","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) OpenZeppelin Ownable2Step: records a pending owner who must call acceptOwnership. Existing admin grants stop being valid once the transfer completes. Emits OwnershipTransferStarted."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"acceptOwnership","anchor":"acceptownership","text":"Access: pending-owner-only (else OwnableUnauthorizedAccount) Ownable2Step: the pending owner completes the transfer and becomes owner. Admin grants made by the previous owner are no longer valid. Emits OwnershipTransferred."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"renounceOwnership","anchor":"renounceownership","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) OpenZeppelin Ownable: sets the owner to the zero address. Every owner and admin gate then reverts (an admin grant is valid only while its granting owner is the current owner), and the config is fixed at its current values. A royalty rec"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"approve","anchor":"approve","text":"Access: owner-or-operator-only (standard ERC721 approval authority, else an ERC721 revert) Standard ERC721 single-token approval. Emits Approval."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"setApprovalForAll","anchor":"setapprovalforall","text":"Access: permissionless (the caller sets its own operator approval) Standard ERC721 operator approval over all of the caller's tokens. Emits ApprovalForAll."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"transferFrom","anchor":"transferfrom","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 transfer. The mint entrypoints and burn are the non-standard surface; transfers follow EIP-721. Emits Transfer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"safeTransferFrom(address, address, uint256)","anchor":"safetransferfromaddress-address-uint256","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 safe transfer with no data. Checks a contract recipient implements onERC721Received (ERC721InvalidReceiver otherwise). Emits Transfer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"safeTransferFrom(address, address, uint256, bytes)","anchor":"safetransferfromaddress-address-uint256-bytes","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 safe transfer with a data payload forwarded to the recipient's onERC721Received. Emits Transfer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"balanceOf","anchor":"balanceof","text":"Standard ERC721: the number of tokens an address owns."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"catalog","anchor":"catalog","text":"The Catalog singleton this collection confirms creators against (zero when confirmation is disabled)."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"config","anchor":"config","text":"Returns the live SurfaceConfig and minted, the mints-ever count (not live supply). Setters edit the config fields in place, so this view always reports what the contract uses. Sale state (price, window, phase) is not here; read the collection's minter."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"contractURI","anchor":"contracturi","text":"Collection-level metadata, delegated to the renderer's contractURI."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"getApproved","anchor":"getapproved","text":"Standard ERC721: the single-token approved spender, or zero."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"idMode","anchor":"idmode","text":"The collection form: Sequential (0) or Pooled (1). Fixed by the contract. See id modes."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isAdmin","anchor":"isadmin","text":"True if the account may use the admin-gated setters: the owner, or an address holding a currently valid grant. The owner is included because every admin-gated function also admits the owner."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isApprovedForAll","anchor":"isapprovedforall","text":"Standard ERC721: whether an operator is approved over all of an owner's tokens."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isConfirmedCreator","anchor":"isconfirmedcreator","text":"True only if the owner has listed who and who has claimed this collection in the Catalog (isContractRegistered). Computed on read, so retracting either side revokes the confirmation. False when no Catalog is configured."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isListedCreator","anchor":"islistedcreator","text":"Whether the owner has listed who as a creator (the owner's assertion). See isConfirmedCreator."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isMinter","anchor":"isminter","text":"True if the address is an authorized minter allowed to call the mint entrypoint."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isMinterLocked","anchor":"isminterlocked","text":"True after lockMinter."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isRendererLocked","anchor":"isrendererlocked","text":"True after lockRenderer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"isSupplyLocked","anchor":"issupplylocked","text":"True after lockSupply."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"name","anchor":"name","text":"Standard ERC721 collection name, set at init."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"owner","anchor":"owner","text":"Standard OpenZeppelin Ownable owner: the address that controls the config, the minter set, and the admin set."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"ownerOf","anchor":"ownerof","text":"Standard ERC721: the owner of a token. Reverts ERC721NonexistentToken for an id that is not currently minted."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"pendingOwner","anchor":"pendingowner","text":"Standard Ownable2Step pending owner: the address offered ownership that must call acceptOwnership, or zero when no transfer is pending."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"primaryMinter","anchor":"primaryminter","text":"The frontend-discovery default: the minter a generic client should read and call first. Not proof that no other authorized minter exists; every granted minter in isMinter is equally callable. Zero when none is set. On the sequential form, set via setPrimaryMinter and cleared when the current primary"},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"renderer","anchor":"renderer","text":"The renderer address tokenURI and contractURI delegate to. Set at init (the config's value, or the factory default when the config names none) and settable via setRenderer until lockRenderer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"royaltyInfo","anchor":"royaltyinfo","text":"EIP-2981 royalty for a sale price: the receiver (the configured receiver, or owner() when unset) and the amount from royaltyBps. Advisory."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"supportsInterface","anchor":"supportsinterface","text":"Standard ERC165 check. True for ERC721, ERC165, EIP-2981 (0x2a55205a), and ERC-4906 (0x49064906)."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"symbol","anchor":"symbol","text":"Standard ERC721 collection symbol, set at init."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"tokenSeed","anchor":"tokenseed","text":"The seed for a token, written in the mint transaction: the only per-token storage. Reverts NeverMinted for an id that was never minted (a nonzero seed is the existence sentinel). Readable for a burned id until a pooled re-mint overwrites it with the new instance's seed."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"tokenURI","anchor":"tokenuri","text":"Standard ERC721 metadata entry point. Reverts ERC721NonexistentToken for a token that does not exist and delegates to the renderer's tokenURI."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"totalSupply","anchor":"totalsupply","text":"Live supply: mints ever minus burns. On the sequential form a burn lowers this; on the pooled form a re-mint of a burned id raises it."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"version","anchor":"version","text":"The implementation version, a compile-time constant (1 for this generation). A new generation ships as a new implementation and factory, so a collection reports the version it was cloned from."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"AdminSet","anchor":"adminset","text":"Emitted when an admin key is granted (allowed = true) or revoked. Indexed by account."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Approval","anchor":"approval","text":"Standard ERC721 single-token approval event. Indexed by owner, approved, and tokenId."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"ApprovalForAll","anchor":"approvalforall","text":"Standard ERC721 operator approval event. Indexed by owner and operator, with the approved flag."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"BatchMetadataUpdate","anchor":"batchmetadataupdate","text":"ERC-4906 range refresh, emitted by setRenderer and setSupplyCap (all tokens) and by notifyMetadataUpdate (a renderer- or admin-chosen range)."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Burned","anchor":"burned","text":"Emitted when a token is burned. Indexed by tokenId. A pooled id may be re-minted later, covered by a new Minted."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"ContractURIUpdated","anchor":"contracturiupdated","text":"ERC-7572 contract-level refresh, emitted by setRenderer alongside the token-range refresh."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"CreatorListed","anchor":"creatorlisted","text":"Emitted when the owner lists or unlists a creator, including each creator seeded at init. Indexed by creator, with the listed flag. Confirmed status is a live isConfirmedCreator read."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Initialized","anchor":"initialized","text":"OpenZeppelin Initializable event, emitted once when the clone is initialized."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"MetadataUpdate","anchor":"metadataupdate","text":"ERC-4906 single-token refresh, declared for interface completeness; range refreshes use BatchMetadataUpdate."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Minted","anchor":"minted","text":"Emitted once per mint call. Indexed by minter (the authorized minter that issued the tokens) and to (the recipient). On the sequential form a call covers ids [firstTokenId, firstTokenId + quantity - 1]; on the pooled form firstTokenId is the minted id and quantity is 1. firstMintIndex is the global "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"MinterLocked","anchor":"minterlocked","text":"Emitted once when lockMinter runs."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"MinterSet","anchor":"minterset","text":"Emitted when a minter is granted or revoked, and once per initial minter at init. Indexed by minter, with the allowed flag. The factory's SurfaceCreated names the chosen primary minter directly (see PrimaryMinterSet for the live pointer)."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"OwnershipTransferred","anchor":"ownershiptransferred","text":"Standard Ownable event, emitted at init when the first owner is set, when acceptOwnership completes a transfer, and when renounceOwnership sets the owner to zero. Indexed by previousOwner and newOwner."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"OwnershipTransferStarted","anchor":"ownershiptransferstarted","text":"Standard Ownable2Step event, emitted by transferOwnership when a pending owner is recorded. Indexed by previousOwner and newOwner."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"PrimaryMinterSet","anchor":"primaryminterset","text":"Emitted whenever the frontend-discovery pointer changes: setPrimaryMinter on the sequential form, a pooled sole-minter grant or revoke tracking automatically, a revoke of the current primary clearing it to zero on either form, or the value seeded at init. Indexed by minter (the new value, zero when "},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"RendererLocked","anchor":"rendererlocked","text":"Emitted once when lockRenderer runs, or for a lock set at init."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"RendererSet","anchor":"rendererset","text":"Emitted when the renderer pointer changes. Indexed by renderer."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"RoyaltySet","anchor":"royaltyset","text":"Emitted when the royalty changes with setRoyalty. Indexed by royaltyReceiver."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"StrayETHRescued","anchor":"strayethrescued","text":"Emitted when rescueStrayETH sweeps force-fed ETH. Indexed by to, with the amount in wei."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"SupplyCapSet","anchor":"supplycapset","text":"Emitted when the supply cap changes with setSupplyCap."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"SupplyLocked","anchor":"supplylocked","text":"Emitted once when lockSupply runs, or for a lock set at init."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"SurfaceConfigured","anchor":"surfaceconfigured","text":"Emitted once at init with the id mode and supply cap. The id mode is fixed; the cap has its own update event."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Transfer","anchor":"transfer","text":"Standard ERC721 transfer event, emitted on mint (from the zero address), transfer, and burn (to the zero address). Indexed by from, to, and tokenId."},{"path":"/docs/surface/contracts/surface","page":"Surface","heading":"Errors","anchor":"errors","text":"AlreadyAdmin() addAdmin was called for the owner or an existing admin. BadSupplyCap(uint256 floor, uint256 requested) setSupplyCap was given a nonzero cap below current usage: mints ever on the sequential form, live supply on the pooled form. ERC721IncorrectOwner(address sender, uint256 tokenId, add"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"SurfaceFactory","anchor":"","text":"0xdB81d3F33EF3D84685486916E0d372E247558094 · view on evm.now · Ethereum mainnet Deploys one Surface collection per call as an EIP-1167 clone of a fixed implementation: no proxy admin, no upgrade path. createSurface clones the sequential token and a FixedPriceMinter, initializes both, and grants the "},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"One transaction, two clones","anchor":"one-transaction-two-clones","text":"createSurface clones the token (uninitialized), clones the minter and initializes it bound to the token with the caller's SaleConfig, then initializes the token with the minter as its sole initial minter. Clone order matters because the minter's initialize requires the collection address to have cod"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"SaleConfig","anchor":"saleconfig","text":"The sale argument to createSurface is the canonical minter's config, minus the collection address the factory fills in. Each field is settable on the minter afterward by the collection's owner or admin. Field Type Meaning --- --- --- price uint256 Price per token in wei, used when priceStrategy is u"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Creator listing at init","anchor":"creator-listing-at-init","text":"The creators argument sets the collection's listed-creator set during initialize, emitting CreatorListed per address. This is the collection's own storage, not a shared-registry write: the Catalog is only read. A listed creator confirms by claiming the collection in the Catalog from their own addres"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"createSurface","anchor":"createsurface","text":"Access: permissionless (anyone may deploy; control belongs to the owner argument) Deploys a sequential collection wired to a canonical FixedPriceMinter clone in one transaction: clones the token, clones and initializes the minter bound to it with sale, then initializes the token with the minter as i"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"createSurfaceCustom","anchor":"createsurfacecustom","text":"Access: permissionless (control belongs to the owner argument) Deploys a sequential collection with no canonical minter: clones the token and initializes it with the caller's initialMinters (empty for collections that grant minters later) and a caller-chosen primaryMinter (the frontend-discovery def"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"createPooledSurface","anchor":"createpooledsurface","text":"Access: permissionless (control belongs to the owner argument) Deploys a pooled collection: the form where the minter chooses each id (tokenId == sourceId) and holds the pool's economics. Grant that minter in initialMinters so the collection deploys wired in one transaction; the pooled form holds on"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"deprecate","anchor":"deprecate","text":"Access: deployer-only (msg.sender must be the factory deployer, else NotDeployer) One-way stop for new deploys: afterward every create function reverts FactoryDeprecated, and successor points to a replacement factory (zero if none is set). Deployed collections and minters are unaffected; the deploye"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"setPaused","anchor":"setpaused","text":"Access: deployer-only (msg.sender must be the factory deployer, else NotDeployer) Reversible pause on new deploys, separate from deprecate. While paused, the create functions revert FactoryPaused. A deprecated factory stays off regardless of this flag. Deployed collections are unaffected. Emits Paus"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"allSurfaces","anchor":"allsurfaces","text":"Every collection address the factory has deployed, in deployment order. For direct onchain enumeration; indexers typically read SurfaceCreated."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"catalog","anchor":"catalog","text":"The Catalog singleton wired into every collection this factory creates, read to confirm creators (isConfirmedCreator). The Catalog is only read. Zero disables confirmation: a collection wired with no Catalog can list creators but confirms none."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"defaultRenderer","anchor":"defaultrenderer","text":"The renderer a collection uses when its config names none. May be zero: with no factory default, a collection that names no renderer reverts RendererRequired at creation. A collection's owner can change its renderer after deploy; this is only the value new collections start with."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"deployer","anchor":"deployer","text":"The address that deployed the factory: the only address that may deprecate or setPaused. It has no power over deployed collections or minters."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"deprecated","anchor":"deprecated","text":"True after the factory has been deprecated (new deploys revert)."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"isSurface","anchor":"issurface","text":"Whether an address is a collection this factory deployed. Cheaper than scanning allSurfaces for a membership check."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"minterImplementation","anchor":"minterimplementation","text":"The FixedPriceMinter implementation createSurface clones. Fixed at construction, no setter. Not used by createSurfaceCustom or createPooledSurface, which take minters from the caller."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"paused","anchor":"paused","text":"True while new deploys are paused (see setPaused). Reversible, unlike deprecated."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"pooledImplementation","anchor":"pooledimplementation","text":"The PooledSurface implementation every createPooledSurface clone delegates to. Fixed at construction, no setter."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"sequentialImplementation","anchor":"sequentialimplementation","text":"The sequential Surface implementation every createSurface and createSurfaceCustom clone delegates to. Fixed at construction, no setter."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"successor","anchor":"successor","text":"The replacement factory set at deprecation, or zero. Informational."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"totalSurfaces","anchor":"totalsurfaces","text":"The length of allSurfaces."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Deprecated","anchor":"deprecated","text":"Emitted once when the deployer deprecates the factory, carrying the successor address (zero if none). Indexed by successor."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"PausedSet","anchor":"pausedset","text":"Emitted when the deployer pauses or resumes new deploys, with the new paused state."},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"SurfaceCreated","anchor":"surfacecreated","text":"Emitted once per successful create call, with owner and collection indexed. primaryMinter is the chosen primary at creation: the canonical FixedPriceMinter clone createSurface wired, the caller's supplied primary on createSurfaceCustom/createPooledSurface, or address(0) when none was designated. Thi"},{"path":"/docs/surface/contracts/factory","page":"SurfaceFactory","heading":"Errors","anchor":"errors","text":"AlreadyDeprecated() deprecate was called on an already-deprecated factory. FactoryDeprecated() A create function was called after deprecation. Deploy through the successor factory (successor()). FactoryPaused() A create function was called while the factory is paused (see setPaused). FailedDeploymen"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"FixedPriceMinter","anchor":"","text":"Implementation 0x50941e5fd0B177826AB86419502b221049821Ba3 · view on evm.now · Ethereum mainnet Deployed per collection as an EIP-1167 clone of the implementation above: createSurface wires one automatically and SurfaceCreated.primaryMinter records it. A minter clone has no canonical address of its o"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Pricing","anchor":"pricing","text":"With no price strategy set, the required payment is price quantity and msg.value must equal it (WrongPayment otherwise). With a strategy set, the quote can change between read and inclusion, so mint requires msg.value at least the quote (Underpayment otherwise) and credits the excess back to the pay"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Gates","anchor":"gates","text":"Two optional gates, both checked in mint and both evaluating the recipient to, not the payer: - Merkle allowlist (allowlistRoot nonzero): the caller passes an ABI-encoded bytes32[] proof in data. The leaf is the OpenZeppelin standard-merkle-tree single-address leaf, keccak256(bytes.concat(keccak256("},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Pull payments","anchor":"pull-payments","text":"mint credits the referral share and the payout as internal balances rather than transferring during the call; withdraw(account) sends a balance out. payoutRecipient is a concrete stored value, enforced nonzero at both initialize and setPayoutRecipient, so it is never resolved from the collection's l"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Minting from a frontend","anchor":"minting-from-a-frontend","text":"The two mint entrypoints share the same guarded path ( executeMint internally), so settlement, gates, and reentrancy protection are identical; only the caller-facing shape differs."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"mint(address, uint256, address, bytes)","anchor":"mintaddress-uint256-address-bytes","text":"Access: permissionless (payable; window, ceiling, gate, and payment checks apply) Takes payment and mints quantity tokens to to. to is the recipient and the address the gates evaluate; msg.sender is the payer, and any strategy overpayment refund is credited to the payer. referrer, when nonzero, rece"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"mint(uint256)","anchor":"mintuint256","text":"Access: permissionless (payable; window, ceiling, gate, and payment checks apply) Ergonomic overload for the common case: mints quantity tokens to msg.sender with no referrer and no gate data, equivalent to mint(msg.sender, quantity, address(0), \"\"). Same checks, settlement, and Sold emission as the"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"withdraw","anchor":"withdraw","text":"Access: permissionless (funds go only to account) Sends account its owed pull-payment balance. Any caller may invoke it; the transfer goes to account. Reverts ZeroAccount for the zero address, NothingToWithdraw for a zero balance, and WithdrawFailed if the transfer reverts, leaving the balance intac"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setPrice","anchor":"setprice","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the fixed price per token, used when no price strategy is set. Emits PriceSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setPriceStrategy","anchor":"setpricestrategy","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the price strategy, or zero to use the fixed price. Reverts NotAContract for a nonzero address with no code. Emits PriceStrategySet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setMintWindow","anchor":"setmintwindow","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the sale window. Reverts BadMintWindow unless end is 0 (open-ended) or strictly after start. Emits MintWindowSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setPayoutRecipient","anchor":"setpayoutrecipient","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the stored payout address for future mints. Reverts PayoutRecipientRequired for the zero address. Balances already credited stay at the address they were credited to. Emits PayoutRecipientSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setMaxMints","anchor":"setmaxmints","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets this clone's sale ceiling (0 = unlimited), checked against totalMinted. Distinct from the collection's supply cap. Emits MaxMintsSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setAllowlistRoot","anchor":"setallowlistroot","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the Merkle allowlist root, or zero for no allowlist. Emits AllowlistRootSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setWalletCap","anchor":"setwalletcap","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the per-recipient cap (0 = unlimited), checked against mintedBy[to]. Counted per recipient on this clone only. Emits WalletCapSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"setReferralShareBps","anchor":"setreferralsharebps","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sets the referral share in bps. Reverts ReferralShareAboveCap above MAX REFERRAL SHARE BPS. Emits ReferralShareSet."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"rescueStrayETH","anchor":"rescuestrayeth","text":"Access: collection owner or admin (onlyCollectionOwnerOrAdmin, else NotAuthorized) Sends to the ETH balance above the sum of pull-payment balances. Owed balances are not swept. Reverts ZeroAccount for the zero address, NoStrayETH when the surplus is zero, and RescueFailed if the transfer reverts. Em"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization) Sets the collection binding and the sale config once; the collection binding has no setter. Reverts CollectionRequired for a zero collection, NotAContract for a collection or nonzero price strategy with no code, BadMintWindow for a "},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"allowlistRoot","anchor":"allowlistroot","text":"The Merkle allowlist root, or zero for no allowlist."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"collection","anchor":"collection","text":"The collection this clone sells for. Set at initialize; no setter."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"MAX_REFERRAL_SHARE_BPS","anchor":"maxreferralsharebps","text":"Hard ceiling for the referral share: 1000 bps, 10%. setReferralShareBps rejects anything above it."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"maxMints","anchor":"maxmints","text":"This clone's sale ceiling (0 = unlimited), checked against totalMinted."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"mintedBy","anchor":"mintedby","text":"Tokens minted to a recipient through this clone, the counter behind walletCap. Incremented after a successful mint."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"mintEnd","anchor":"mintend","text":"Sale window end in unix seconds; 0 means open-ended."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"mintStart","anchor":"mintstart","text":"Sale window start in unix seconds; 0 means open immediately."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"payoutRecipient","anchor":"payoutrecipient","text":"The stored artist payout address. Never zero once set: enforced nonzero at both initialize and setPayoutRecipient, and never derived from the collection's live owner(), so a renounced collection keeps paying it."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"pendingWithdrawal","anchor":"pendingwithdrawal","text":"The pull-payment balance in wei owed to an account, withdrawn with withdraw."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"price","anchor":"price","text":"The fixed price per token in wei, used when priceStrategy is zero."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"priceOf","anchor":"priceof","text":"The required payment in wei to mint quantity tokens to to: price quantity, or the strategy quote when one is set. Takes no gate data, since pricing is a function of (collection, to, quantity) and chain state only. Does not check the gates or the window. A strategy quote can change between this read "},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"priceStrategy","anchor":"pricestrategy","text":"The price strategy contract, or zero when the fixed price applies."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"referralShareBps","anchor":"referralsharebps","text":"The live referral share in bps. Initialized to MAX REFERRAL SHARE BPS; applied only when a mint's referrer is nonzero. Not a protocol fee."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"saleCap","anchor":"salecap","text":"Alias for maxMints: this clone's own sale ceiling, distinct from the collection's supplyCap."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"totalMinted","anchor":"totalminted","text":"Tokens minted through this clone, the counter behind maxMints."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"totalMintedByThisMinter","anchor":"totalmintedbythisminter","text":"Alias for totalMinted, under a name a client reading across multiple minters can use unambiguously: the count minted through this clone, not the collection's lifetime count."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"walletCap","anchor":"walletcap","text":"The per-recipient cap (0 = unlimited), checked against mintedBy."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"AllowlistRootSet","anchor":"allowlistrootset","text":"Emitted when the allowlist root changes with setAllowlistRoot."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Initialized","anchor":"initialized","text":"OpenZeppelin Initializable event, emitted once when the clone is initialized."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"MaxMintsSet","anchor":"maxmintsset","text":"Emitted when the sale ceiling changes with setMaxMints."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"MinterConfigured","anchor":"minterconfigured","text":"Emitted at initialize with the collection binding and the opening sale config. Indexed by collection. Each field has its own update event afterward."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"MintWindowSet","anchor":"mintwindowset","text":"Emitted when the window changes with setMintWindow."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"PayoutRecipientSet","anchor":"payoutrecipientset","text":"Emitted when the payout address changes with setPayoutRecipient. Indexed by payoutRecipient. Affects future accruals."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"PriceSet","anchor":"priceset","text":"Emitted when the fixed price changes with setPrice."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"PriceStrategySet","anchor":"pricestrategyset","text":"Emitted when the price strategy changes with setPriceStrategy. Indexed by strategy."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"ReferralPaid","anchor":"referralpaid","text":"Emitted when a nonzero referral cut is credited. Indexed by referrer, with the amount in wei."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"ReferralShareSet","anchor":"referralshareset","text":"Emitted when the referral share changes with setReferralShareBps."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Sold","anchor":"sold","text":"Emitted once per mint call. Indexed by payer (msg.sender), to, and referrer. paid is the settled price, excluding refunded excess; firstTokenId is the first id of the minted range, matching the collection's Minted from the same call. The ABI is the same across every clone, so one indexer handler cov"},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"StrayETHRescued","anchor":"strayethrescued","text":"Emitted when rescueStrayETH sweeps unowed ETH. Indexed by to, with the amount in wei."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"WalletCapSet","anchor":"walletcapset","text":"Emitted when the per-recipient cap changes with setWalletCap."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Withdrawn","anchor":"withdrawn","text":"Emitted when a pull-payment balance is paid out. Indexed by account, with the amount in wei."},{"path":"/docs/surface/contracts/fixed-price-minter","page":"FixedPriceMinter","heading":"Errors","anchor":"errors","text":"BadMintWindow() initialize or setMintWindow was given a nonzero mintEnd not strictly after mintStart. Use mintEnd = 0 for open-ended. CollectionRequired() initialize was given the zero address as the collection. InvalidInitialization() OpenZeppelin Initializable error: initialize was called more tha"},{"path":"/docs/surface/contracts/i-price-strategy","page":"IPriceStrategy","heading":"IPriceStrategy","anchor":"","text":"Interface (ABI only), not a deployed contract. Implement it to install a custom pricing module in the price slot. IPriceStrategy is the interface a contract implements to occupy the price slot inside a collection's minter, the optional pricing module on the canonical FixedPriceMinter (see the slots "},{"path":"/docs/surface/contracts/i-price-strategy","page":"IPriceStrategy","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/i-price-strategy","page":"IPriceStrategy","heading":"priceOf","anchor":"priceof","text":"view; returns the total price in wei for quantity tokens quoted for minter on collection. minter is the mint recipient the quote is for: FixedPriceMinter passes the mint's to address, the same address its gates evaluate. The collection address is passed explicitly rather than read from msg.sender, s"},{"path":"/docs/surface/contracts/i-renderer","page":"IRenderer","heading":"IRenderer","anchor":"","text":"Interface (ABI only), not a deployed contract. Implement it to install a custom renderer in the renderer slot. IRenderer is the interface a contract implements to occupy a collection's renderer slot, the token's one swappable presentation slot (see slots and modules) on the Surface core. A collectio"},{"path":"/docs/surface/contracts/i-renderer","page":"IRenderer","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/i-renderer","page":"IRenderer","heading":"contractURI","anchor":"contracturi","text":"view; returns the collection-level metadata URI for collection. Called by the collection's own contractURI when this renderer occupies its renderer slot. Marketplaces and indexers read this for collection-level display metadata, separate from any individual token's tokenURI."},{"path":"/docs/surface/contracts/i-renderer","page":"IRenderer","heading":"tokenURI","anchor":"tokenuri","text":"view; returns the metadata URI for tokenId on collection. Called by the collection's own tokenURI when this renderer occupies its renderer slot, and callable directly offchain against any collection this renderer supports. Implementations read the collection through the appropriate V1 or current V2 "},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"ISurfaceView","anchor":"","text":"Interface (ABI only): the read surface a collection exposes to its renderer, price strategy, and minters. ISurfaceView is the V1 read surface a collection exposes for its renderer, a price strategy, and any minter to read without depending on the full Surface ABI. It is not itself a swappable slot; "},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"config","anchor":"config","text":"view; the live collection configuration and the minted-ever count. A renderer derives provenance from these: in Sequential mode the token id IS the mint order, first = id 1, and final = the cap is set and full and the id equals the cap (cap != 0 && minted == cap && tokenId == cap). There is no lifec"},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"idMode","anchor":"idmode","text":"view; the collection's token id assignment model, Sequential or Pooled, fixed at initialization. See id modes for what each mode means for id assignment and reuse after burn."},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"name","anchor":"name","text":"view; the collection's ERC721 name."},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"owner","anchor":"owner","text":"view; the collection's current owner, following the standard Ownable owner() shape."},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"symbol","anchor":"symbol","text":"view; the collection's ERC721 symbol."},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"tokenSeed","anchor":"tokenseed","text":"view; the mint-time entropy stamped for tokenId during its mint transaction. Renderers use this seed as the deterministic input for generative or algorithmic works."},{"path":"/docs/surface/contracts/i-surface-view","page":"ISurfaceView","heading":"totalSupply","anchor":"totalsupply","text":"view; the collection's current total supply."},{"path":"/docs/surface/contracts/i-preview-renderer","page":"IPreviewRenderer","heading":"IPreviewRenderer","anchor":"","text":"Interface (ABI only), OPTIONAL. Implement it on a renderer to support rendering a hypothetical token for a caller-supplied seed with no token needing to exist. An optional extension a renderer implements to render the output for a caller-supplied seed with no token existing. A preview is a pure func"},{"path":"/docs/surface/contracts/i-preview-renderer","page":"IPreviewRenderer","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/i-preview-renderer","page":"IPreviewRenderer","heading":"previewURI","anchor":"previewuri","text":"view; renders preview metadata for a token that need not exist. collection is the collection the preview is for; its name and render settings are read live. tokenId is the token id to render; a work keyed to mint order reads it, so a caller previews the next token by passing minted + 1. seed is a ca"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"SurfaceV2","anchor":"","text":"Implementation 0x9E90a7dbE576f23d909B81d90ff939b5041930e4 · view on evm.now · Ethereum mainnet The v2 token, deployed per artist as an EIP-1167 clone of the implementation above through the token CloneFactory, usually by the Launcher. A collection has no canonical address of its own; substitute your"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"One minter","anchor":"one-minter","text":"minter is a single address. Only it can call mintTo. The FixedPriceSale the launcher wires is the usual minter; a bespoke minter (custom economics) or the owner's own wallet (an airdrop: setMinter(owner), mintTo, setMinter(sale)) works the same way. Two concurrent minters need a small router contrac"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Renounce is the lock","anchor":"renounce-is-the-lock","text":"Every setter is onlyOwner. renounceOwnership sets the owner to zero, after which the renderer, minter, supply cap, royalty and name are fixed for good. transferOwnership is single-step and rejects the zero address. Once the owner is zero, any sale or gate that borrows the collection's authority is f"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Seed","anchor":"seed","text":"Each token's seed is keccak256(abi.encode(block.prevrandao, collection, tokenId)), stored at mint. It excludes the recipient so a minter cannot grind wallets for a favorable seed, and stays readable after a burn. See the injection convention."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"mintTo","anchor":"mintto","text":"Access: minter-only (msg.sender == minter, else NotMinter) Mints quantity tokens to to with ids firstTokenId .. firstTokenId + quantity - 1, where firstTokenId is the lifetime mint count plus one, and returns firstTokenId. Reverts ZeroQuantity on zero and ExceedsCap when a set supply cap would be pa"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"burn","anchor":"burn","text":"Access: permissionless (holder or approved, else ERC721InsufficientApproval) Burns tokenId. The collection owner has no burn authority over a token it does not hold. Burns never free cap room and the seed stays readable. Emits Burned."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setMinter","anchor":"setminter","text":"Access: owner-only (OwnableUnauthorizedAccount) Sets the one minter. Zero is allowed and means nobody can mint. Emits MinterSet."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setRenderer","anchor":"setrenderer","text":"Access: owner-only (OwnableUnauthorizedAccount) Points tokenURI and contractURI at a new renderer. Reverts RendererRequired on zero and RendererNotContract on an address without code. Emits RendererSet, BatchMetadataUpdate(0, type(uint256).max) and ContractURIUpdated."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setSupplyCap","anchor":"setsupplycap","text":"Access: owner-only (OwnableUnauthorizedAccount) Sets the lifetime mint ceiling. 0 is open. A nonzero cap below the lifetime mint count reverts BadSupplyCap. Emits SupplyCapSet."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setRoyalty","anchor":"setroyalty","text":"Access: owner-only (OwnableUnauthorizedAccount) Sets the EIP-2981 rate and receiver. Reverts RoyaltyReceiverRequired on a zero receiver and RoyaltyTooHigh above 5000 bps. Emits RoyaltySet."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setName","anchor":"setname","text":"Access: owner-only (OwnableUnauthorizedAccount) Changes name() and symbol(). The name lives only in the collection; renderers read it from here. Emits NameSet, BatchMetadataUpdate(0, type(uint256).max) and ContractURIUpdated."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"notifyMetadataUpdate","anchor":"notifymetadataupdate","text":"Access: owner-only or the renderer (NotAuthorized) Emits BatchMetadataUpdate(fromTokenId, toTokenId) for changes the collection cannot observe (a live work's output, a reveal). The renderer can still call it after a renounce. No state change."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization) Sets name, symbol, owner, renderer, supply cap, royalty and the required initial minter. Reverts OwnableInvalidOwner on a zero owner, RendererRequired or RendererNotContract on a bad renderer, RoyaltyReceiverRequired, RoyaltyTooHigh"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"renounceOwnership","anchor":"renounceownership","text":"Access: owner-only (OwnableUnauthorizedAccount) Sets the owner to zero. Every setter is refused from then on; this is the collection's only lock. Emits OwnershipTransferred."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"transferOwnership","anchor":"transferownership","text":"Access: owner-only (OwnableUnauthorizedAccount) Single-step transfer to a new owner. Rejects the zero address (OwnableInvalidOwner). Emits OwnershipTransferred."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"approve","anchor":"approve","text":"Access: permissionless (holder or operator, standard ERC721) Standard ERC721 single-token approval."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"setApprovalForAll","anchor":"setapprovalforall","text":"Access: permissionless (standard ERC721) Standard ERC721 operator approval."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"transferFrom","anchor":"transferfrom","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 transfer. A transfer to the collection's own address reverts SelfCustodyRejected."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"safeTransferFrom(address, address, uint256)","anchor":"safetransferfromaddress-address-uint256","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 safe transfer, with the same self-custody rule as transferFrom."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"safeTransferFrom(address, address, uint256, bytes)","anchor":"safetransferfromaddress-address-uint256-bytes","text":"Access: owner-or-approved-only (standard ERC721 transfer authority, else ERC721InsufficientApproval) Standard ERC721 safe transfer with data, with the same self-custody rule as transferFrom."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"balanceOf","anchor":"balanceof","text":"Standard ERC721 balance."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"config","anchor":"config","text":"(renderer, minter, supplyCap, royaltyBps, royaltyReceiver, minted) in one read, where minted is the lifetime mint count. This flat tuple differs from the V1 config ABI. Renderers can derive provenance from sequential ids: first is id 1; with a nonzero cap, the final possible mint has tokenId == supp"},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"contractURI","anchor":"contracturi","text":"Delegates to IRenderer(renderer).contractURI(collection). The collection's cover and description live in the renderer."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"getApproved","anchor":"getapproved","text":"Standard ERC721 approved address for a token."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"isApprovedForAll","anchor":"isapprovedforall","text":"Standard ERC721 operator check."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"minter","anchor":"minter","text":"The one address allowed to call mintTo. Zero means nobody can mint."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"name","anchor":"name","text":"The collection name, settable by the owner with setName."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"owner","anchor":"owner","text":"The current owner, or zero once renounced."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"ownerOf","anchor":"ownerof","text":"Standard ERC721 holder of a token."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"renderer","anchor":"renderer","text":"The renderer tokenURI and contractURI delegate to."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"royaltyBps","anchor":"royaltybps","text":"The EIP-2981 rate in basis points."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"royaltyInfo","anchor":"royaltyinfo","text":"EIP-2981: the stored receiver and salePrice royaltyBps / 10000, the same for every token. The amount uses full-precision Math.mulDiv, so a large salePrice does not overflow the intermediate multiplication."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"royaltyReceiver","anchor":"royaltyreceiver","text":"The EIP-2981 receiver. Never zero."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"supplyCap","anchor":"supplycap","text":"The lifetime mint ceiling; 0 is open."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"supportsInterface","anchor":"supportsinterface","text":"True for ERC-165, ERC-721, ERC-721 Metadata, ERC-2981 and ERC-4906."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"symbol","anchor":"symbol","text":"The collection symbol, settable by the owner with setName."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"tokenSeed","anchor":"tokenseed","text":"The mint-time seed of a token. Reverts NeverMinted for an id outside 1 to the lifetime mint count; still readable after a burn."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"tokenURI","anchor":"tokenuri","text":"Delegates to IRenderer(renderer).tokenURI(collection, tokenId). Reverts ERC721NonexistentToken for a token that does not exist."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"totalSupply","anchor":"totalsupply","text":"Live tokens: lifetime mints minus burns."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"version","anchor":"version","text":"2, the implementation lineage marker."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Approval","anchor":"approval","text":"Standard ERC721 approval event."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"ApprovalForAll","anchor":"approvalforall","text":"Standard ERC721 operator approval event."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"BatchMetadataUpdate","anchor":"batchmetadataupdate","text":"ERC-4906 refresh signal for a token id range; (0, type(uint256).max) means every token."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Burned","anchor":"burned","text":"A token was burned."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"ContractURIUpdated","anchor":"contracturiupdated","text":"ERC-7572 signal that contractURI output changed."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Initialized","anchor":"initialized","text":"Standard OpenZeppelin Initializable event, emitted once by initialize."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Minted","anchor":"minted","text":"One per mintTo call: the calling minter, the recipient, the first id and the quantity. Ids run contiguously from firstTokenId."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"MinterSet","anchor":"minterset","text":"The minter changed, including at initialize."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"NameSet","anchor":"nameset","text":"The name and symbol changed."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"OwnershipTransferred","anchor":"ownershiptransferred","text":"Standard OpenZeppelin Ownable event, emitted on initialize, transfer and renounce."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"RendererSet","anchor":"rendererset","text":"The renderer changed, including at initialize."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"RoyaltySet","anchor":"royaltyset","text":"The royalty changed, including at initialize."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"SupplyCapSet","anchor":"supplycapset","text":"The supply cap changed, including at initialize."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Transfer","anchor":"transfer","text":"Standard ERC721 transfer, mint and burn event."},{"path":"/docs/surface/contracts/surface-v2","page":"Surface (v2)","heading":"Errors","anchor":"errors","text":"BadSupplyCap(uint256 minted, uint256 cap) A nonzero supply cap below the lifetime mint count. ERC721IncorrectOwner(address sender, uint256 tokenId, address owner) Standard ERC721 error: the from address does not hold the token. ERC721InsufficientApproval(address operator, uint256 tokenId) Standard E"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"FixedPriceSale","anchor":"","text":"Implementation 0xd97E71DAB49fb20F9b5d12DE3A49ce95fdfD086E · view on evm.now · Ethereum mainnet Deployed per sale as an EIP-1167 clone of the implementation above through the sale CloneFactory; launch wires one to each new collection and Launched.sale records it. A sale has no canonical address of it"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Two mint paths","anchor":"two-mint-paths","text":"mint(quantity) mints to the caller, pays the referral share to the sale's fixed defaultReferrer (copied from the launcher at launch) and sends no gate data. mintWithReferral(to, quantity, referrer, data) is the full path: any recipient, an explicit referrer, and gate data. Zero, the sale itself, and"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"The checks, in order","anchor":"the-checks-in-order","text":"1. not closed (SaleClosed) 2. inside the window (MintNotStarted, MintEnded) 3. totalMinted + quantity <= maxMints when set (MaxMintsExceeded) 4. the gate's check returns true when a gate is set (GateRejected) 5. mintedBy[to] + quantity <= walletCap when set (WalletCapExceeded) 6. msg.value == price "},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Referral share","anchor":"referral-share","text":"A constant 5%, with no setter. It pays the referrer supplied to the mint. An artist's own site can pass the payout recipient as referrer, so that account receives both shares; anyone can name themselves when minting straight from the contract. It is a host reward, not a protocol fee. The sale and co"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"mint","anchor":"mint","text":"Access: permissionless (the mint checks above) Mints quantity tokens to the caller with defaultReferrer as referrer and empty gate data. An AllowlistGate rejects that empty data with GateRejected; a custom gate decides whether to accept it. Payable; nonReentrant. Emits Sold and, for a nonzero referr"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"mintWithReferral","anchor":"mintwithreferral","text":"Access: permissionless (the mint checks above) Mints quantity tokens to to. to is both the recipient and the address the gate and wallet cap evaluate. referrer receives the referral share when nonzero and neither the sale nor collection address. data goes to the gate and nothing else (for AllowlistG"},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"withdraw","anchor":"withdraw","text":"Access: permissionless (funds go only to account) Sends account its whole owed balance. Reverts ZeroAccount, NothingToWithdraw, or WithdrawFailed when the transfer fails (the balance is kept). Emits Withdrawn."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"withdrawTo","anchor":"withdrawto","text":"Access: permissionless (the caller's own balance only) Sends the caller's owed balance to to. Same reverts as withdraw."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setPrice","anchor":"setprice","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets the price per token in wei. Emits PriceSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setMintWindow","anchor":"setmintwindow","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets the window. 0 start opens now, 0 end is open-ended; an end at or before a start reverts BadMintWindow. Emits MintWindowSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setMaxMints","anchor":"setmaxmints","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets this sale's ceiling; 0 is unlimited. Emits MaxMintsSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setWalletCap","anchor":"setwalletcap","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets the per-recipient cap; 0 is unlimited. Counts every earlier mint. Emits WalletCapSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setPayoutRecipient","anchor":"setpayoutrecipient","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets where the artist share accrues. Rejects zero (PayoutRecipientRequired). Balances already accrued stay with the old recipient. Emits PayoutRecipientSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"setGate","anchor":"setgate","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets the gate; 0 removes it. A nonzero address without code reverts NotAContract. Emits GateSet."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"close","anchor":"close","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) One-way: no mint succeeds afterwards. Another sale needs a new clone and the collection's setMinter. Emits Closed."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization); the collection already names this clone as its minter, or the caller is the collection's owner (NotAuthorized) Binds the sale to a collection with its price, window, ceiling, wallet cap, payout recipient, gate and default referrer."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"closed","anchor":"closed","text":"Whether close was called."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"collection","anchor":"collection","text":"The collection this sale mints."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"defaultReferrer","anchor":"defaultreferrer","text":"The referrer mint(quantity) pays. Fixed at initialize; may be zero."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"gate","anchor":"gate","text":"The gate consulted before each mint, or zero."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"maxMints","anchor":"maxmints","text":"This sale's ceiling; 0 is unlimited."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"mintedBy","anchor":"mintedby","text":"Tokens minted to an address through this sale, counted on every mint."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"mintEnd","anchor":"mintend","text":"Window end in unix seconds; 0 is open-ended."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"mintStart","anchor":"mintstart","text":"Window start in unix seconds; 0 is open now."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"payoutRecipient","anchor":"payoutrecipient","text":"Where the artist share accrues. Never zero."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"pendingWithdrawal","anchor":"pendingwithdrawal","text":"The owed balance of an address."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"price","anchor":"price","text":"Price per token in wei."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"priceOf","anchor":"priceof","text":"price quantity. Does not evaluate the gate or the window."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"REFERRAL_SHARE_BPS","anchor":"referralsharebps","text":"The referral share, 500 (5%)."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"supportsInterface","anchor":"supportsinterface","text":"True for ERC-165 and the IMinter interface id."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"totalMinted","anchor":"totalminted","text":"Tokens minted through this sale."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"version","anchor":"version","text":"2, the implementation lineage marker."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"walletCap","anchor":"walletcap","text":"The per-recipient cap; 0 is unlimited."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Closed","anchor":"closed","text":"The sale was closed for good."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"GateSet","anchor":"gateset","text":"The gate changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Initialized","anchor":"initialized","text":"Standard OpenZeppelin Initializable event, emitted once by initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"MaxMintsSet","anchor":"maxmintsset","text":"The ceiling changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"MintWindowSet","anchor":"mintwindowset","text":"The window changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"PayoutRecipientSet","anchor":"payoutrecipientset","text":"The payout recipient changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"PriceSet","anchor":"priceset","text":"The price changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"ReferralPaid","anchor":"referralpaid","text":"A nonzero referral amount accrued to a referrer."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Sold","anchor":"sold","text":"One per successful mint: payer, recipient, normalized referrer, quantity, exact payment and first token id. A supplied sale or collection address is recorded as the zero referrer."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"WalletCapSet","anchor":"walletcapset","text":"The wallet cap changed, including at initialize."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Withdrawn","anchor":"withdrawn","text":"An owed balance was paid out: the account it was owed to, where it went, and the amount."},{"path":"/docs/surface/contracts/fixed-price-sale","page":"FixedPriceSale","heading":"Errors","anchor":"errors","text":"BadMintWindow() A window end at or before its start. CollectionRequired() initialize was given a zero collection. GateRejected() The gate's check returned false. InvalidInitialization() Standard OpenZeppelin Initializable error: initialize on an initialized clone or on the implementation. MaxMintsEx"},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"AllowlistGate","anchor":"","text":"0xb3b0aBfeb588ab905f984a20e05784be8a35eF4f · view on evm.now · Ethereum mainnet One ownerless singleton gate serving every collection: a Merkle root per collection, set by that collection's owner. A FixedPriceSale with this gate set asks check before each mint. Leaves follow the OpenZeppelin standar"},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"setRoot","anchor":"setroot","text":"Access: owner-only (the collection's owner, borrowed; NotAuthorized) Sets the root for collection. 0 clears it, which makes every check fail. Emits RootSet."},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"check","anchor":"check","text":"True when data is an abi-encoded bytes32[] proof that to is in the collection's list. Empty data or an unset root returns false instead of reverting. quantity is ignored."},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"root","anchor":"root","text":"The root for a collection, or zero."},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"RootSet","anchor":"rootset","text":"A collection's root changed."},{"path":"/docs/surface/contracts/allowlist-gate","page":"AllowlistGate","heading":"Errors","anchor":"errors","text":"NotAuthorized() setRoot from someone other than the collection's owner, including after a renounce."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"CloneFactory","anchor":"","text":"0xA104803fc2151BE0BFF18da7bb31938a5fdEd83c · view on evm.now · Ethereum mainnet Plumbing, deployed once per implementation: the token factory (0xA104803fc2151BE0BFF18da7bb31938a5fdEd83c) clones Surface (v2) and the sale factory (0xc474809F9cDB51A01d757aA90fbfC245Ca8A5B66) clones FixedPriceSale. Each"},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"create","anchor":"create","text":"Access: permissionless (reverts FactoryPaused, FactoryDeprecated or NotInitializer) Clones the implementation at predictCreate(msg.sender), calls it with initData (an encoded initialize call), records it, and bumps the caller's createNonce. The clone's initialize sees this factory as msg.sender. Emi"},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"createDeterministic","anchor":"createdeterministic","text":"Access: permissionless (reverts FactoryPaused, FactoryDeprecated or NotInitializer) Same as create, at the CREATE2 address predict(salt, msg.sender) returns. The salt is namespaced by the caller, so nobody can take another caller's address. Reusing a salt as the same caller reverts FailedDeployment."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"setPaused","anchor":"setpaused","text":"Access: deployer-only (NotDeployer) Halts or resumes new instances. Emits PausedSet."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"deprecate","anchor":"deprecate","text":"Access: deployer-only (NotDeployer); one-way (AlreadyDeprecated) Halts new instances for good and names where new ones should come from. Unpausing does not revive it. Emits Deprecated."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"createNonce","anchor":"createnonce","text":"How many create calls a caller has made; part of its next create salt."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"deployer","anchor":"deployer","text":"The address that deployed the factory: the only one that can pause or deprecate."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"deprecated","anchor":"deprecated","text":"Whether deprecate was called."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"implementation","anchor":"implementation","text":"The contract every instance clones."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"initSelector","anchor":"initselector","text":"The implementation's initializer selector: the only call initData may make."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"isInstance","anchor":"isinstance","text":"Whether an address was created by this factory."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"paused","anchor":"paused","text":"Whether new instances are halted."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"predict","anchor":"predict","text":"The address createDeterministic(salt, ...) returns when called by caller."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"predictCreate","anchor":"predictcreate","text":"The address the next create by caller returns."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"successor","anchor":"successor","text":"The successor named by deprecate, or zero."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Created","anchor":"created","text":"One per instance: the implementation, the new instance, and the caller (the launcher, for a launcher-made collection or sale)."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Deprecated","anchor":"deprecated","text":"The factory was deprecated, naming a successor."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"PausedSet","anchor":"pausedset","text":"The pause flag changed."},{"path":"/docs/surface/contracts/clone-factory","page":"CloneFactory","heading":"Errors","anchor":"errors","text":"AddressEmptyCode(address target) Standard OpenZeppelin Address error, unreachable since a clone always has code. AlreadyDeprecated() deprecate was already called. FactoryDeprecated() A create after deprecation. FactoryPaused() A create while paused. FailedCall() Standard OpenZeppelin Address error: "},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Launcher","anchor":"","text":"0x924d16cDCB9037cE159D82923406Be161a6BCD1B · view on evm.now · Ethereum mainnet The common wiring: one launch call deploys a Surface (v2) collection and its FixedPriceSale, already pointed at each other, through the two CloneFactory instances. The launcher holds the product defaults: the owner as ro"},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"How one call wires both","anchor":"how-one-call-wires-both","text":"The launcher predicts the sale's CREATE2 address, creates the collection with that address as its initial minter, then creates the sale at the predicted address. The sale's initialize authority check passes because the collection already names it."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Parameters","anchor":"parameters","text":"TokenParams: name, symbol, owner, renderer, supplyCap, royaltyBps, royaltyReceiver (0 defaults to owner). SaleParams: price, mintStart, mintEnd, maxMints, walletCap, payoutRecipient (0 defaults to owner), gate (0 is none)."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"launch","anchor":"launch","text":"Access: permissionless (reverts when either factory is paused or deprecated) Creates the collection and its sale and returns both addresses. The sale copies the current defaultReferrer and keeps it forever. Validation errors from either initialize bubble up. Emits Launched."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"setDefaultReferrer","anchor":"setdefaultreferrer","text":"Access: owner-only (OwnableUnauthorizedAccount) Changes the referrer later launches copy into their sales; existing sales keep theirs. 0 means launcher sales pay no referral on mint. Emits DefaultReferrerSet."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"transferOwnership","anchor":"transferownership","text":"Access: owner-only (OwnableUnauthorizedAccount) Standard OpenZeppelin Ownable transfer of the right to change defaultReferrer."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"renounceOwnership","anchor":"renounceownership","text":"Access: owner-only (OwnableUnauthorizedAccount) Standard OpenZeppelin Ownable renounce: defaultReferrer is fixed for every later launch."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"defaultReferrer","anchor":"defaultreferrer","text":"The referrer each new sale copies. Should be a Safe or splitter, since every sale keeps its copy."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"nonce","anchor":"nonce","text":"Launch counter, part of each sale's salt."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"owner","anchor":"owner","text":"The address that can change defaultReferrer."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"saleFactory","anchor":"salefactory","text":"The sale CloneFactory."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"tokenFactory","anchor":"tokenfactory","text":"The token CloneFactory."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Events","anchor":"events","text":""},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"DefaultReferrerSet","anchor":"defaultreferrerset","text":"The default referrer changed, including at construction."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Launched","anchor":"launched","text":"One per launch: owner, collection and sale."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"OwnershipTransferred","anchor":"ownershiptransferred","text":"Standard OpenZeppelin Ownable event."},{"path":"/docs/surface/contracts/launcher","page":"Launcher","heading":"Errors","anchor":"errors","text":"OwnableInvalidOwner(address owner) Standard OpenZeppelin Ownable error: a zero owner. OwnableUnauthorizedAccount(address account) Standard OpenZeppelin Ownable error: an owner-only function called by someone else. SalePredictionMismatch(address predicted, address actual) The sale landed somewhere ot"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Surface V2","anchor":"","text":"Surface V2 separates the token, FixedPriceSale, and AllowlistGate. The Launcher creates a collection and its sale in one transaction through two CloneFactory instances. Each clone has a fixed implementation and no upgrade path. Existing V1 collections keep their own contracts and interfaces."},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Network and ABI","anchor":"network-and-abi","text":"The repository records the V2 primitives on Ethereum mainnet, chain 1 , in the deployment record committed November 12, 2026. The recorded deployment date is October 30, 2026, at factory block 26308156 . The launcher is 0x924d16cDCB9037cE159D82923406Be161a6BCD1B. The addresses page and protocol mani"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Launch a collection","anchor":"launch-a-collection","text":"The launcher accepts these structs: Provide a nonzero owner and a deployed renderer. There is no factory-default renderer. The launcher defaults a zero royalty receiver or payout recipient to the supplied owner at launch; later ownership changes do not redirect either stored payee. Royalty is adviso"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Mint and withdraw","anchor":"mint-and-withdraw","text":"Read the collection's minter() . It is one authorized address, not a primary pointer into a set. A canonical sale exposes the V2 IMinter interface through ERC-165: Send exactly price quantity wei. Underpayment and overpayment revert. mint(quantity) mints to the payer with the sale's fixed defaultRef"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Allowlist gate","anchor":"allowlist-gate","text":"The shared AllowlistGate stores a root per collection. The collection owner calls setRoot(collection, root) and selects the gate on the sale. Pass the recipient's proof as abi.encode(bytes32[] proof) to mintWithReferral. The leaf is keccak256(bytes.concat(keccak256(abi.encode(to)))). An unset root o"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Seed and reads","anchor":"seed-and-reads","text":"Every token stores exactly one derived seed: keccak256(abi.encode(block.prevrandao, address(this), tokenId)). There are no supplied-seed entrypoints or external seed source. tokenSeed(id) remains readable after a burn and rejects never-minted ids. This public-chain-derived entropy is unsuitable as s"},{"path":"/docs/surface/guides/surface-v2","page":"Surface V2","heading":"Ownership and permanence","anchor":"ownership-and-permanence","text":"The owner can change the renderer, minter, cap, royalty, name, and symbol. The sale and AllowlistGate borrow that owner's authority for their settings. Ownership transfer is single-step; there is no pending-owner acceptance. There are no individual locks or seal() . renounceOwnership() fixes the own"},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"Deploy a collection","anchor":"","text":"This guide uses the v1 factory and minter. For current v2 contracts, use Surface v2, Launcher, and FixedPriceSale. V2 has a single minter slot, exact fixed-price payment, and a separate optional gate. Its creation and mint signatures differ from v1; use the matching ABI. SurfaceFactory.createSurface"},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"SurfaceConfig (the token)","anchor":"surfaceconfig-the-token","text":"- supplyCap bounds mints ever on a sequential collection (burns never free a new slot). 0 is uncapped. The cap binds every minter, so no grant can exceed it - royaltyBps is capped at 5000 (50%); deploy reverts RoyaltyTooHigh above that - renderer is the one token slot. Passing 0 falls back to the fa"},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"SaleConfig (the canonical minter)","anchor":"saleconfig-the-canonical-minter","text":"The factory fills the minter's collection field with the token clone it creates in the same call, so SaleConfig is FixedPriceMinterInitParams minus collection. Every field here is live config on the minter after deploy (setPrice, setPriceStrategy, setMintWindow, setPayoutRecipient, setMaxMints, setA"},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"Generative works: bring your own renderer","anchor":"generative-works-bring-your-own-renderer","text":"createSurface takes no work-config parameter. A generative work ships as its own renderer: deploy a work-specific IRenderer that owns its algorithm and dependency references (however it chooses to store them), then point the collection's renderer slot at it, either as cfg.renderer at deploy or later"},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"Deploying with viem","anchor":"deploying-with-viem","text":"The new collection and minter addresses are in the SurfaceCreated event of the receipt's logs, and are also the return values of createSurface if you call it through a contract rather than an EOA transaction."},{"path":"/docs/surface/guides/deploy-a-collection","page":"Deploy a collection","heading":"After deploy","anchor":"after-deploy","text":"On the token, the owner can still call setRenderer and the config setters until they lock things down with lockRenderer and lockSupply, and manage minters with setMinter / lockMinter. On the minter, the owner (or an admin they grant on the collection) can change the sale config. Presentation data is"},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Mint","anchor":"","text":"This guide uses the v1 factory and minter. For current v2 contracts, use Surface v2, Launcher, and FixedPriceSale. V2 has a single minter slot, exact fixed-price payment, and a separate optional gate. Its creation and mint signatures differ from v1; use the matching ABI. The token holds no sale logi"},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Price resolution","anchor":"price-resolution","text":"If the minter has no price strategy set (priceStrategy() == address(0)), the price is price() quantity and payment must match exactly: any other msg.value reverts WrongPayment. If a price strategy is set, the minter calls priceOf(collection, to, quantity) on it once and requires msg.value = required"},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Sale window","anchor":"sale-window","text":"mintStart / mintEnd (unix seconds, both optional) live on the minter and gate mint: - Before mintStart: reverts MintNotStarted - At or after mintEnd (when set): reverts MintEnded The token carries no mint window and no lifecycle status. Anything wanting the sale phase reads the minter's mintStart/mi"},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Gates","anchor":"gates","text":"Two optional gates on the canonical minter, AND-composed in the same call, both evaluating the recipient to: - Merkle allowlist (allowlistRoot nonzero): pass an ABI-encoded bytes32[] proof in data. The leaf is the OpenZeppelin standard-merkle-tree single-address leaf, keccak256(bytes.concat(keccak25"},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Supply cap","anchor":"supply-cap","text":"The token enforces the supply cap on mintTo: ExceedsCap reverts when a mint would push past supplyCap (0 means uncapped). Sequential collections bound mints ever. The cap binds every minter, so no grant can exceed it, and lockSupply freezes it permanently."},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"cast example","anchor":"cast-example","text":"With a referrer, pass their address in the third argument."},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"viem example","anchor":"viem-example","text":""},{"path":"/docs/surface/guides/mint","page":"Mint","heading":"Reverts to handle","anchor":"reverts-to-handle","text":"Error Where Cause --- --- --- ZeroQuantity minter quantity == 0 MintNotStarted minter before mintStart MintEnded minter at or after mintEnd MaxMintsExceeded minter mint would exceed the minter's maxMints NotAllowlisted minter allowlist set and the proof does not verify for to WalletCapExceeded minte"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Write a minter","anchor":"","text":"This guide's authorization and sale examples use v1. Current v2 still exposes the token's mintTo(to, quantity), but uses one owner-set minter slot instead of a minter set: setMinter(address), with 0 disabling minting. V2 has no admins, lockMinter, pooled mode, or supplied-seed mint path. The v2 valu"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Authorization","anchor":"authorization","text":"The owner grants (or revokes) a minter explicitly, per address, on the token: setMinter authorizes a minter contract; revoking it withdraws that authorization (a revoked minter can no longer call mintTo/mintToId, but tokens it already minted are unaffected). lockMinter freezes the set permanently."},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"The token's mint entrypoints","anchor":"the-tokens-mint-entrypoints","text":"Both are non-payable and revert NotMinter if msg.sender is not authorized. Which one exists depends on the collection's idMode, fixed at deploy: - Sequential : call mintTo. The core assigns ids from its mint-order counter, mints quantity consecutive ids, returns the first, and emits one Minted event"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Value handling is entirely yours","anchor":"value-handling-is-entirely-yours","text":"mintTo and mintToId take no msg.value and do no payment accounting. If your minter is a paid mint, it is responsible for: - collecting and validating payment (ETH, an ERC20, a swap route, whatever the form needs), and refunding or escrowing as needed - honoring the referral share by convention, not "},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"The value-facing shape (`IMinter`)","anchor":"the-value-facing-shape-iminter","text":"The v1 canonical minter presents this value-facing ABI. A custom v1 minter can adopt it for compatible frontends and indexers: to is the recipient and the address any gate evaluates; msg.sender is the payer, and refunds accrue to the payer. data carries caller-supplied gate input (a Merkle proof). T"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Config authority: borrow it from the collection","anchor":"config-authority-borrow-it-from-the-collection","text":"The canonical minter has no Ownable of its own. Its setters check the collection's owner()/isAdmin, so one owner and admin set governs both contracts and an ownership transfer on the collection invalidates delegated admin access to the minter's config too. Borrowing authority this way is the recomme"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Burn semantics differ by id mode","anchor":"burn-semantics-differ-by-id-mode","text":"burn(tokenId) on the token is mode-gated: - Sequential : standard owner-or-approved burn. Burned ids are never reused - Pooled : only an authorized minter may burn (NotAuthorized otherwise). A pooled collection's tokens carry backing, pool membership, or other minter-owned state that a holder-initia"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"Minimal minter skeleton","anchor":"minimal-minter-skeleton","text":"An illustrative payment flow; use the canonical minter for production sales. This skeleton pushes payments during mint: a reverting recipient blocks the mint, and an owner resolved live as zero after renunciation can receive a payment at the zero address. It is not the canonical payout behavior; use"},{"path":"/docs/surface/guides/write-a-minter","page":"Write a minter","heading":"After deploying a minter","anchor":"after-deploying-a-minter","text":"See Id modes for the sequential/pooled contract in full, Mint for minting through the canonical minter, and FixedPriceMinter for the reference implementation."},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Write a price strategy","anchor":"","text":"V1 only. Current FixedPriceSale has no priceStrategy field or setter. On v2, implement dynamic pricing inside a custom minter and install it with setMinter(address) on the token. See Surface v2. A price strategy is a swappable module that quotes the price for a mint. It is the optional price slot in"},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Why it's view-only","anchor":"why-its-view-only","text":"priceOf is a view function: it cannot write state, hold funds, or make an external call that changes anything. The minter reads the quote once per mint and keeps custody of the funds itself (it calls priceOf a single time and reuses that value for both the payment check and the settlement split), so"},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Installing a strategy","anchor":"installing-a-strategy","text":"setPriceStrategy lives on the minter, not the token, and is authorized by the collection's owner or an admin (the minter borrows that authority). Setting address(0) reverts to the minter's stored fixed price. A minter with no strategy set uses that stored price directly; setting a strategy overrides"},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Example: fixed price per collection","anchor":"example-fixed-price-per-collection","text":"The simplest useful strategy: a shared singleton that serves a fixed per-collection price, set by each collection's own owner or an admin (useful when a factory-level default should apply across many collections)."},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Example: dynamic, reads chain state","anchor":"example-dynamic-reads-chain-state","text":"A basefee-scaled price, the reference shape for participatory or evolving works (TBAM-style pricing: basefee x f(companion state)). This example scales with block.basefee and a per-collection multiplier the owner or an admin sets, clamped to a floor: Because priceOf reads block.basefee at call time,"},{"path":"/docs/surface/guides/write-a-price-strategy","page":"Write a price strategy","heading":"Reading the current price","anchor":"reading-the-current-price","text":"The minter's priceOf resolves through whichever strategy is set (or the stored price if none is), so callers never need to know which is active. See IPriceStrategy for the generated interface reference, and Slots and modules for how this slot relates to the renderer and the minter."},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"Write a renderer","anchor":"","text":"A renderer builds tokenURI and contractURI. Both Surface generations call the same two renderer functions, passing the collection address explicitly: One renderer can serve multiple collections. It may read the seed, owner, companion contracts, other tokens, or live chain state. Its output depends o"},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"Reading collection state through ISurfaceView","anchor":"reading-collection-state-through-isurfaceview","text":"The legacy ISurfaceView read shape is v1 only. Current v2 has no idMode() and does not return a SurfaceConfig struct. Sharing IRenderer does not make the collection read ABIs interchangeable. A renderer must use the right read interface for its target collection. For current v2, the relevant reads a"},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"DefaultRenderer","anchor":"defaultrenderer","text":"DefaultRenderer was a v1 stock renderer backed by RenderAssets. These modules were not part of the recorded v1 mainnet deployment, and their Solidity sources and contract-reference pages are removed from the current tree. Legacy ABI exports may remain for historical integrations; they do not identif"},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"ScriptyRenderer (bring-your-own generative)","anchor":"scriptyrenderer-bring-your-own-generative","text":"ScriptyRenderer was a v1 generative template using ScriptyBuilderV2 and the legacy collection read shape. Its template sources and reference page have been retired too. An existing work using that code must retain its own source and dependencies; the old template is not a current v2-compatible rende"},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"Fully onchain Solidity SVG","anchor":"fully-onchain-solidity-svg","text":"A Solidity renderer can derive an SVG from tokenSeed, wrap it in metadata JSON, and return a data URI. Build the JSON with correct escaping and use the collection version's actual getters. The former shared MetadataJson helper was removed with the old modules; it is not a current library dependency."},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"Installing a renderer","anchor":"installing-a-renderer","text":"Current v2 uses owner-only setters: The address must be nonzero and contain deployed code. V2 has no default renderer fallback, admin set, or lockRenderer. The owner can replace the pointer until ownership is renounced. Renunciation also freezes the token's other owner-only settings and the bound Fi"},{"path":"/docs/surface/guides/write-a-renderer","page":"Write a renderer","heading":"Renderer permanence","anchor":"renderer-permanence","text":"Fixing the pointer fixes which renderer answers metadata calls. It does not freeze mutable state in that renderer, external dependencies, block state, or any other input the art reads. Immutable code can still produce changing work. For a fixed presentation, identify and freeze the work's relevant i"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"Access control","anchor":"","text":"Every state-changing function in the Surface contracts and who may call it. Generated from the per-contract references; the per-function pages carry the full behavior."},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"Surface","anchor":"surface","text":"Function Access --- --- mintTo minter-only (msg.sender must be an authorized minter, else NotMinter) burn owner-or-approved on the sequential form, minter-only on the pooled form (else NotAuthorized) setRenderer owner or admin (onlyOwnerOrAdmin, else NotAuthorized) setRoyalty owner or admin (onlyOwn"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"SurfaceFactory","anchor":"surfacefactory","text":"Function Access --- --- createSurface permissionless (anyone may deploy; control belongs to the owner argument) createSurfaceCustom permissionless (control belongs to the owner argument) createPooledSurface permissionless (control belongs to the owner argument) deprecate deployer-only (msg.sender mu"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"FixedPriceMinter","anchor":"fixedpriceminter","text":"Function Access --- --- mint(address, uint256, address, bytes) permissionless (payable; window, ceiling, gate, and payment checks apply) mint(uint256) permissionless (payable; window, ceiling, gate, and payment checks apply) withdraw permissionless (funds go only to account) setPrice collection owne"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"SurfaceV2","anchor":"surfacev2","text":"Function Access --- --- mintTo minter-only (msg.sender == minter, else NotMinter) burn permissionless (holder or approved, else ERC721InsufficientApproval) setMinter owner-only (OwnableUnauthorizedAccount) setRenderer owner-only (OwnableUnauthorizedAccount) setSupplyCap owner-only (OwnableUnauthoriz"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"FixedPriceSale","anchor":"fixedpricesale","text":"Function Access --- --- mint permissionless (the mint checks above) mintWithReferral permissionless (the mint checks above) withdraw permissionless (funds go only to account) withdrawTo permissionless (the caller's own balance only) setPrice owner-only (the collection's owner, borrowed; NotAuthorize"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"AllowlistGate","anchor":"allowlistgate","text":"Function Access --- --- setRoot owner-only (the collection's owner, borrowed; NotAuthorized)"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"CloneFactory","anchor":"clonefactory","text":"Function Access --- --- create permissionless (reverts FactoryPaused, FactoryDeprecated or NotInitializer) createDeterministic permissionless (reverts FactoryPaused, FactoryDeprecated or NotInitializer) setPaused deployer-only (NotDeployer) deprecate deployer-only (NotDeployer); one-way (AlreadyDepr"},{"path":"/docs/surface/reference/access-control","page":"Access control","heading":"Launcher","anchor":"launcher","text":"Function Access --- --- launch permissionless (reverts when either factory is paused or deprecated) setDefaultReferrer owner-only (OwnableUnauthorizedAccount) transferOwnership owner-only (OwnableUnauthorizedAccount) renounceOwnership owner-only (OwnableUnauthorizedAccount)"},{"path":"/docs/surface/reference/errors","page":"Errors index","heading":"Errors index","anchor":"","text":"Every custom error the Surface contracts can revert with, its contract, and the condition that raises it. AddressEmptyCode · CloneFactory\\ Standard OpenZeppelin Address error, unreachable since a clone always has code. AlreadyAdmin · Surface\\ addAdmin was called for the owner or an existing admin. A"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"Events index","anchor":"","text":"Every event the Surface contracts emit, grouped by contract. Signatures and field meanings live on the per-contract pages."},{"path":"/docs/surface/reference/events","page":"Events index","heading":"Surface","anchor":"surface","text":"AdminSet · Emitted when an admin key is granted (allowed = true) or revoked. Approval · Standard ERC721 single-token approval event. ApprovalForAll · Standard ERC721 operator approval event. BatchMetadataUpdate · ERC-4906 range refresh, emitted by setRenderer and setSupplyCap (all tokens) and by not"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"SurfaceFactory","anchor":"surfacefactory","text":"Deprecated · Emitted once when the deployer deprecates the factory, carrying the successor address (zero if none). PausedSet · Emitted when the deployer pauses or resumes new deploys, with the new paused state. SurfaceCreated · Emitted once per successful create call, with owner and collection index"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"FixedPriceMinter","anchor":"fixedpriceminter","text":"AllowlistRootSet · Emitted when the allowlist root changes with setAllowlistRoot. Initialized · OpenZeppelin Initializable event, emitted once when the clone is initialized. MaxMintsSet · Emitted when the sale ceiling changes with setMaxMints. MinterConfigured · Emitted at initialize with the collec"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"SurfaceV2","anchor":"surfacev2","text":"Approval · Standard ERC721 approval event. ApprovalForAll · Standard ERC721 operator approval event. BatchMetadataUpdate · ERC-4906 refresh signal for a token id range; (0, type(uint256).max) means every token. Burned · A token was burned. ContractURIUpdated · ERC-7572 signal that contractURI output"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"FixedPriceSale","anchor":"fixedpricesale","text":"Closed · The sale was closed for good. GateSet · The gate changed, including at initialize. Initialized · Standard OpenZeppelin Initializable event, emitted once by initialize. MaxMintsSet · The ceiling changed, including at initialize. MintWindowSet · The window changed, including at initialize. Pa"},{"path":"/docs/surface/reference/events","page":"Events index","heading":"AllowlistGate","anchor":"allowlistgate","text":"RootSet · A collection's root changed."},{"path":"/docs/surface/reference/events","page":"Events index","heading":"CloneFactory","anchor":"clonefactory","text":"Created · One per instance: the implementation, the new instance, and the caller (the launcher, for a launcher-made collection or sale). Deprecated · The factory was deprecated, naming a successor. PausedSet · The pause flag changed."},{"path":"/docs/surface/reference/events","page":"Events index","heading":"Launcher","anchor":"launcher","text":"DefaultReferrerSet · The default referrer changed, including at construction. Launched · One per launch: owner, collection and sale. OwnershipTransferred · Standard OpenZeppelin Ownable event."},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Injection convention","anchor":"","text":"How a generative work's code receives its token context, onchain and off. The parity requirement of the collection system: a work's onchain generative renderer, the studio previewer, the mint surface, and the artist-site embed must inject the identical object, so a preview renders identically to the"},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"The context object","anchor":"the-context-object","text":"Injected as a plain script before the artist's code. The historical v1 Scripty template emits dependency tags first; those libraries must not read tokenData: hash and tokenId match Art Blocks' tokenData shape, so existing AB-style sketches run unmodified. Everything else is additive. Code SHOULD rea"},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Execution context","anchor":"execution-context","text":"context tells the work's code why the document was rendered: - \"token\": the canonical render of a real token (tokenURI, and any offchain parity render of a minted token). The determinism rules below apply in full; a missing or unknown context MUST be treated as \"token\". - \"preview\": a render from a "},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Determinism rules for pure works","anchor":"determinism-rules-for-pure-works","text":"1. All randomness derives from tokenData.hash through a seeded PRNG. Never Math.random() unseeded, never crypto.getRandomValues. 2. No time: no Date, no performance.now() affecting output. Animation MAY use frame counters; the canonical still is frame-defined. 3. No network: no fetch, no XHR, no web"},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Chain-live and external-live works","anchor":"chain-live-and-external-live-works","text":"A work that reads changing state must declare which chain state, provider, or external data its output depends on. A faithful capture needs those inputs at the same block or time as the reference render; the seed alone is insufficient. Fixing renderer code does not freeze those inputs. Current v2 st"},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Onchain assembly","anchor":"onchain-assembly","text":"The former v1 ScriptyRenderer template used the order below. Its source and reference have been retired, so this is an assembly convention for artists' own renderers, not a currently bundled renderer. V2 collection reads must use the current token ABI rather than the old ISurfaceView struct return. "},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Offchain parity implementations","anchor":"offchain-parity-implementations","text":"The studio previewer, mint surface, and artist-page embed build the same document (or an equivalent iframe srcdoc) and MUST: - inject byte-identical window.tokenData (field order irrelevant, values identical; hash lowercase hex), - load the same dependency bytes (from chain, or verified against the "},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Versioning","anchor":"versioning","text":"A work's injection version pins which revision of this document it was authored against; the renderer echoes it as tokenData.version. Additive changes bump the minor conventions here without a version bump; breaking changes (renamed fields, changed ordering) require a new version and a new renderer,"},{"path":"/docs/surface/reference/injection-convention","page":"Injection convention","heading":"Seed derivation (the protocol standard)","anchor":"seed-derivation-the-protocol-standard","text":"Renderers and offchain tools read tokenSeed(tokenId) from the collection. The injection object is unchanged between v1 and v2; its version identifies the work's injection convention, not the Surface contract generation. V1 derives and stores: mintIndex distinguishes pooled re-mints of the same id. A"},{"path":"/docs/auctions/overview","page":"Overview","heading":"Overview","anchor":"","text":"The Sovereign Auction House is an onchain English auction house for ERC721 tokens, denominated in ETH. Every seller (an artist or a collector) runs their own house: it is deployed per owner as an immutable EIP-1167 clone, with isolated storage and no shared custody. It auctions any ERC721, including"},{"path":"/docs/auctions/overview","page":"Overview","heading":"The two contracts","anchor":"the-two-contracts","text":"- SovereignAuctionHouse: the per-owner clone that holds the escrowed NFTs, runs the auctions, and pays out. Its owner is fixed at init and cannot be changed: transferOwnership and renounceOwnership revert. Each house has no single fixed address, so examples use an <AUCTION HOUSE ADDRESS placeholder "},{"path":"/docs/auctions/overview","page":"Overview","heading":"V1 vs V2","anchor":"v1-vs-v2","text":"A second, independent pair of contracts, SovereignAuctionHouseV2 and its V2 factory, is also deployed on mainnet. V2 adds ERC1155 support alongside ERC721, and changes settlement from a single unconditional step to escrow-and-wait: endAuction pays the seller only after the winner's delivery is verif"},{"path":"/docs/auctions/overview","page":"Overview","heading":"Status","anchor":"status","text":"The V1 factory is deployed on Ethereum mainnet at 0xaE712abcA452901A74D1FBC0c3919F2cc060EF9f, and the V2 factory at 0x77aB853543286C9Cdd7dd6c01222A7cC4Ac93d63. Each house is a per-owner clone with no fixed address, so its examples use <AUCTION HOUSE ADDRESS (V1) or <AUCTION HOUSE V2 ADDRESS (V2). Re"},{"path":"/docs/auctions/overview","page":"Overview","heading":"Where to go next","anchor":"where-to-go-next","text":"- Auction lifecycle: the full path from create to settle, with the fee and refund math - Deploy an auction house: call the factory to get your own house - Run an auction: the seller flow, from approving the NFT to ending the auction - Bid and settle: the bidder flow, refunds, and settlement - Sovere"},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Auction lifecycle","anchor":"","text":"An auction on a SovereignAuctionHouse moves through a fixed set of steps. Each step is a single call, gated by who may make it and by the auction's current state."},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"The steps","anchor":"the-steps","text":"Step Call Who When it is valid --- --- --- --- Create createAuction / bulkCreateAuctions house owner token owned or approved, no existing auction for the token Set reserve setAuctionReservePrice seller before the first bid Bid createBid anyone (payable) after create, before the end time Extend (auto"},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Create and escrow","anchor":"create-and-escrow","text":"The house owner calls createAuction with the token id, its ERC721 contract, a duration in seconds, and a reservePrice in wei. The owner must own or be approved for the token. The house pulls the NFT in with transferFrom and holds it in escrow; the auction is created with no bids and its timer stoppe"},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Bid","anchor":"bid","text":"A bidder calls createBid and sends ETH as the bid (msg.value). The rules: - The first bid must be at least the reserve, and it starts the timer: the end time becomes firstBidTime + duration - Every later bid must beat the current high bid by at least MIN BID INCREMENT BPS (5%), with a 1-wei floor - "},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Extend (anti-snipe)","anchor":"extend-anti-snipe","text":"If a bid lands inside the last TIME BUFFER (15 minutes) before the end time, the house pushes the end time out to block.timestamp + TIME BUFFER. This guarantees every bidder at least 15 minutes to respond to a late bid, so an auction cannot be won by sniping the final block. The extending bid emits "},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"End (settle)","anchor":"end-settle","text":"Once block.timestamp reaches the end time and the auction has at least one bid, anyone can call endAuction. The house: 1. transfers the NFT to the winning bidder 2. takes the protocol fee (protocolFeeBps of the winning bid) for feeRecipient 3. sends the remaining proceeds to the seller An auction th"},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Cancel","anchor":"cancel","text":"Before the first bid, the seller can cancelAuction to pull the escrowed NFT back out. Once a bid has landed the auction is a live commitment to its bidders and can no longer be cancelled (AuctionAlreadyStarted). The house owner can cancel many pre-bid auctions at once with bulkCancelAuctions."},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"Fee and refund math","anchor":"fee-and-refund-math","text":"At settlement, the winning bid is split: The protocol fee is fixed at init and capped at 5% (500 bps). With protocolFeeBps of 0, the seller receives the full winning bid. Read the current fee with protocolFeeBps and the recipient with feeRecipient. Every ETH payout (outbid refund, seller proceeds, p"},{"path":"/docs/auctions/concepts/auction-lifecycle","page":"Auction lifecycle","heading":"The auction record","anchor":"the-auction-record","text":"Read an auction's full state at any point with auctions(auctionId): the token, firstBidTime (0 before any bid), current high amount, reservePrice, seller tokenOwner, endTime (0 until the first bid), current high bidder, and duration. Resolve a token to its auction with getAuctionFor or hasAuctionFor"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"SovereignAuctionHouse","anchor":"","text":"Implementation 0xC70D8a99b915BeDA52C5A952E29FFE152CbfCB34 · view on evm.now · Ethereum mainnet Deployed per owner as an EIP-1167 clone of the implementation above through the factory. A house has no canonical address of its own; substitute your house address for <AUCTION HOUSE ADDRESS in the example"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Concepts","anchor":"concepts","text":"An English auction here runs entirely onchain, in ETH, with a small fixed rule set: - Reserve: the first bid must be at least the auction's reservePrice, else BidBelowReserve. The seller can adjust the reserve with setAuctionReservePrice, but only before the first bid lands - Minimum increment: ever"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Live reads","anchor":"live-reads","text":"`bash"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"The minimum next bid in wei for an auction (exists flag + amount)","anchor":"","text":"cast call <AUCTION HOUSE ADDRESS \"getMinBidAmount(uint256)(bool,uint256)\" 0 \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"The protocol fee in bps (e.g. 250 = 2.5%)","anchor":"","text":"cast call <AUCTION HOUSE ADDRESS \"protocolFeeBps()(uint16)\" \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"The fixed minimum bid increment in bps (500 = 5%)","anchor":"","text":"cast call <AUCTION HOUSE ADDRESS \"MIN BID INCREMENT BPS()(uint16)\" \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Whether a token is currently in auction on this house","anchor":"","text":"cast call <AUCTION HOUSE ADDRESS \"hasAuctionFor(address,uint256)(bool)\" \\ <TOKEN CONTRACT 42 \\ --rpc-url https://ethereum-rpc.publicnode.com Each house is a per-owner clone with no single fixed address, so the examples use an <AUCTION HOUSE ADDRESS ` placeholder; the address lands when the owner dep"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"createAuction","anchor":"createauction","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Registers one auction and escrows its NFT into the house. The caller must be the house owner, and must also own or be approved for the token: the house checks ownerOf, getApproved, and isApprovedForAll and reverts Not token owner or app"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"bulkCreateAuctions","anchor":"bulkcreateauctions","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Registers many auctions for the same token contract in one transaction, applying the same reservePrice and duration to each. It runs the exact same per-token checks and escrow as createAuction for every id, and reverts the whole batch i"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"createBid","anchor":"createbid","text":"Access: permissionless (payable; any caller may bid, guarded by reserve, increment, and timer checks) Places a bid on an auction, where the bid amount is the ETH sent (msg.value). The value must be greater than zero (BidMustBePositive). If the auction has already started, it must not be past its end"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"setAuctionReservePrice","anchor":"setauctionreserveprice","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts Not token owner) Updates an auction's reserve price. Only the seller who created the auction may call it, and only before the first bid lands (AuctionAlreadyStarted afterward). Reverts AuctionDoesNotExist for an "},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"cancelAuction","anchor":"cancelauction","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts Not token owner) Cancels a pending auction and returns the escrowed NFT to the seller. Only valid before the first bid (AuctionAlreadyStarted once a bid has landed), since a started auction cannot be modified onc"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"bulkCancelAuctions","anchor":"bulkcancelauctions","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Cancels multiple pending auctions in one transaction. This is gated on the house owner rather than each auction's seller, so it can cancel an auction the owner listed on behalf of another holder via ERC721 approval; the NFT always retur"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"endAuction","anchor":"endauction","text":"Access: permissionless (any caller may settle an ended auction) Settles a finished auction. Anyone can call it once the timer has run out. The auction must have had at least one bid (AuctionHasNoBids) and must be past its end time (AuctionNotEnded). The house transfers the NFT to the winning bidder "},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"withdrawRefund","anchor":"withdrawrefund","text":"Access: permissionless (any caller drains only their own credited balance) Claims the ETH credited to the caller in pendingRefunds, from an outbid refund or a settlement payout that could not be pushed. Reverts No refund available when the caller has a zero balance. Zeroes the balance before transfe"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"recoverStuckERC721","anchor":"recoverstuckerc721","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Rescues an ERC721 that landed on the house outside the auction flow, for example a holder who did a plain transferFrom directly to the house address. Reverts to required for a zero destination, and AuctionAlreadyExistsForToken if the to"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization) Sets up the clone exactly once with its owner, feeRecipient, and protocolFeeBps. Reverts owner required for a zero owner, fee above cap for a fee over 500 bps (5%), and fee recipient required when fee 0 when a non-zero fee has no re"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"receive","anchor":"receive","text":"Access: permissionless (payable, but always reverts) Rejects any direct ETH transfer with \"Direct ETH not accepted\". Bids must go through createBid, which ties the payment to a specific auction; a bare transfer has no auction to credit. Forced ETH (selfdestruct, coinbase) is outside the contract's c"},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"auctions","anchor":"auctions","text":"The full stored state of an auction by id: tokenId, tokenContract, firstBidTime (0 before any bid), current high amount, reservePrice, seller tokenOwner, endTime (0 until the first bid), current high bidder, and duration in seconds. A zero tokenOwner means no auction exists at that id."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"feeRecipient","anchor":"feerecipient","text":"The address that receives the protocol fee at settlement, fixed at init. It is the zero address only when protocolFeeBps is zero."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"getAuctionFor","anchor":"getauctionfor","text":"Resolves a (tokenContract, tokenId) to its live auction: returns an exists flag and the auctionId. The tuple shape disambiguates \"no auction\" from \"auction id 0\", which are otherwise indistinguishable."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"getMinBidAmount","anchor":"getminbidamount","text":"The minimum next bid in wei for an auction, paired with an exists flag so a caller can tell \"no auction\" apart from \"minimum is zero\". Mirrors exactly what createBid enforces: the reserve for the first bid, else the current high bid plus the MIN BID INCREMENT BPS increment with the 1-wei floor."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"hasAuctionFor","anchor":"hasauctionfor","text":"A cheap boolean check for whether a token is currently in an auction on this house, when the auctionId itself is not needed."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"MIN_BID_INCREMENT_BPS","anchor":"minbidincrementbps","text":"The minimum increment a later bid must add over the current high bid, as a compile-time constant: 500 bps (5%). Not owner-set. A 1-wei floor applies when the bps math on a tiny bid rounds to zero."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"nextAuctionId","anchor":"nextauctionid","text":"The auction id that the next createAuction call will assign. Useful for clients that want to pre-compute the id before broadcasting the transaction."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"owner","anchor":"owner","text":"The house owner, fixed at init: the address that creates and cancels auctions and can recover stuck NFTs. Ownership is locked, so this value never changes."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"pendingRefunds","anchor":"pendingrefunds","text":"The pull-payment balance in wei currently owed to an address, from an outbid refund or a settlement payout whose push failed. Claimable with withdrawRefund."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"protocolFeeBps","anchor":"protocolfeebps","text":"The protocol fee in basis points taken from each winning bid at settlement, fixed at init and capped at 500 (5%)."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"renounceOwnership","anchor":"renounceownership","text":"Disabled: this function is pure and always reverts OwnershipLocked. Renouncing would set the owner to zero and disable every owner-only function, so it is permanently disabled alongside transferOwnership."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"TIME_BUFFER","anchor":"timebuffer","text":"The anti-snipe window as a compile-time constant: 15 minutes. A bid inside the last TIME BUFFER before the end time pushes the end time out to block.timestamp + TIME BUFFER."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"transferOwnership","anchor":"transferownership","text":"Disabled: this function is pure and always reverts OwnershipLocked. Ownership is fixed at init so the house can never be reassigned away from its original owner, which keeps the factory's owner-to-house map stable and keeps a house bound to the NFTs it escrows."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Events","anchor":"events","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionBid","anchor":"auctionbid","text":"Emitted on every bid. Indexed by auctionId and bidder, and carries the bid amount, a firstBid flag for the bid that starts the timer, and an extended flag for a bid inside TIME BUFFER that pushed the end time out."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionCanceled","anchor":"auctioncanceled","text":"Emitted when a pending auction is cancelled and its NFT returned to the seller. Indexed by auctionId."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionCreated","anchor":"auctioncreated","text":"Emitted when an auction is registered and its NFT escrowed. Indexed by auctionId, tokenId, and tokenContract, and carries the duration, reservePrice, and seller tokenOwner. This is the event an indexer reads to record a new listing."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionEnded","anchor":"auctionended","text":"Emitted when an auction settles. Indexed by auctionId, and carries the seller tokenOwner, the winner, the sellerProceeds, and the protocolFee, so an indexer can recover the full payout breakdown without re-running the fee math."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionEndTimeUpdated","anchor":"auctionendtimeupdated","text":"Emitted when a late bid pushed the auction end time out. Indexed by auctionId, with the newEndTime. Fires alongside the AuctionBid whose extended flag is set."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"AuctionReservePriceUpdated","anchor":"auctionreservepriceupdated","text":"Emitted when the seller updates the reserve before the first bid lands. Indexed by auctionId, with the new reservePrice."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Initialized","anchor":"initialized","text":"Standard OpenZeppelin Initializable event, emitted once when the clone is initialized."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"OwnershipTransferred","anchor":"ownershiptransferred","text":"Standard OpenZeppelin Ownable event, emitted once at init when the house's owner is set from the zero address. Ownership is locked afterward, so it never fires again. Indexed by previousOwner and newOwner."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"RefundCredited","anchor":"refundcredited","text":"Emitted when an ETH push fails and the amount is credited to a withdrawable pendingRefunds balance instead. Indexed by to, with the credited amount. Applies to outbid refunds, seller proceeds, and the protocol fee."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"RefundWithdrawn","anchor":"refundwithdrawn","text":"Emitted when a recipient claims their credited refund with withdrawRefund. Indexed by to, with the amount paid out."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"StuckERC721Recovered","anchor":"stuckerc721recovered","text":"Emitted when the house owner recovers a misdirected ERC721 that landed on the house outside the auction flow. Indexed by tokenContract and tokenId, with the to destination."},{"path":"/docs/auctions/contracts/sovereign-auction-house","page":"SovereignAuctionHouse","heading":"Errors","anchor":"errors","text":"AuctionAlreadyExistsForToken() A second auction was attempted for a (tokenContract, tokenId) that already has a live one on this house, or recoverStuckERC721 targeted a token that is currently in an auction. Cancel or settle the first to free the slot. AuctionAlreadyStarted() An action that requires"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"SovereignAuctionHouseFactory","anchor":"","text":"0xaE712abcA452901A74D1FBC0c3919F2cc060EF9f · view on evm.now · Ethereum mainnet Superseded by SovereignAuctionHouseV2Factory. Existing V1 houses keep working and stay indexed; new houses deploy from the V2 factory. SovereignAuctionHouseFactory deploys one SovereignAuctionHouse per owner as an immuta"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Clone-and-initialize is one transaction","anchor":"clone-and-initialize-is-one-transaction","text":"createAuctionHouse clones implementation with OpenZeppelin Clones.cloneDeterministic and calls initialize on the fresh clone in the same call, wiring in the caller as owner and the factory's defaultFeeRecipient and defaultProtocolFeeBps. The house comes into existence already owned and fee-configure"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"One house per owner, at a predictable address","anchor":"one-house-per-owner-at-a-predictable-address","text":"The clone salt is the owner address, so each address can have exactly one house from this factory (House already exists on a repeat call), and the house's address is deterministic from the owner alone. predictHouseAddress returns that address whether or not the house has been deployed yet, so a clie"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"createAuctionHouse","anchor":"createauctionhouse","text":"Access: permissionless (anyone may deploy; the new house is owned by msg.sender) Deploys an EIP-1167 clone of implementation owned by the caller and initializes it atomically with the factory's defaultFeeRecipient and defaultProtocolFeeBps. The clone salt is the caller address, so each address gets "},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"allHouses","anchor":"allhouses","text":"Every auction house address the factory has deployed, in creation order. Indexers typically watch AuctionHouseCreated rather than paging this array, but it is available for direct onchain enumeration."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"defaultFeeRecipient","anchor":"defaultfeerecipient","text":"The fee recipient wired into every house this factory deploys, fixed at construction. It is the zero address only when defaultProtocolFeeBps is zero."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"defaultProtocolFeeBps","anchor":"defaultprotocolfeebps","text":"The protocol fee in basis points set on every house this factory deploys, fixed at construction and capped at 500 (5%)."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"houseOf","anchor":"houseof","text":"The auction house address deployed for a given owner, or the zero address if that owner has never created one. Each owner can have at most one house from this factory."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"implementation","anchor":"implementation","text":"The SovereignAuctionHouse implementation address every clone points at via DELEGATECALL. Fixed at factory construction; there is no setter, so every house this factory has ever created or will create shares the exact same core logic."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"isHouse","anchor":"ishouse","text":"Whether an address is an auction house this factory deployed. Cheaper than scanning allHouses when a caller only needs a membership check."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"predictHouseAddress","anchor":"predicthouseaddress","text":"The address the auction house for a given owner will be deployed at (or already is). The salt is the owner address, the same input createAuctionHouse uses, so the result is deterministic regardless of whether the house has been deployed yet. ETH or NFTs sent to the predicted address before the house"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"totalHouses","anchor":"totalhouses","text":"The length of allHouses: the total number of auction houses this factory has deployed."},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Events","anchor":"events","text":""},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"AuctionHouseCreated","anchor":"auctionhousecreated","text":"Emitted once per successful createAuctionHouse call, with owner and house both indexed, and carrying the immutable feeRecipient and protocolFeeBps so an indexer can recover a house's fee terms without an extra read. This is the single event an indexer needs to discover every house this factory has p"},{"path":"/docs/auctions/contracts/auction-house-factory","page":"SovereignAuctionHouseFactory","heading":"Errors","anchor":"errors","text":"FailedDeployment() Inherited from OpenZeppelin Clones. The EIP-1167 clone deployment failed at the CREATE2 opcode level, for example if a house for this owner already exists at the deterministic address. Not expected in normal operation against a valid implementation. InsufficientBalance(uint256 bal"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"SovereignAuctionHouseV2","anchor":"","text":"Implementation 0x88b48793f38EF7370F2e7BC12E2f73DC565C117F · view on evm.now · Ethereum mainnet Deployed per owner as an EIP-1167 clone of the implementation above through the V2 factory. A house has no canonical address of its own; substitute your house address for <AUCTION HOUSE V2 ADDRESS in the e"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Escrow-and-wait settlement","anchor":"escrow-and-wait-settlement","text":"endAuction is permissionless, like V1, but its delivery step is now conditional. It calls a gas-capped internal self-call (deliverERC721 or deliverERC1155, DELIVER GAS LIMIT gas) wrapped in a try/catch, so the outcome cannot depend on how much gas the external caller supplied and a reverting recipie"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Claiming a deferred lot","anchor":"claiming-a-deferred-lot","text":"Once an auction is pendingDelivery, anyone can call claimLot(auctionId, to) with to set to the zero address to retry delivery to the recorded winner. Only the winner may redirect delivery elsewhere by passing a nonzero to. claimLot runs the transfer with full gas and no try/catch, so a revert rolls "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"The 30-day timeout and unwinding","anchor":"the-30-day-timeout-and-unwinding","text":"A lot still pendingDelivery PENDING DELIVERY TIMEOUT (30 days) after deliveryDeferredAt becomes eligible for unwindStuckLot, callable by anyone. It first retries delivery to the winner exactly as endAuction did, because a delivery failure can be temporary. If that retry succeeds, the sale finalizes "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Refunds always reach the recipient eventually","anchor":"refunds-always-reach-the-recipient-eventually","text":"Every ETH payout in this contract (an outbid refund, the seller's proceeds, the protocol fee, or an unwound sale's refund) either lands directly or is credited to pendingRefunds for a later pull withdrawal. An outbid refund is pushed with a 30,000 gas stipend and credited on failure. A settlement pa"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"ERC1155 lots","anchor":"erc1155-lots","text":"create1155Auction lists one indivisible quantity of an ERC1155 id. Unlike ERC721, ERC1155 has no per-token ownerOf or getApproved, so only the house owner's own held balance can be listed: the caller must hold at least quantity and have approved the house with isApprovedForAll. There is no consignme"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Listing expiry","anchor":"listing-expiry","text":"Every createAuction and create1155Auction call takes a listingExpiry . Zero means the listing stays open until its owner cancels it. A nonzero value must be strictly in the future and closes the listing automatically if no bid ever lands: createBid checks it only while the auction is still pre-bid, "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Live reads","anchor":"live-reads","text":"`bash"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Which auction-house version this house is (2 for V2; V1 has no such function)","anchor":"","text":"cast call <AUCTION HOUSE V2 ADDRESS \"auctionVersion()(uint8)\" \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"The full stored auction record","anchor":"","text":"cast call <AUCTION HOUSE V2 ADDRESS \"getAuction(uint256)((uint256,address,uint64,uint256,uint256,address,address,uint64,address,uint64,uint256,uint8))\" 0 \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Whether a lot is waiting on a deferred delivery","anchor":"","text":"cast call <AUCTION HOUSE V2 ADDRESS \"pendingDelivery(uint256)(bool)\" 0 \\ --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"The protocol fee in bps","anchor":"","text":"cast call <AUCTION HOUSE V2 ADDRESS \"protocolFeeBps()(uint16)\" \\ --rpc-url https://ethereum-rpc.publicnode.com Each house is a per-owner clone with no single fixed address, so the examples use an <AUCTION HOUSE V2 ADDRESS ` placeholder; the address lands when the owner deploys their house through th"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"createAuction","anchor":"createauction","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Registers one ERC721 auction and escrows its token into the house. The house owner may list a third party's token by consignment: tokenOwner is read from the token itself with ownerOf, and the caller must be that owner or approved for t"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"bulkCreateAuctions","anchor":"bulkcreateauctions","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Registers many ERC721 auctions for the same token contract in one transaction, applying the same reservePrice, duration, and listingExpiry to each. It runs the exact same per-token checks and escrow as createAuction for every id, and re"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"create1155Auction","anchor":"create1155auction","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Registers one indivisible ERC1155 lot of quantity units of tokenId. Only the house owner's own held balance may be listed, there is no consignment path here: the caller must hold at least quantity (\"insufficient balance\") and have calle"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"setAuctionReservePrice","anchor":"setauctionreserveprice","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts \"Not token owner\") Updates an auction's reserve price. Only the seller who created the auction may call it, and only before the first bid lands (AuctionAlreadyStarted afterward). Works the same for an ERC721 or E"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"setAuctionDuration","anchor":"setauctionduration","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts \"Not token owner\") Updates an auction's duration before bidding starts. Only the seller may call it, and only before the first bid lands (AuctionAlreadyStarted afterward). The new value is validated the same way "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"setAuctionFundsRecipient","anchor":"setauctionfundsrecipient","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts \"Not token owner\") Redirects an auction's sale proceeds to a different address before bidding starts. Only the seller (the recorded tokenOwner) may call it, so a house owner who listed a third party's token by co"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"setAuctionListingExpiry","anchor":"setauctionlistingexpiry","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts \"Not token owner\") Sets or clears an auction's no-bid listing expiry before bidding starts. Only the seller may call it, and only before the first bid lands (AuctionAlreadyStarted afterward). expiry must be zero "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"createBid","anchor":"createbid","text":"Access: permissionless (payable; any caller may bid, guarded by expiry, reserve, increment, and timer checks) Places a bid on an auction, where the bid amount is the ETH sent (msg.value). While the auction is still pre-bid, a nonzero, passed listingExpiry blocks any further bid (AuctionExpired); onc"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"endAuction","anchor":"endauction","text":"Access: permissionless (any caller may attempt settlement of an ended auction) Attempts to settle a finished auction. The auction must have had at least one bid (AuctionHasNoBids), must be past its end time (AuctionNotEnded), and must not already be pendingDelivery or pendingReturn (AuctionAlreadySe"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"deliverERC721","anchor":"delivererc721","text":"Access: self-only (msg.sender must be this contract, else OnlySelf) The delivery target endAuction and unwindStuckLot call through a gas-capped try/catch self-call when the lot is an ERC721. Transfers the token with transferFrom and verifies with ownerOf that it landed at the recipient (DeliveryFail"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"deliverERC1155","anchor":"delivererc1155","text":"Access: self-only (msg.sender must be this contract, else OnlySelf) The delivery target endAuction and unwindStuckLot call through a gas-capped try/catch self-call when the lot is an ERC1155. Transfers with safeTransferFrom and verifies the recipient's balance increased by quantity (DeliveryFailed o"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"claimLot","anchor":"claimlot","text":"Access: permissionless to trigger delivery to the winner; winner-only to redirect (to nonzero from a non-winner reverts NotWinner) Delivers a lot whose delivery was deferred at endAuction. Reverts NoPendingDelivery if the auction is not currently deferred. Passing to == address(0) triggers delivery "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"unwindStuckLot","anchor":"unwindstucklot","text":"Access: permissionless, but only once PENDING DELIVERY TIMEOUT has elapsed since deferral (UnwindTooEarly otherwise) Resolves a lot still pendingDelivery PENDING DELIVERY TIMEOUT (30 days) after deliveryDeferredAt. Reverts NoPendingDelivery if the auction is not currently deferred, and requires enou"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"returnUnwoundLot","anchor":"returnunwoundlot","text":"Access: permissionless (any caller may deliver a lot pending return) Delivers a lot whose return to the seller failed during unwindStuckLot. Reverts NoPendingReturn if the auction has no deferred return. Always delivers to the auction's recorded tokenOwner, never to a caller-supplied address. Runs w"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"cancelAuction","anchor":"cancelauction","text":"Access: seller-only (msg.sender must be the auction's tokenOwner, else the call reverts \"Not token owner\") Cancels a pending auction and returns its escrowed lot to the seller. Valid only before the first bid lands (AuctionAlreadyStarted afterward), since a started auction is a live commitment to it"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"expireAuction","anchor":"expireauction","text":"Access: permissionless (any caller may expire a listing whose expiry has passed) Closes a pre-bid listing once its owner-set listingExpiry has passed, returning the lot to the seller. Reverts AuctionNotEnded if the auction has already received a bid, has no expiry set, or the expiry has not yet pass"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"withdrawRefund","anchor":"withdrawrefund","text":"Access: permissionless (any caller drains only their own credited balance, paid to themselves) Claims the caller's pendingRefunds balance and pays it to the caller. Reverts \"No refund available\" for a zero balance and \"Withdraw failed\" if the ETH transfer fails (the balance is restored by the revert"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"withdrawRefundTo","anchor":"withdrawrefundto","text":"Access: permissionless (any caller drains only their own credited balance, paid to a chosen address) Claims the caller's pendingRefunds balance and pays it to recipient instead of the caller. Reverts FundsRecipientRequired for a zero recipient, \"No refund available\" for a zero balance, and \"Withdraw"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"recoverStuckERC721","anchor":"recoverstuckerc721","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Rescues an ERC721 that landed on the house outside the auction flow, for example a plain transferFrom sent directly to the house address. Reverts \"to required\" for a zero destination, and AuctionAlreadyExistsForToken if the token is cur"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"recoverStuckERC1155","anchor":"recoverstuckerc1155","text":"Access: owner-only (onlyOwner, else OwnableUnauthorizedAccount) Rescues ERC1155 units that landed on the house outside the auction flow. Reverts \"to required\" for a zero destination, and AuctionAlreadyExistsForToken if the token id is currently registered to a live auction. Transfers quantity units "},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"initialize","anchor":"initialize","text":"Access: deployer one-shot (initializer, else InvalidInitialization) Sets up the clone exactly once with its owner, feeRecipient, and protocolFeeBps. Reverts \"owner required\" for a zero owner, \"fee above cap\" for a fee over 500 bps (5%), and \"fee recipient required when fee 0\" when a non-zero fee has"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"receive","anchor":"receive","text":"Access: permissionless (payable, but always reverts) Rejects any direct ETH transfer with \"Direct ETH not accepted\". Bids must go through createBid, which ties the payment to a specific auction; a bare transfer has no auction to credit. Forced ETH (selfdestruct, coinbase) is outside the contract's c"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"auctions","anchor":"auctions","text":"The full stored state of an auction by id: tokenId, tokenContract, firstBidTime (0 before any bid), current high amount, reservePrice, seller tokenOwner, fundsRecipient, endTime (0 until the first bid), current high bidder, duration in seconds, quantity (1 for an ERC721 lot), and standard (0 for ERC"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"auctionVersion","anchor":"auctionversion","text":"Always returns 2. Lets a caller or indexer tell a V2 house apart from a V1 house, which has no such function, without needing to inspect bytecode."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"deliveryDeferredAt","anchor":"deliverydeferredat","text":"The timestamp an auction entered pendingDelivery, set by endAuction's deferral branch. unwindStuckLot reads this to enforce PENDING DELIVERY TIMEOUT."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"feeRecipient","anchor":"feerecipient","text":"The address that receives the protocol fee at settlement, fixed at init. It is the zero address only when protocolFeeBps is zero."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"getAuction","anchor":"getauction","text":"Returns the same data as auctions(auctionId), decoded as one Auction struct instead of a flat tuple, for callers that want a single decode."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"getAuctionFor","anchor":"getauctionfor","text":"Resolves a (tokenContract, tokenId) to its live auction: returns an exists flag and the auctionId. Still resolves to exists = true while the auction is pendingDelivery or pendingReturn, since the token's index entry is only cleared once claimLot, unwindStuckLot, or returnUnwoundLot fully resolves th"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"listingExpiry","anchor":"listingexpiry","text":"The stored no-bid listing expiry for an auction, in Unix seconds. Zero means no expiry. Checked by createBid only while the auction is still pre-bid, and by expireAuction."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"MAX_DURATION","anchor":"maxduration","text":"The upper bound on duration, as a compile-time constant: 100 years. Enforced on createAuction, bulkCreateAuctions, create1155Auction, and setAuctionDuration."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"MIN_BID_INCREMENT_BPS","anchor":"minbidincrementbps","text":"The minimum increment a later bid must add over the current high bid, as a compile-time constant: 500 bps (5%). Not owner-set."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"nextAuctionId","anchor":"nextauctionid","text":"The auction id that the next createAuction, bulkCreateAuctions, or create1155Auction call will assign."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"onERC1155BatchReceived","anchor":"onerc1155batchreceived","text":"The ERC1155 batch-transfer receiver hook. Always reverts EscrowFailed: batch deposits into the house are not supported."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"onERC1155Received","anchor":"onerc1155received","text":"The ERC1155 single-transfer receiver hook. Reverts EscrowFailed unless the incoming transfer's token contract, id, and value exactly match the pull create1155Auction currently has in progress, so an unrelated ERC1155 transfer sent to the house cannot be mistaken for an auction deposit."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"owner","anchor":"owner","text":"The house owner, fixed at init: the address that creates and cancels auctions and can recover stuck tokens. Ownership is locked, so this value never changes."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"PENDING_DELIVERY_TIMEOUT","anchor":"pendingdeliverytimeout","text":"How long a lot must stay pendingDelivery before unwindStuckLot may act on it, as a compile-time constant: 30 days."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"pendingDelivery","anchor":"pendingdelivery","text":"True for an auction whose delivery attempt at endAuction failed. Neither the seller nor the protocol fee has been paid. Cleared by claimLot on successful delivery, or by unwindStuckLot once the timeout has passed."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"pendingRefunds","anchor":"pendingrefunds","text":"The pull-payment balance in wei currently owed to an address: from an outbid refund, a settlement payout to a contract-code recipient, or an unwound sale's refund to the winner. Claimable with withdrawRefund or withdrawRefundTo."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"pendingReturn","anchor":"pendingreturn","text":"True for an auction that unwindStuckLot unwound but whose lot return to the seller also failed. The winner's bid is already credited to pendingRefunds by this point. Cleared by returnUnwoundLot."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"protocolFeeBps","anchor":"protocolfeebps","text":"The protocol fee in basis points taken from each winning bid at settlement, fixed at init and capped at 500 (5%)."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"renounceOwnership","anchor":"renounceownership","text":"Disabled: this function is pure and always reverts OwnershipLocked. Renouncing would set the owner to zero and disable every owner-only function, so it is permanently disabled alongside transferOwnership."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"supportsInterface","anchor":"supportsinterface","text":"ERC165 introspection. Returns true for the IERC1155Receiver and IERC165 interface ids, and false for anything else, including the ERC721 receiver interface: ERC721 lots move by plain transferFrom, so the house never needs to accept a safeTransferFrom."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"TIME_BUFFER","anchor":"timebuffer","text":"The anti-snipe window as a compile-time constant: 15 minutes. A bid inside the last TIME BUFFER before the end time pushes the end time out to block.timestamp + TIME BUFFER."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"transferOwnership","anchor":"transferownership","text":"Disabled: this function is pure and always reverts OwnershipLocked. Ownership is fixed at init so the house can never be reassigned away from its original owner."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Events","anchor":"events","text":""},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Auction1155Created","anchor":"auction1155created","text":"Emitted when an ERC1155 auction is registered and its lot escrowed. Indexed by auctionId, tokenId, and tokenContract, and carries quantity, duration, reservePrice, the seller tokenOwner, the initial fundsRecipient, and listingExpiry."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionBid","anchor":"auctionbid","text":"Emitted on every bid. Indexed by auctionId and bidder, and carries the bid amount, a firstBid flag for the bid that starts the timer, and an extended flag for a bid inside TIME BUFFER that pushed the end time out."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionCanceled","anchor":"auctioncanceled","text":"Emitted when a pending auction is cancelled by its seller with cancelAuction, or expired by anyone with expireAuction, and its lot returned to the seller. Indexed by auctionId."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionCreated","anchor":"auctioncreated","text":"Emitted when an ERC721 auction is registered and its token escrowed. Indexed by auctionId, tokenId, and tokenContract, and carries duration, reservePrice, the seller tokenOwner, the initial fundsRecipient, and listingExpiry."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionDurationUpdated","anchor":"auctiondurationupdated","text":"Emitted when the seller updates the duration before the first bid lands. Indexed by auctionId, with the new duration."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionEnded","anchor":"auctionended","text":"Emitted when an auction finalizes, whether directly from endAuction, claimLot, or the retry-succeeds path of unwindStuckLot. Indexed by auctionId, and carries the seller tokenOwner, the winner, the sellerProceeds, and the protocolFee."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionEndTimeUpdated","anchor":"auctionendtimeupdated","text":"Emitted when a late bid pushed the auction end time out. Indexed by auctionId, with the newEndTime. Fires alongside the AuctionBid whose extended flag is set."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionFundsRecipientUpdated","anchor":"auctionfundsrecipientupdated","text":"Emitted when the seller redirects the sale proceeds before the first bid lands. Indexed by auctionId, with the new fundsRecipient."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionListingExpiryUpdated","anchor":"auctionlistingexpiryupdated","text":"Emitted when the seller sets or clears the no-bid listing expiry before the first bid lands. Indexed by auctionId, with the new listingExpiry."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"AuctionReservePriceUpdated","anchor":"auctionreservepriceupdated","text":"Emitted when the seller updates the reserve before the first bid lands. Indexed by auctionId, with the new reservePrice."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"DeliveryDeferred","anchor":"deliverydeferred","text":"Emitted when endAuction's delivery attempt fails and the lot is deferred. Indexed by auctionId and winner. Neither the seller nor the protocol fee has been paid at this point; the lot is retryable through claimLot."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Initialized","anchor":"initialized","text":"Standard OpenZeppelin Initializable event, emitted once when the clone is initialized."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"LotClaimed","anchor":"lotclaimed","text":"Emitted when claimLot or the retry path of unwindStuckLot delivers a previously deferred lot. Indexed by auctionId and winner, and carries the actual delivery recipient, which can differ from winner when the winner redirected delivery through claimLot."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"LotReturnDeferred","anchor":"lotreturndeferred","text":"Emitted alongside LotUnwound when the attempt to return the lot to tokenOwner fails. Indexed by auctionId and tokenOwner. The lot stays locked until returnUnwoundLot succeeds."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"LotReturned","anchor":"lotreturned","text":"Emitted when returnUnwoundLot delivers a previously deferred return to tokenOwner. Indexed by auctionId and tokenOwner."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"LotUnwound","anchor":"lotunwound","text":"Emitted when unwindStuckLot's retry to the winner still fails after PENDING DELIVERY TIMEOUT and the sale unwinds. Indexed by auctionId and winner, and carries refundAmount (the winner's full bid, already credited to pendingRefunds) and the seller tokenOwner. Fires whether or not the lot's return to"},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"OwnershipTransferred","anchor":"ownershiptransferred","text":"Standard OpenZeppelin Ownable event, emitted once at init when the house's owner is set from the zero address. Ownership is locked afterward, so it never fires again. Indexed by previousOwner and newOwner."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"RefundCredited","anchor":"refundcredited","text":"Emitted when an ETH amount is credited to a withdrawable pendingRefunds balance instead of being pushed. Indexed by to, with the credited amount. Applies to outbid refunds, settlement payouts to contract-code recipients, and unwound-sale refunds."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"RefundWithdrawn","anchor":"refundwithdrawn","text":"Emitted when withdrawRefund or withdrawRefundTo pays out a credited balance. Indexed by account (whose balance was drained) and recipient (who received the ETH); the two differ only for withdrawRefundTo. Carries the amount paid out."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"StuckERC1155Recovered","anchor":"stuckerc1155recovered","text":"Emitted when the house owner recovers misdirected ERC1155 units with recoverStuckERC1155. Indexed by tokenContract and tokenId, and carries the quantity and the to destination."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"StuckERC721Recovered","anchor":"stuckerc721recovered","text":"Emitted when the house owner recovers a misdirected ERC721 with recoverStuckERC721. Indexed by tokenContract and tokenId, with the to destination."},{"path":"/docs/auctions/contracts/sovereign-auction-house-v2","page":"SovereignAuctionHouseV2","heading":"Errors","anchor":"errors","text":"AuctionAlreadyExistsForToken() A second auction was attempted for a (tokenContract, tokenId) that already has a live one on this house, or a recovery function targeted a token that is currently registered to an auction. Resolve or clear the first before retrying. AuctionAlreadySettled() endAuction w"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"SovereignAuctionHouseV2Factory","anchor":"","text":"0x77aB853543286C9Cdd7dd6c01222A7cC4Ac93d63 · view on evm.now · Ethereum mainnet SovereignAuctionHouseV2Factory deploys one SovereignAuctionHouseV2 per owner as an immutable EIP-1167 clone of a fixed implementation: no proxy admin, no upgrade path, what deploys is what runs. createAuctionHouse is per"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Clone-and-initialize is one transaction","anchor":"clone-and-initialize-is-one-transaction","text":"createAuctionHouse clones implementation with OpenZeppelin Clones.cloneDeterministic and calls initialize on the fresh clone in the same call, wiring in the caller as owner and the factory's defaultFeeRecipient and defaultProtocolFeeBps. The house comes into existence already owned and fee-configure"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"One house per owner, at a predictable address","anchor":"one-house-per-owner-at-a-predictable-address","text":"The clone salt is the owner address, so each address can have exactly one house from this factory (\"House already exists\" on a repeat call), and the house's address is deterministic from the owner alone. predictHouseAddress returns that address whether or not the house has been deployed yet, so a cl"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"createAuctionHouse","anchor":"createauctionhouse","text":"Access: permissionless (anyone may deploy; the new house is owned by msg.sender) Deploys an EIP-1167 clone of implementation owned by the caller and initializes it atomically with the factory's defaultFeeRecipient and defaultProtocolFeeBps. The clone salt is the caller address, so each address gets "},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"allHouses","anchor":"allhouses","text":"Every V2 auction house address this factory has deployed, in creation order. Indexers typically watch AuctionHouseCreated rather than paging this array, but it is available for direct onchain enumeration."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"defaultFeeRecipient","anchor":"defaultfeerecipient","text":"The fee recipient wired into every house this factory deploys, fixed at construction. It is the zero address only when defaultProtocolFeeBps is zero."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"defaultProtocolFeeBps","anchor":"defaultprotocolfeebps","text":"The protocol fee in basis points set on every house this factory deploys, fixed at construction and capped at 500 (5%)."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"houseOf","anchor":"houseof","text":"The V2 auction house address deployed for a given owner, or the zero address if that owner has never created one from this factory. Each owner can have at most one house from this factory."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"implementation","anchor":"implementation","text":"The SovereignAuctionHouseV2 implementation address every clone points at via DELEGATECALL. Fixed at factory construction; there is no setter, so every house this factory has ever created or will create shares the exact same core logic."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"isHouse","anchor":"ishouse","text":"Whether an address is a V2 auction house this factory deployed. Cheaper than scanning allHouses when a caller only needs a membership check."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"predictHouseAddress","anchor":"predicthouseaddress","text":"The address the V2 auction house for a given owner will be deployed at (or already is). The salt is the owner address, the same input createAuctionHouse uses, so the result is deterministic regardless of whether the house has been deployed yet. ETH or NFTs sent to the predicted address before the ho"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"totalHouses","anchor":"totalhouses","text":"The length of allHouses: the total number of V2 auction houses this factory has deployed."},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Events","anchor":"events","text":""},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"AuctionHouseCreated","anchor":"auctionhousecreated","text":"Emitted once per successful createAuctionHouse call, with owner and house both indexed, and carrying the immutable feeRecipient and protocolFeeBps so an indexer can recover a house's fee terms without an extra read. This is the single event an indexer needs to discover every V2 house this factory ha"},{"path":"/docs/auctions/contracts/auction-house-v2-factory","page":"SovereignAuctionHouseV2Factory","heading":"Errors","anchor":"errors","text":"FailedDeployment() Inherited from OpenZeppelin Clones. The EIP-1167 clone deployment failed at the CREATE2 opcode level, for example if a house for this owner already exists at the deterministic address. Not expected in normal operation against a valid implementation. InsufficientBalance(uint256 bal"},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"Deploy an auction house","anchor":"","text":"An auction house is deployed per owner. You get your own house by calling createAuctionHouse on the shared SovereignAuctionHouseFactory. The new house is owned by you (the caller), initialized with the factory's default fee terms, and deployed at an address predictable from your address alone."},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"One house per owner","anchor":"one-house-per-owner","text":"Each address can have exactly one house from this factory. A second createAuctionHouse call from the same address reverts House already exists. Check whether you already have one with houseOf: A zero address means you have not deployed one yet."},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"Predict the address first","anchor":"predict-the-address-first","text":"The house address is deterministic from the owner address, so you can show or use it before the deploy transaction lands: Do not send ETH or NFTs to the predicted address before the house exists: funds sent there pre-deploy are not recoverable. Deploy the house first, then interact with it."},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"The init defaults","anchor":"the-init-defaults","text":"Every house this factory deploys is initialized with the factory's own fee terms, which are fixed at the factory's construction and shared across all its houses: - defaultFeeRecipient: the address that receives the protocol fee at settlement - defaultProtocolFeeBps: the protocol fee in basis points,"},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"Deploy with cast","anchor":"deploy-with-cast","text":"The call returns your house address and emits AuctionHouseCreated with your address and the house both indexed."},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"Deploy with viem","anchor":"deploy-with-viem","text":""},{"path":"/docs/auctions/guides/deploy-an-auction-house","page":"Deploy an auction house","heading":"Next","anchor":"next","text":"With a house deployed, list a token with Run an auction, and see how collectors compete and settle in Bid and settle."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Run an auction","anchor":"","text":"This is the seller side of a SovereignAuctionHouse. It assumes you already have your own house from Deploy an auction house. All examples use an <AUCTION HOUSE ADDRESS placeholder, since each house is a per-owner clone with no single fixed address."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Approve the house for the NFT first","anchor":"approve-the-house-for-the-nft-first","text":"Creating an auction pulls the NFT into the house with transferFrom, so the house must be approved to move the token. Approve the specific token, or set the house as an operator for the whole collection. The token contract can be any ERC721, including a PND Surface. `bash"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Approve one token","anchor":"","text":"cast send <TOKEN CONTRACT \"approve(address,uint256)\" \\ <AUCTION HOUSE ADDRESS 42 \\ --rpc-url https://ethereum-rpc.publicnode.com --private-key $PRIVATE KEY"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Or approve the house for all your tokens in this collection","anchor":"","text":"cast send <TOKEN CONTRACT \"setApprovalForAll(address,bool)\" \\ <AUCTION HOUSE ADDRESS true \\ --rpc-url https://ethereum-rpc.publicnode.com --private-key $PRIVATE KEY `"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Create an auction","anchor":"create-an-auction","text":"createAuction takes the token id, its ERC721 contract, a duration in seconds, and a reservePrice in wei. You must own or be approved for the token. duration must be greater than zero and at most 100 years. The call escrows the NFT and returns the new auctionId. `bash"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"3-day auction, 0.5 ETH reserve, for token 42","anchor":"","text":"cast send <AUCTION HOUSE ADDRESS \"createAuction(uint256,address,uint256,uint256)\" \\ 42 <TOKEN CONTRACT 259200 500000000000000000 \\ --rpc-url https://ethereum-rpc.publicnode.com --private-key $PRIVATE KEY The timer does not start now: it starts when the first bid lands, then runs for duration. Read t"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Create many at once","anchor":"create-many-at-once","text":"bulkCreateAuctions lists many tokens from one contract in a single transaction, applying the same reserve and duration to each. It runs the same per-token checks and escrow, and reverts the whole batch if any single token fails (unapproved, duplicate, non-ERC721)."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Adjust the reserve (before the first bid)","anchor":"adjust-the-reserve-before-the-first-bid","text":"The seller can change an auction's reserve with setAuctionReservePrice, but only before the first bid lands. After that it reverts AuctionAlreadyStarted."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Cancel (before the first bid)","anchor":"cancel-before-the-first-bid","text":"Before any bid, the seller can pull the NFT back with cancelAuction. Once a bid has landed the auction is a live commitment and can no longer be cancelled. As the house owner you can cancel many pre-bid auctions at once with bulkCancelAuctions."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"End (settle) after the timer","anchor":"end-settle-after-the-timer","text":"Once the end time passes and the auction has at least one bid, anyone can settle it with endAuction. As the seller you can call it yourself to receive your proceeds without waiting for a bidder or a bot. Settlement transfers the NFT to the winner, pays the protocol fee to feeRecipient, and sends the"},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"viem: create, then end","anchor":"viem-create-then-end","text":""},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Recover a misdirected NFT","anchor":"recover-a-misdirected-nft","text":"If someone sends an NFT to your house with a plain transferFrom outside the auction flow, you can rescue it with recoverStuckERC721. It cannot touch a token that is currently in an active auction."},{"path":"/docs/auctions/guides/run-an-auction","page":"Run an auction","heading":"Next","anchor":"next","text":"See the full path an auction takes in Auction lifecycle, and the bidder side in Bid and settle."},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Bid and settle","anchor":"","text":"This is the bidder side of a SovereignAuctionHouse. All examples use an <AUCTION HOUSE ADDRESS placeholder, since each house is a per-owner clone with no single fixed address."},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Read the minimum first","anchor":"read-the-minimum-first","text":"The bid amount is the ETH you send (msg.value). It must clear the reserve on the first bid, and beat the current high bid by at least 5% (MIN BID INCREMENT BPS) on every later bid, with a 1-wei floor. Read the exact next minimum with getMinBidAmount, which mirrors the contract's own logic. It return"},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Place a bid","anchor":"place-a-bid","text":"createBid is payable: send at least the minimum. If the auction has already started, your bid must land before the end time (AuctionExpired otherwise). A bid below the reserve reverts BidBelowReserve; a bid that does not clear the increment reverts BidBelowMinimum; a zero-value call reverts BidMustB"},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Bid 0.55 ETH on auction 0","anchor":"","text":"cast send <AUCTION HOUSE ADDRESS \"createBid(uint256)\" 0 \\ --value 550000000000000000 \\ --rpc-url https://ethereum-rpc.publicnode.com --private-key $PRIVATE KEY The first bid starts the timer; the auction then runs for its duration`."},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"The anti-snipe extension","anchor":"the-anti-snipe-extension","text":"If your bid lands inside the last 15 minutes (TIME BUFFER) before the end time, the house pushes the end time out to 15 minutes from now. This gives every bidder time to respond, so an auction cannot be won by sniping the final block. Your bid emits AuctionBid with its extended flag set, and an Auct"},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Being outbid and refunds","anchor":"being-outbid-and-refunds","text":"When you are outbid, the house returns your ETH. It first tries to push the refund directly to you. If that push fails (for example your wallet is a contract that reverts on receive), the amount is credited to a pull-payment balance instead and an RefundCredited event fires. Read your balance with p"},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Settle a finished auction","anchor":"settle-a-finished-auction","text":"Once the end time passes and the auction has at least one bid, anyone can settle it with endAuction, including the winner. Settlement transfers the NFT to the winning bidder, takes the protocol fee for the fee recipient, and sends the rest to the seller. Calling it before the timer runs out reverts "},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"viem: read the minimum, then bid","anchor":"viem-read-the-minimum-then-bid","text":""},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"viem: settle and claim a refund","anchor":"viem-settle-and-claim-a-refund","text":""},{"path":"/docs/auctions/guides/bid-and-settle","page":"Bid and settle","heading":"Next","anchor":"next","text":"See the full path an auction takes, with the fee and refund math, in Auction lifecycle, and the seller side in Run an auction."},{"path":"/docs/auctions/reference/access-control","page":"Access control","heading":"Access control","anchor":"","text":"Every state-changing function in the Auctions contracts and who may call it. Generated from the per-contract references; the per-function pages carry the full behavior."},{"path":"/docs/auctions/reference/access-control","page":"Access control","heading":"SovereignAuctionHouse","anchor":"sovereignauctionhouse","text":"Function Access --- --- createAuction owner-only (onlyOwner, else OwnableUnauthorizedAccount) bulkCreateAuctions owner-only (onlyOwner, else OwnableUnauthorizedAccount) createBid permissionless (payable; any caller may bid, guarded by reserve, increment, and timer checks) setAuctionReservePrice sell"},{"path":"/docs/auctions/reference/access-control","page":"Access control","heading":"SovereignAuctionHouseFactory","anchor":"sovereignauctionhousefactory","text":"Function Access --- --- createAuctionHouse permissionless (anyone may deploy; the new house is owned by msg.sender)"},{"path":"/docs/auctions/reference/access-control","page":"Access control","heading":"SovereignAuctionHouseV2","anchor":"sovereignauctionhousev2","text":"Function Access --- --- createAuction owner-only (onlyOwner, else OwnableUnauthorizedAccount) bulkCreateAuctions owner-only (onlyOwner, else OwnableUnauthorizedAccount) create1155Auction owner-only (onlyOwner, else OwnableUnauthorizedAccount) setAuctionReservePrice seller-only (msg.sender must be th"},{"path":"/docs/auctions/reference/access-control","page":"Access control","heading":"SovereignAuctionHouseV2Factory","anchor":"sovereignauctionhousev2factory","text":"Function Access --- --- createAuctionHouse permissionless (anyone may deploy; the new house is owned by msg.sender)"},{"path":"/docs/auctions/reference/errors","page":"Errors index","heading":"Errors index","anchor":"","text":"Every custom error the Auctions contracts can revert with, its contract, and the condition that raises it. AuctionAlreadyExistsForToken · SovereignAuctionHouse\\ A second auction was attempted for a (tokenContract, tokenId) that already has a live one on this house, or recoverStuckERC721 targeted a t"},{"path":"/docs/auctions/reference/events","page":"Events index","heading":"Events index","anchor":"","text":"Every event the Auctions contracts emit, grouped by contract. Signatures and field meanings live on the per-contract pages."},{"path":"/docs/auctions/reference/events","page":"Events index","heading":"SovereignAuctionHouse","anchor":"sovereignauctionhouse","text":"AuctionBid · Emitted on every bid. AuctionCanceled · Emitted when a pending auction is cancelled and its NFT returned to the seller. AuctionCreated · Emitted when an auction is registered and its NFT escrowed. AuctionEnded · Emitted when an auction settles. AuctionEndTimeUpdated · Emitted when a lat"},{"path":"/docs/auctions/reference/events","page":"Events index","heading":"SovereignAuctionHouseFactory","anchor":"sovereignauctionhousefactory","text":"AuctionHouseCreated · Emitted once per successful createAuctionHouse call, with owner and house both indexed, and carrying the immutable feeRecipient and protocolFeeBps so an indexer can recover a house's fee terms without an extra read."},{"path":"/docs/auctions/reference/events","page":"Events index","heading":"SovereignAuctionHouseV2","anchor":"sovereignauctionhousev2","text":"Auction1155Created · Emitted when an ERC1155 auction is registered and its lot escrowed. AuctionBid · Emitted on every bid. AuctionCanceled · Emitted when a pending auction is cancelled by its seller with cancelAuction, or expired by anyone with expireAuction, and its lot returned to the seller. Auc"},{"path":"/docs/auctions/reference/events","page":"Events index","heading":"SovereignAuctionHouseV2Factory","anchor":"sovereignauctionhousev2factory","text":"AuctionHouseCreated · Emitted once per successful createAuctionHouse call, with owner and house both indexed, and carrying the immutable feeRecipient and protocolFeeBps so an indexer can recover a house's fee terms without an extra read."},{"path":"/docs/catalog/overview","page":"Overview","heading":"Overview","anchor":"","text":"Catalog is a general onchain registry where an artist address publishes pointers to its work. It is deployed on Ethereum mainnet and is not specific to the Surface System: any address may register any contract or token. A pointer is one of three types: - a contract address - a token , a (contract, t"},{"path":"/docs/catalog/overview","page":"Overview","heading":"What a catalog entry means","anchor":"what-a-catalog-entry-means","text":"An entry records only that a given address added a given pointer. It does not prove authorship, provenance, ownership, or creator status, and does not check that the referenced contract or token exists or behaves as an NFT. Interpreting pointers, resolving metadata, and reconciling conflicts are the"},{"path":"/docs/catalog/overview","page":"Overview","heading":"Use in the Surface System","anchor":"use-in-the-surface-system","text":"A Surface collection reads isContractRegistered(creator, collection) for the creator half of its two-sided attribution. A collection owner lists a creator with setCreators; that creator claims the collection by calling addContract(collection) on the Catalog from their own address. isConfirmedCreator"},{"path":"/docs/catalog/overview","page":"Overview","heading":"Reference","anchor":"reference","text":"- Catalog: the full contract reference, including the direct and operator write paths, the read and pagination getters, multicall batching, and the events and errors"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Catalog","anchor":"","text":"0x467a9c39e03C595EC3075D856f19C7386b6b915d · view on evm.now · Ethereum mainnet An immutable public registry where an artist address publishes onchain pointers to its work. A pointer is one of three types: a contract address, a single token on a contract, or a contiguous inclusive range of token ids"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Concepts","anchor":"concepts","text":""},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Pointer types","anchor":"pointer-types","text":"Three independent pointer types, each stored in its own per-artist list and keyed separately: - contract : an address (addContract). Any address is accepted, including an EOA; the only check is nonzero - token : a (contract, tokenId) pair (addToken) - token range : a (contract, startTokenId, endToke"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Direct and operator writes","anchor":"direct-and-operator-writes","text":"Every mutation has a direct form that writes the caller's own list (addContract) and a For form that writes a named artist's list (addContractFor(artist, ...)). The For form reverts NotAuthorized unless the caller is the artist or an operator the artist approved with setOperator. An operator cannot "},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Unordered storage","anchor":"unordered-storage","text":"Removal is swap-and-pop: removing an entry that is not last moves the last entry into the freed slot. Order is therefore not stable across writes. A reader needing a fixed order sorts client-side. Existence and removal are O(1) through an internal index map, so an unordered list is not a scan."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Batching with multicall","anchor":"batching-with-multicall","text":"The contract inherits OpenZeppelin Multicall. multicall(bytes[] data) runs several encoded calls in one transaction, each by delegatecall to this contract so msg.sender is preserved and the For authorization check applies inside a batch exactly as outside it. The batch is atomic: the first inner rev"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Per-chain deterministic deployment","anchor":"per-chain-deterministic-deployment","text":"Each Catalog instance is scoped to its deployment chain; pointers reference contracts on that same chain, and there is no chainId field. Deploying at the same address on multiple chains requires the CREATE2 deterministic-deployment proxy plus a matching salt, init code, compiler version, optimizer s"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Live reads","anchor":"live-reads","text":"The Catalog is deployed on Ethereum mainnet, so these run against the real address: `bash"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Every pointer type for an artist in one call","anchor":"","text":"cast call 0x467a9c39e03C595EC3075D856f19C7386b6b915d \\ \"getCatalogOf(address)(address[],(address,uint256)[],(address,uint256,uint256)[])\" \\ <ARTIST ADDRESS --rpc-url https://ethereum-rpc.publicnode.com"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Whether an artist has registered a contract pointer","anchor":"","text":"cast call 0x467a9c39e03C595EC3075D856f19C7386b6b915d \"isContractRegistered(address,address)(bool)\" \\ <ARTIST ADDRESS <CONTRACT ADDRESS \\ --rpc-url https://ethereum-rpc.publicnode.com `"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Write functions","anchor":"write-functions","text":""},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addContract","anchor":"addcontract","text":"Access: permissionless (writes only the caller's own list) Adds a contract pointer to the caller's catalog. Reverts InvalidContractAddress for the zero address and ContractAlreadyRegistered if the caller already registered it. Emits ContractAdded."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addContractFor","anchor":"addcontractfor","text":"Access: artist or operator (the artist argument, or an address it approved via setOperator, else NotAuthorized) Adds a contract pointer to artist's catalog. Reverts InvalidArtist for a zero artist, InvalidContractAddress for a zero contract, and ContractAlreadyRegistered on a duplicate. Emits Contra"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeContract","anchor":"removecontract","text":"Access: permissionless (writes only the caller's own list) Removes a contract pointer from the caller's catalog. Reverts ContractNotRegistered if the caller has no such pointer. Emits ContractRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeContractFor","anchor":"removecontractfor","text":"Access: artist or operator (the artist argument, or an approved operator, else NotAuthorized) Removes a contract pointer from artist's catalog. Reverts InvalidArtist for a zero artist and ContractNotRegistered if the pointer does not exist. Emits ContractRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addToken","anchor":"addtoken","text":"Access: permissionless (writes only the caller's own list) Adds a single-token pointer (contract, tokenId) to the caller's catalog. Reverts InvalidContractAddress for a zero contract and TokenAlreadyRegistered on a duplicate. Emits TokenAdded."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addTokenFor","anchor":"addtokenfor","text":"Access: artist or operator (the artist argument, or an approved operator, else NotAuthorized) Adds a single-token pointer to artist's catalog. Reverts InvalidArtist, InvalidContractAddress, or TokenAlreadyRegistered as above. Emits TokenAdded."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeToken","anchor":"removetoken","text":"Access: permissionless (writes only the caller's own list) Removes a single-token pointer from the caller's catalog. Reverts TokenNotRegistered if absent. Emits TokenRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeTokenFor","anchor":"removetokenfor","text":"Access: artist or operator (the artist argument, or an approved operator, else NotAuthorized) Removes a single-token pointer from artist's catalog. Reverts InvalidArtist or TokenNotRegistered. Emits TokenRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addTokenRange","anchor":"addtokenrange","text":"Access: permissionless (writes only the caller's own list) Adds a token-range pointer (contract, startTokenId, endTokenId) to the caller's catalog. Reverts InvalidContractAddress for a zero contract, InvalidTokenRange when startTokenId endTokenId, and TokenRangeAlreadyRegistered on a duplicate tuple"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"addTokenRangeFor","anchor":"addtokenrangefor","text":"Access: artist or operator (the artist argument, or an approved operator, else NotAuthorized) Adds a token-range pointer to artist's catalog. Reverts InvalidArtist, InvalidContractAddress, InvalidTokenRange, or TokenRangeAlreadyRegistered as above. Emits TokenRangeAdded."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeTokenRange","anchor":"removetokenrange","text":"Access: permissionless (writes only the caller's own list) Removes a token-range pointer from the caller's catalog. Reverts InvalidTokenRange for an inverted range (rejected on the same terms as add) and TokenRangeNotRegistered if the exact tuple is absent. Emits TokenRangeRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"removeTokenRangeFor","anchor":"removetokenrangefor","text":"Access: artist or operator (the artist argument, or an approved operator, else NotAuthorized) Removes a token-range pointer from artist's catalog. Reverts InvalidArtist, InvalidTokenRange, or TokenRangeNotRegistered. Emits TokenRangeRemoved."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"setOperator","anchor":"setoperator","text":"Access: permissionless (sets only the caller's own operator slot) Approves or revokes operator for the caller, controlling isOperator[msg.sender][operator]. An approved operator may call the For functions on the caller's behalf. There is no setOperatorFor, so an operator cannot sub-delegate. Reverts"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"multicall","anchor":"multicall","text":"Access: permissionless (each inner call enforces its own authorization) Runs several encoded calls in one transaction, each by delegatecall to this contract, so msg.sender is preserved and the For authorization applies to inner calls. Atomic: the first inner revert reverts the whole batch. Returns e"},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Read functions","anchor":"read-functions","text":""},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getCatalogCountsOf","anchor":"getcatalogcountsof","text":"The three list lengths for artist (contracts, tokens, token ranges) in one call. An address with no entries returns (0, 0, 0). Cheaper than getCatalogOf when only sizes are needed."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getCatalogOf","anchor":"getcatalogof","text":"Every pointer in artist's catalog in one call: the contract list, the single-token list, and the token-range list. A zero or empty artist returns three empty arrays. For a large catalog, prefer the per-type Slice getters to stay within RPC return-size limits."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getContractAt","anchor":"getcontractat","text":"The contract pointer at index in artist's list. Reverts on an out-of-bounds index. The list order is not stable across writes."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getContractCount","anchor":"getcontractcount","text":"The number of contract pointers in artist's catalog."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getContractKey","anchor":"getcontractkey","text":"The internal storage key for a contract pointer, keccak256(abi.encode(contractAddress)). Exposed for callers that reproduce the keying offchain."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getContracts","anchor":"getcontracts","text":"Every contract pointer in artist's catalog. Order is not stable; for a large list prefer getContractsSlice."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getContractsSlice","anchor":"getcontractsslice","text":"Up to count contract pointers from artist's list starting at start. A start past the end returns an empty array; a start + count past the end returns the remaining elements. For paginated reads without copying the full list."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenAt","anchor":"gettokenat","text":"The single-token pointer at index in artist's list, returned as (contractAddress, tokenId). Reverts on an out-of-bounds index."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenCount","anchor":"gettokencount","text":"The number of single-token pointers in artist's catalog."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenKey","anchor":"gettokenkey","text":"The internal storage key for a single-token pointer, keccak256(abi.encode(contractAddress, tokenId))."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenRangeAt","anchor":"gettokenrangeat","text":"The token-range pointer at index in artist's list, returned as (contractAddress, startTokenId, endTokenId). Reverts on an out-of-bounds index."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenRangeCount","anchor":"gettokenrangecount","text":"The number of token-range pointers in artist's catalog."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenRangeKey","anchor":"gettokenrangekey","text":"The internal storage key for a token-range pointer, keccak256(abi.encode(contractAddress, startTokenId, endTokenId))."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenRanges","anchor":"gettokenranges","text":"Every token-range pointer in artist's catalog, as (contract, startTokenId, endTokenId) structs. Order is not stable; for a large list prefer getTokenRangesSlice."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokenRangesSlice","anchor":"gettokenrangesslice","text":"Up to count token-range pointers from artist's list starting at start, with the same out-of-range handling as getContractsSlice."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokens","anchor":"gettokens","text":"Every single-token pointer in artist's catalog, as (contract, tokenId) structs. Order is not stable; for a large list prefer getTokensSlice."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"getTokensSlice","anchor":"gettokensslice","text":"Up to count single-token pointers from artist's list starting at start, with the same out-of-range handling as getContractsSlice."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"isContractRegistered","anchor":"iscontractregistered","text":"Whether artist has a contract pointer for contractAddress."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"isOperator","anchor":"isoperator","text":"Whether artist has approved operator to write its lists through the For functions."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"isTokenRangeRegistered","anchor":"istokenrangeregistered","text":"Whether artist has a token-range pointer for the exact (contractAddress, startTokenId, endTokenId) tuple. Does not report ranges that merely cover those bounds; coverage is a reader-side computation."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"isTokenRegistered","anchor":"istokenregistered","text":"Whether artist has a single-token pointer for (contractAddress, tokenId)."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Events","anchor":"events","text":""},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"ContractAdded","anchor":"contractadded","text":"Emitted when a contract pointer is added. Indexed by artist (whose list changed), actor (msg.sender), and contractAddress. actor != artist on an operator write."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"ContractRemoved","anchor":"contractremoved","text":"Emitted when a contract pointer is removed. Indexed by artist, actor, and contractAddress."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"OperatorSet","anchor":"operatorset","text":"Emitted on every setOperator call, including a no-op that sets the current value. Indexed by artist and operator, with the new approved flag."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"TokenAdded","anchor":"tokenadded","text":"Emitted when a single-token pointer is added. Indexed by artist, actor, and contractAddress; tokenId is in the data segment (three topic slots are already used)."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"TokenRangeAdded","anchor":"tokenrangeadded","text":"Emitted when a token-range pointer is added. Indexed by artist, actor, and contractAddress, with startTokenId and endTokenId in the data."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"TokenRangeRemoved","anchor":"tokenrangeremoved","text":"Emitted when a token-range pointer is removed. Indexed by artist, actor, and contractAddress, with startTokenId and endTokenId in the data."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"TokenRemoved","anchor":"tokenremoved","text":"Emitted when a single-token pointer is removed. Indexed by artist, actor, and contractAddress, with tokenId in the data."},{"path":"/docs/catalog/contracts/catalog","page":"Catalog","heading":"Errors","anchor":"errors","text":"AddressEmptyCode(address target) Inherited from OpenZeppelin Address. A low-level call in the inherited utilities targeted an address with no code. Not reachable through this contract's own functions, since multicall delegatecalls to this contract. ContractAlreadyRegistered() addContract/addContract"},{"path":"/docs/catalog/reference/access-control","page":"Access control","heading":"Access control","anchor":"","text":"Every state-changing function in the Catalog contracts and who may call it. Generated from the per-contract references; the per-function pages carry the full behavior."},{"path":"/docs/catalog/reference/access-control","page":"Access control","heading":"Catalog","anchor":"catalog","text":"Function Access --- --- addContract permissionless (writes only the caller's own list) addContractFor artist or operator (the artist argument, or an address it approved via setOperator, else NotAuthorized) removeContract permissionless (writes only the caller's own list) removeContractFor artist or "},{"path":"/docs/catalog/reference/errors","page":"Errors index","heading":"Errors index","anchor":"","text":"Every custom error the Catalog contracts can revert with, its contract, and the condition that raises it. AddressEmptyCode · Catalog\\ Inherited from OpenZeppelin Address. ContractAlreadyRegistered · Catalog\\ addContract/addContractFor targeted a contract pointer already in the artist's catalog. Cont"},{"path":"/docs/catalog/reference/events","page":"Events index","heading":"Events index","anchor":"","text":"Every event the Catalog contracts emit, grouped by contract. Signatures and field meanings live on the per-contract pages."},{"path":"/docs/catalog/reference/events","page":"Events index","heading":"Catalog","anchor":"catalog","text":"ContractAdded · Emitted when a contract pointer is added. ContractRemoved · Emitted when a contract pointer is removed. OperatorSet · Emitted on every setOperator call, including a no-op that sets the current value. TokenAdded · Emitted when a single-token pointer is added. TokenRangeAdded · Emitted"},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"ABIs and the protocol manifest","anchor":"","text":"This page documents the machine-readable files themselves. For task-oriented recipes that use them, start at AI agents. Four entry points, all served as static JSON: Path What it is --- --- /protocol-manifest.json addresses, contract kinds, ABI paths, and docs links for every contract, grouped by pr"},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"The protocol manifest","anchor":"the-protocol-manifest","text":"/protocol-manifest.json is the single machine-readable root. It groups every contract under its protocol (surface, auctions, and more as they ship), and for each carries the address, ABI path, docs link, and the contract \"kind\" (a singleton factory or shared module, a per-owner clone template, or an"},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"Available contract names","anchor":"available-contract-names","text":"ABIs are served under /abis/ for every contract and interface across the protocols: Surface token, factory, and canonical minter: Surface, SurfaceFactory, FixedPriceMinter Current Surface V2 primitives: SurfaceV2, FixedPriceSale, AllowlistGate, CloneFactory, Launcher. CloneFactory has two shared dep"},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"The @pin/abi package","anchor":"the-pinabi-package","text":"Every ABI is also shipped as a typed TypeScript export in the @pin/abi workspace package, as const for viem/wagmi type inference: If you're inside the monorepo, prefer this import over fetching JSON at runtime. Outside the monorepo, fetch /abis/<Name .json; both sources are generated from the same c"},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"Loading the manifest with viem","anchor":"loading-the-manifest-with-viem","text":""},{"path":"/docs/offchain/abis-and-manifest","page":"ABIs and the protocol manifest","heading":"Deployment status","anchor":"deployment-status","text":"The manifest describes Ethereum mainnet (chain 1), including current V2 primitives deployed October 30, 2026. A null per-collection clone address means an instance must be discovered through its factory. The token and sale factories share the CloneFactory ABI; its addresses map names both mainnet de"},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"AI agents","anchor":"","text":"This page is the entry point for automated consumers of the PND onchain protocols: agents, indexers, bots, and retrieval pipelines. Everything below is a public read or a permissionless call; nothing needs an API key."},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Start here","anchor":"start-here","text":"Surface URL What it is --- --- --- Protocol manifest /protocol-manifest.json Shared-singleton addresses, ABI paths, and docs links, grouped by protocol LLM orientation /llms.txt A compact map of the whole reference, with absolute links Contract ABIs /abis/<ContractName .json One plain ABI array per "},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"The clone model: why there's no fixed instance list","anchor":"the-clone-model-why-theres-no-fixed-instance-list","text":"Surface and Auctions deploy per owner. Every artist collection is its own Surface clone from SurfaceFactory; every auction house is its own SovereignAuctionHouse clone from SovereignAuctionHouseFactory. There is no registry of \"all instances\" beyond each factory itself. Treat every clone address as "},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Surface versions","anchor":"surface-versions","text":"The discovery examples below use the V1 mainnet factory and ABI. Current V2 is a separately deployed set of primitives on mainnet and Sepolia. Use surfaceTokenV2Abi, fixedPriceSaleAbi, cloneFactoryAbi, and launcherAbi. The old surfaceV2Abi export is the superseded September testnet contract. For cur"},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Discovering collections","anchor":"discovering-collections","text":"The collection factory emits one event per deploy: The primaryMinter field is the collection-to-minter binding: for a createSurface deploy it is the canonical FixedPriceMinter clone the factory wired; on createSurfaceCustom and createPooledSurface it is whichever primary the caller designated, or ad"},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Discovering auction houses","anchor":"discovering-auction-houses","text":"The auction factory works the same way, with one house per owner: predictHouseAddress(owner) returns the deterministic clone address for an owner before they deploy."},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Reading a clone once you have its address","anchor":"reading-a-clone-once-you-have-its-address","text":"The price lives on the minter, not the token; get <MINTER ADDRESS from the collection's SurfaceCreated.primaryMinter. Or via viem with the typed ABI:"},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"What to read next depends on what you're building","anchor":"what-to-read-next-depends-on-what-youre-building","text":"- Deploying a collection programmatically: Deploy a collection - Minting against a known collection: Mint - Watching mint activity: subscribe to Minted on the collection itself, documented on Surface - Rendering a generative token identically to the onchain output: Injection convention - Deploying a"},{"path":"/docs/offchain/ai-agents","page":"AI agents","heading":"Deployment status","anchor":"deployment-status","text":"Catalog, the auction house factories, Surface V1, and current Surface V2 primitives have mainnet deployments recorded. V2 deployed on October 30, 2026, and its record was committed November 12. Both V2 factories landed paused. Read their current paused() and deprecated() flags before preparing a lau"}]
