Creating a Coin

This guide covers how to create coins directly using the x402Fun Factory contract.

x402Fun Factory contract creates Coins, setting up Bonding Curves and initialize PancakeSwap V3 pools. Each Coin is configured to have a Bonding Curve and a Liquidity pool setup with a coin pair of its backing currency on each chain.

There are 2 ways available for coin creation.

Create Coin

To create a new coin, you send a transaction to call the createX402FunToken method.

Method Interface

// solidity interface 

/// @notice Create a new token with required params
///
/// @param _name The name of the token
/// @param _symbol The symbol/ticker of the token
/// @param _tokenURI The IPFS URI of token metadata
/// @param _nonce Random number for salt generation
/// @param _signature The verify-able signature for token creation
/// @param _platformReferrer The Creator Referrer address to receive reward
/// @param _payoutRecipient The Creator address to receive reward
/// @param _owner The owner address of the token contract
///
/// @return token The address of the created token
function createX402FunToken(
    string memory _name,
    string memory _symbol,
    string memory _tokenURI,
    uint256 _nonce,
    bytes memory _signature,
    address _platformReferrer,
    address _payoutRecipient,
    address _owner
)
    external
    returns (address);

Events

The factory emit an event upon successful coin creation


Create and Buy Coin

To create a new coin, you send a transaction to call the createOfficialx402FunTokenAndBuy method.

Method Interface

Events

The factory emit NewX402FunToken event upon successful coin creation

Successful purchase of new coin create will emit Buy event

Additional Info

There're 2 params in both create token method that need extra attention:

  • _tokenURI : All the metadata about created coins are stored on IPFS. You need to upload your image and the meta of your token to IPFS following example below:

  • _signature : For the moment, there's no signature required to create a coin using x402Fun Factory, pass in empty bytes value for _signature will do the job.

Last updated