DropLaunchpad

Functions, structs, and storage of the launchpad.

DropLaunchpad launches tokens, owns all pool positions, collects fees, and pays them out. It has no owner.

Structs

struct PoolRequest {
    address quote; // address(0) is native
    uint16 supplyBps; // Share of the supply
    int24 initialTick; // Start price, in raw quote per raw token
}

struct DevBuy {
    uint128 amountIn; // Exact quote input. Zero skips the dev buy.
    address recipient;
}

struct LaunchParams {
    string name;
    string symbol;
    string contractURI; // ERC-7572. Cannot change later.
    bytes32 salt; // Namespaced by msg.sender
    uint32 partnerId;
    IDropTokenDeployer tokenDeployer;
    address creatorFeeRecipient; // BURN_ADDRESS selects burn mode
    PoolRequest[] pools; // The first is the main pool
    DevBuy devBuy; // Paid by msg.sender
}

struct Partner {
    address feeRecipient;
    uint16 shareBps;
    uint24 lpFee; // In pips
}

struct Drop {
    address creatorFeeRecipient;
    uint32 partnerId;
    address creator; // The launchDrop caller
    uint64 launchedAt;
}

struct Position {
    address token;
    int24 tickLower;
    int24 tickUpper;
}

Launch

launchDrop

function launchDrop(LaunchParams calldata params)
    external
    payable
    returns (address token);

Deploys a token, splits the supply of 1,000,000,000 across the pools, and optionally buys from the main pool.

  • msg.value must be devBuy.amountIn if the main pool's quote is native. Otherwise it must be 0.
  • For an ERC-20 dev buy, the caller must approve the launchpad for devBuy.amountIn.
  • Emits DropCreated, then DropPoolCreated for each pool, then DropDevBuy if there is a dev buy.

See Pools for the rules and Errors for the reverts.

Fees

collectFees

function collectFees(address quote, address token)
    external
    returns (uint256 quoteAmount, uint256 tokenAmount);

Collects the fees of the quote/token pool and credits the partner and creator fee recipients. Anyone can call it. Returns the collected amounts before the split. Does not move the hook's 12-hour schedule.

claimFees

function claimFees(address[] calldata assets, address recipient)
    external
    returns (uint256[] memory amounts);

Pays recipient its full credit in each asset, in order. address(0) is native. Anyone can call it. Emits FeesClaimed for each asset with a credit.

collectAndClaimFees

function collectAndClaimFees(address quote, address token, address recipient)
    external
    returns (uint256 quoteAmount, uint256 tokenAmount);

Collects the quote/token pool, then pays recipient its credit in quote and token. Anyone can call it. The returned amounts are the payments, which can include credits from other pools.

setCreatorFeeRecipient

function setCreatorFeeRecipient(address token, address newRecipient) external;

Moves the creator fee share of token to newRecipient. Only the current creator fee recipient can call it. BURN_ADDRESS selects burn mode permanently. Credited fees stay with the old recipient. Emits CreatorFeeRecipientUpdated.

Partners

registerPartner

function registerPartner(address feeRecipient, uint16 shareBps, uint24 lpFee)
    external
    returns (uint32 partnerId);

Registers a partner with fixed terms. Anyone can call it. IDs are assigned in order from 0. shareBps is at most 10000 and lpFee is at most 50000. Emits PartnerRegistered.

setPartnerFeeRecipient

function setPartnerFeeRecipient(uint32 partnerId, address newRecipient)
    external;

Moves the fee share of partnerId to newRecipient. Only the current partner fee recipient can call it. Credited fees stay with the old recipient. Emits PartnerFeeRecipientUpdated.

Reads

FunctionReturns
poolManager()The Uniswap v4 PoolManager.
hook()DropHook.
isTokenDeployer(deployer)true if launches can use the token deployer.
partnerCount()The number of partners, which is also the next partner ID.
partners(partnerId)The partner's feeRecipient, shareBps, and lpFee. Zero if not registered.
drops(token)The drop's creatorFeeRecipient, partnerId, creator, and launchedAt.
positions(poolId)The launchpad's position in a pool: token, tickLower, tickUpper.
poolKey(quote, token)The pool key. The pool exists only if positions(key.toId()).token is token.
claimable(recipient, asset)Fees credited to recipient in asset, not yet claimed.

Callbacks

These functions are part of the interface, but only PoolManager and DropHook can call them:

  • unlockCallback(bytes data): Only PoolManager. Runs the launch, collection, and claim actions.
  • collectSwapFees(PoolKey key): Only DropHook, from afterSwap. Collects and credits a pool's fees.

On this page