Launch A Token
Launch A Token
newTokenV2
// solidity interface
/// @notice Create a new token (V2) with flexible parameters
/// @param params The parameters for the new token
/// @return token The address of the created token
function newTokenV2(NewTokenV2Params calldata params) external payable returns (address token);
/// @notice Create a new token (V4) with DEX ID and LP fee profile support
/// @param params The parameters for the new token including DEX ID and LP fee profile
/// @return token The address of the created token
/// @dev Similar to newTokenV3 but with DEX ID and LP fee profile support. Allows specifying preferred DEX and fee tier
function newTokenV4(NewTokenV4Params calldata params) external payable returns (address token);
/// @notice Create a new token (V5) with tax V2 support
/// @param params The parameters for the new token including advanced tax features
/// @return token The address of the created token
/// @dev Similar to newTokenV4 but with support for FlapTaxTokenV2 when taxRate > 0.
/// When taxRate is 0, behaves like newTokenV4 (uses regular token or FlapTaxToken).
/// When taxRate > 0, creates a FlapTaxTokenV2 with advanced tax distribution features.
function newTokenV5(NewTokenV5Params calldata params) external payable returns (address token);
/// @notice Parameters for creating a new token (V2)
struct NewTokenV2Params {
/// The name of the token
string name;
/// The symbol of the token
string symbol;
/// The ipfs cid of the metadata
string meta;
/// The DEX supply threshold type
DexThreshType dexThresh;
/// The salt for deterministic deployment
bytes32 salt;
/// The tax rate in basis points (if non-zero, this is a tax token)
uint16 taxRate;
/// The migrator type (see MigratorType enum)
MigratorType migratorType;
/// The quote token address (native gas token if zero address)
address quoteToken;
/// The initial quote token amount to spend for buying
uint256 quoteAmt;
/// The beneficiary address for the token
/// For rev share tokens, this is the address that can claim the LP fees
/// For tax tokens, this is the address that receives the tax fees
address beneficiary;
/// The optional permit data for the quote token
bytes permitData;
}
/// @notice Parameters for creating a new token (V4) with DEX ID and LP fee profile support
struct NewTokenV4Params {
/// The name of the token
string name;
/// The symbol of the token
string symbol;
/// The metadata URI of the token
string meta;
/// The DEX supply threshold type
DexThreshType dexThresh;
/// The salt for deterministic deployment
bytes32 salt;
/// The tax rate in basis points (if non-zero, this is a tax token)
uint16 taxRate;
/// The migrator type (see MigratorType enum)
MigratorType migratorType;
/// The quote token address (native gas token if zero address)
address quoteToken;
/// The initial quote token amount to spend for buying
uint256 quoteAmt;
/// The beneficiary address for the token
/// For rev share tokens, this is the address that can claim the LP fees
/// For tax tokens, this is the address that receives the tax fees
address beneficiary;
/// The optional permit data for the quote token
bytes permitData;
/// @notice The ID of the extension to be used for the new token if not zero
bytes32 extensionID;
/// @notice Additional extension specific data to be passed to the extension's `onTokenCreation` method, check the extension's documentation for details on the expected format and content.
bytes extensionData;
/// @notice The preferred DEX ID for the token
DEXId dexId;
/// @notice The preferred V3 LP fee profile for the token
V3LPFeeProfile lpFeeProfile;
}
/// @notice Parameters for creating a new token (V5) with tax V2 support
struct NewTokenV5Params {
/// The name of the token
string name;
/// The symbol of the token
string symbol;
/// The metadata URI of the token
string meta;
/// The DEX supply threshold type
DexThreshType dexThresh;
/// The salt for deterministic deployment
bytes32 salt;
/// The tax rate in basis points (if non-zero, this is a tax token)
uint16 taxRate;
/// The migrator type (see MigratorType enum)
MigratorType migratorType;
/// The quote token address (native gas token if zero address)
address quoteToken;
/// The initial quote token amount to spend for buying
uint256 quoteAmt;
/// The beneficiary address for the token
/// For rev share tokens, this is the address that can claim the LP fees
/// For tax tokens, this is the address that receives the tax fees
address beneficiary;
/// The optional permit data for the quote token
bytes permitData;
/// @notice The ID of the extension to be used for the new token if not zero
bytes32 extensionID;
/// @notice Additional extension specific data to be passed to the extension's `onTokenCreation` method, check the extension's documentation for details on the expected format and content.
bytes extensionData;
/// @notice The preferred DEX ID for the token
DEXId dexId;
/// @notice The preferred V3 LP fee profile for the token
V3LPFeeProfile lpFeeProfile;
// New V5 tax-specific fields (only used when taxRate > 0)
/// Tax duration in seconds (max: 100 years)
uint64 taxDuration;
/// Anti-farmer duration in seconds (max: 1 year)
uint64 antiFarmerDuration;
/// Market allocation basis points (to beneficiary)
uint16 mktBps;
/// Deflation basis points (burned)
uint16 deflationBps;
/// Dividend basis points (to dividend contract)
uint16 dividendBps;
/// Liquidity provision basis points (LP to dead address)
uint16 lpBps;
/// Minimum balance for dividend eligibility (min: 10K ether, required when dividendBps > 0)
uint256 minimumShareBalance;
}
/// @notice the V3 LP fee profile
/// @dev determines the LP fee tier to use when migrating tokens to Uniswap V3 or Pancake V3
enum V3LPFeeProfile {
LP_FEE_PROFILE_STANDARD, // Standard fee tier: 0.25% on PancakeSwap, 0.3% on Uniswap
LP_FEE_PROFILE_LOW, // Low fee tier: typically, 0.01% on PancakeSwap, 0.05% on Uniswap
LP_FEE_PROFILE_HIGH // High fee tier (1% for exotic pairs)
}
/// @notice the DEX ID
/// @dev determines the DEX we want to migrate to
/// On BSC:
/// - only DEX0 will be enabled, which is PancakeSwap
/// On xLayer:
/// - only DEX0 will be enabled, which is PotatoSwap
/// On Monad:
/// - DEX0 is Uniswap
/// - DEX1 is PancakeSwap
/// - DEX2 is Monday
/// Note that, currently, we only support at most 3 DEXes
/// We may add more DEXes in the future if needed
enum DEXId {
DEX0,
DEX1,
DEX2
}
/// @notice the migrator type
/// @dev the migrator type determines how the liquidity is added to the DEX.
/// Note: To mitigate the risk of DOS, if a V3 migrator is used but the liquidity cannot
/// be added to v3 pools, the migrator will fallback to a V2 migrator.
enum MigratorType {
V3_MIGRATOR, // Migrate the liquidity to a Uniswap V3 like pool
V2_MIGRATOR // Migrate the liquidity to a Uniswap V2 like pool
}
/// @dev dex threshold types
enum DexThreshType {
TWO_THIRDS, // 66.67% supply
FOUR_FIFTHS, // 80% supply
HALF, // 50% supply
_95_PERCENT, // 95% supply
_81_PERCENT, // 81% supply
_1_PERCENT // 1% supply => mainly for testing
}newTokenV3, newTokenV4, and newTokenV5
Events
Last updated