The deployToken
function in the Clanker
contract is responsible for deploying a new token and configuring a liquidity pool for it. It validates the deployment configuration, optionally vaults a portion of the token, sets up the pool, and emits an event with the details of the newly created token.
deploymentConfig
(struct DeploymentConfig
): A struct containing various configurations for the deployment:
tokenConfig
(struct TokenConfig
): Configuration for the token to be deployed, including:
name
(string
): The name of the token.symbol
(string
): The symbol of the token.salt
(bytes32
): A salt for deterministic deployment.image
(string
): The image associated with the token.metadata
(string
): Metadata for the token.context
(string
): Context for the token.originatingChainId
(uint256
): The chain ID from which the token is being deployed.vaultConfig
(struct VaultConfig
): Configuration for vaulting the token, including:
vaultPercentage
(uint8
): Percentage of tokens to vault.vaultDuration
(uint256
): Duration for which the tokens are vaulted.poolConfig
(struct PoolConfig
): Configuration for the liquidity pool, including:
pairedToken
(address
): The address of the paired token.tickIfToken0IsNewToken
(int24
): Tick configuration for the pool.initialBuyConfig
(struct InitialBuyConfig
): Configuration for the initial buy, including:
pairedTokenPoolFee
(uint24
): Pool fee for the paired token.pairedTokenSwapAmountOutMinimum
(uint256
): Minimum amount of paired tokens to receive.rewardsConfig
(struct RewardsConfig
): Configuration for rewards, including:
creatorReward
(uint256
): Reward for the creator.creatorAdmin
(address
): Admin address for the creator.creatorRewardRecipient
(address
): Recipient of the creator's reward.interfaceAdmin
(address
): Admin address for the interface.interfaceRewardRecipient
(address
): Recipient of the interface's reward.tokenAddress
(address
): The address of the newly deployed token.positionId
(uint256
): The ID of the liquidity position created in the pool.