Multichain Token
Ferrum Network's Quantum Portal Nodes and Quantum Portal Smart Contracts can be used to launch a multichain token with supply on multiple networks such as Ethereum, BSC, and other EVM networks. Additionally, non-EVM networks such as Algorand can be added. The supply of the token can be managed across networks without the need to utilize a bridge.
Here is an example of a MultiChain token:
Here's a description of each function in the code template provided for a multi-chain token:
MitlChainToken2Master
contract: This contract is the main smart contract that manages the token's supply and the interaction with the Quantum Portal. Here are the functions included:constructor
: This is a constructor function that sets up the initial state of the contract.initialMint
: This is a function that allows the contract owner to initialize the token's supply by minting the total supply and assigning it to themselves.mintAndBurn
: This is a function that allows users to mint and burn tokens across different chains. The function takes four arguments:mintChain
: The ID of the chain on which the user wants to mint new tokens.burnChain
: The ID of the chain on which the user wants to burn tokens.amount
: The number of tokens to mint and burn.mintFee
: The fee in FRM tokens to be paid for the mint transaction.burnFee
: The fee in FRM tokens to be paid for the burn transaction.
The function first checks if the mint and burn chains are the same as the master chain (where the contract is deployed). If they are, the mint and burn functions are called directly. Otherwise, the function creates a
bytes
representation of themint
orburn
function call on theMitlChainToken2Client
contract, which is then executed on the remote chain using the Quantum Portal'srun
function.remoteAddress
: This is a helper function that returns the remote address of the contract on the specified chain.
MitlChainToken2Client
contract: This contract is deployed on each of the remote chains and is used to receive and execute themint
andburn
functions that were called on the master chain. Here are the functions included:mint
: This function is called by the Quantum Portal when a user wants to mint new tokens on the remote chain. The function checks that the call was made by the master chain, and then mints the specified number of tokens to the user's address.burn
: This function is called by the Quantum Portal when a user wants to burn tokens on the remote chain. The function checks that the call was made by the master chain, and then burns the specified number of tokens from the user's address.
Last updated