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
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
function setDefaultReferrer(address defaultReferrer_) externalAccess: 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
function transferOwnership(address newOwner) externalAccess: owner-only (OwnableUnauthorizedAccount)
Standard OpenZeppelin Ownable transfer of the right to change
defaultReferrer.
renounceOwnership
function renounceOwnership() externalAccess: owner-only (OwnableUnauthorizedAccount)
Standard OpenZeppelin Ownable renounce: defaultReferrer is fixed for every
later launch.
Read functions
defaultReferrer
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
function nonce() external view returns (uint256)Launch counter, part of each sale's salt.
owner
function owner() external view returns (address)The address that can change defaultReferrer.
saleFactory
function saleFactory() external view returns (CloneFactory)The sale CloneFactory.
tokenFactory
function tokenFactory() external view returns (CloneFactory)The token CloneFactory.
Events
DefaultReferrerSet
event DefaultReferrerSet(address indexed defaultReferrer)The default referrer changed, including at construction.
Launched
event Launched(address indexed owner, address indexed collection, address indexed sale)One per launch: owner, collection and sale.
OwnershipTransferred
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.