Surface V2

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.

Network and ABI

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 manifest list the launcher, gate, and both factories. Implementation addresses appear on the token and sale references. These are deployment-record facts; confirm live code and both factories' pause/deprecation state before launch.

Use the primitive ABIs:

ts
import {
  surfaceTokenV2Abi,
  fixedPriceSaleAbi,
  launcherAbi,
  cloneFactoryAbi,
  allowlistGateAbi,
} from '@pin/abi';

Outside the monorepo, use SurfaceV2.json, FixedPriceSale.json, Launcher.json, CloneFactory.json, and AllowlistGate.json. The older surfaceV2Abi, SurfaceFactoryV2, and FixedPriceMinterV2 interfaces describe a superseded design and do not match these deployments.

Launch a collection

The launcher accepts these structs:

solidity
struct TokenParams {
    string name;
    string symbol;
    address owner;
    address renderer;
    uint256 supplyCap;
    uint16 royaltyBps;
    address royaltyReceiver;
}

struct SaleParams {
    uint256 price;
    uint64 mintStart;
    uint64 mintEnd;
    uint256 maxMints;
    uint256 walletCap;
    address payoutRecipient;
    address gate;
}

function launch(TokenParams calldata t, SaleParams calldata s)
    external returns (address collection, address sale);

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 advisory and capped at 5000 bps (50%).

supplyCap bounds collection lifetime mints; maxMints bounds this sale's lifetime mints; walletCap bounds tokens minted to each recipient through this sale. Zero means unlimited for each cap. Burns and transfers do not restore mint capacity. price is wei per token, including zero for free mints.

mintStart = 0 opens immediately. mintEnd = 0 is open-ended; otherwise mintStart <= block.timestamp < mintEnd. A configured end must be later than the start. gate = address(0) disables gating.

Read Launched(owner, collection, sale) from the launch receipt. The launcher predicts the sale address, installs it as the token's minter, and initializes that sale against the token atomically. Its owner can change the default referrer for future launches only; existing sales retain their copied value.

For custom economics, deploy through the factories directly and supply your own minter. Factory predictions are namespaced to the caller: grant the address predicted for the account that will actually call the sale factory. See CloneFactory.

Mint and withdraw

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:

solidity
function mint(uint256 quantity) external payable;
function mintWithReferral(address to, uint256 quantity, address referrer, bytes calldata data) external payable;
function priceOf(address to, uint256 quantity) external view returns (uint256);
function withdraw(address account) external;
function withdrawTo(address to) external;

Send exactly price * quantity wei. Underpayment and overpayment revert. mint(quantity) mints to the payer with the sale's fixed defaultReferrer and empty gate data. mintWithReferral selects the recipient, referrer, and gate data. Recipient gates and wallet caps evaluate to, not the payer. priceOf quotes payment only; it does not validate the window or gate.

A contract recipient must answer onERC721Received for every actual id the sale is about to mint. These callbacks happen before minting, from the sale, with the payer as operator and the zero address as sender. The token's own mintTo makes no receiver callback; a custom minter owns that check.

The referral share is fixed at 500 bps (5%), with no setter. A 0.1 ETH mint credits 0.005 ETH to an eligible referrer and 0.095 ETH to payout. A zero referrer credits the full 0.1 ETH to payout. Naming the sale itself or its collection as referrer also counts as zero; Sold records that normalized value. Naming the payout recipient gives that account both shares.

Proceeds stay in the sale as pull-payment balances. Anyone may call withdraw(account), which pays only that account. An owed account can call withdrawTo(to) to receive its own balance elsewhere. Failed transfers leave balances intact. Changing the payout recipient affects future credits; revoking the sale as minter does not move or erase existing credits.

Allowlist gate

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 or empty data fails the check, so mint(quantity) cannot mint through this gate. Clearing its root blocks everyone; remove the sale's gate with setGate(address(0)) to open the sale. Set the intended root before renouncing collection ownership.

Seed and reads

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 secure randomness for valuable prizes.

config() returns the flat tuple (renderer, minter, supplyCap, royaltyBps, royaltyReceiver, minted), where minted is the lifetime count. It is not the V1 config ABI. There is no idMode, admin set, creator roster, or primaryMinter on this token. Catalog declarations remain separate.

Ownership and permanence

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 owner-controlled token settings and removes authority to change this sale's rules or this collection's allowlist root. Stored royalty and payout recipients remain payable. Already configured minting continues under the fixed rules; renouncing with minter = address(0) ends minting permanently. An uncapped collection remains uncapped.

Renunciation does not freeze independently mutable renderer code or state, or a custom minter's separate authority. The renderer can still signal metadata refreshes. The canonical sale's close() permanently stops that sale; installing a replacement requires collection ownership.

The token rejects minting or transferring into its own address with SelfCustodyRejected. Only a token holder or approved account can burn it.