Launcher

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 royalty and payout fallback, PND's default referrer, one sale per collection. It holds no authority over anything it launches. Deployed at 0x924d16cDCB9037cE159D82923406Be161a6BCD1B.

The launcher is replaceable without touching anything deployed. A bespoke project skips it and calls the token factory directly with its own minter.

Concepts

How one call wires both

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.

Parameters

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).

Write functions

launch

solidity
function launch(Launcher.TokenParams t, Launcher.SaleParams s) external returns (address collection, address sale)

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.

setDefaultReferrer

solidity
function setDefaultReferrer(address defaultReferrer_) external

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.

transferOwnership

solidity
function transferOwnership(address newOwner) external

Access: owner-only (OwnableUnauthorizedAccount)

Standard OpenZeppelin Ownable transfer of the right to change defaultReferrer.

renounceOwnership

solidity
function renounceOwnership() external

Access: owner-only (OwnableUnauthorizedAccount)

Standard OpenZeppelin Ownable renounce: defaultReferrer is fixed for every later launch.

Read functions

defaultReferrer

solidity
function defaultReferrer() external view returns (address)

The referrer each new sale copies. Should be a Safe or splitter, since every sale keeps its copy.

nonce

solidity
function nonce() external view returns (uint256)

Launch counter, part of each sale's salt.

owner

solidity
function owner() external view returns (address)

The address that can change defaultReferrer.

saleFactory

solidity
function saleFactory() external view returns (CloneFactory)

The sale CloneFactory.

tokenFactory

solidity
function tokenFactory() external view returns (CloneFactory)

The token CloneFactory.

Events

DefaultReferrerSet

solidity
event DefaultReferrerSet(address indexed defaultReferrer)

The default referrer changed, including at construction.

Launched

solidity
event Launched(address indexed owner, address indexed collection, address indexed sale)

One per launch: owner, collection and sale.

OwnershipTransferred

solidity
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)

Standard OpenZeppelin Ownable event.

Errors

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 other than the predicted address. Unreachable with a correct sale factory.