Token deployers

The IDropTokenDeployer interface and its two implementations.

IDropTokenDeployer

interface IDropTokenDeployer {
    function deploy(
        bytes32 salt,
        string calldata name,
        string calldata symbol,
        string calldata contractURI
    ) external returns (address token);
}

deploy creates a token and mints the supply of 1,000,000,000 tokens to the caller. The address is deterministic and namespaced by the caller. deploy reverts if the address is already in use.

Anyone can call a token deployer directly, but only launches through the launchpad create pools. The launchpad accepts only the deployers that its constructor set.

DropERC20Deployer

Deploys DropToken with CREATE2:

salt     = keccak256(abi.encode(msg.sender, salt))
initCode = DropToken.creationCode
        ++ abi.encode(name, symbol, contractURI, msg.sender, 1_000_000_000e18)

DropToken is a Solady ERC-20 with:

FunctionValue
name(), symbol()Set at deployment.
decimals()18
totalSupply()1000000000e18
contractURI()Set at deployment. Cannot change.
permit(...)EIP-2612, from Solady.

Permit2 at 0x000000000022D473030F116dDEE9F6B43aC78BA3 has an infinite allowance from every holder.

DropToken.json has the ABI and creation bytecode.

DropB20Deployer

Only on Base. Calls the B-20 factory precompile at 0xB20f000000000000000000000000000000000000:

createB20(ASSET, keccak256(abi.encode(msg.sender, salt)), params, initCalls)
ParameterValue
version1
initialAdminaddress(0)
decimals18
initCallsupdateContractURI(contractURI), updateSupplyCap(1000000000e18), mint(msg.sender, 1000000000e18)

The factory allows the init calls only during creation. The token has no admin, so nobody can call them later.

On this page