Create a Fungible Asset
Last updated
Last updated
Fungible asset is an essential component of any blockchain. The Root Network comes with pre-built pallets asset
and assetsExt
that make fungible asset management easy and intuitive, highly optimized for efficiency and stable transaction fees. Additionally, fungible assets on The Root Network are ERC-20 compatible, once created they are tradable on both native and EVM layers.
The following guide will walk you through how to create, mint, and manage a fungible asset using The Root Network Portal.
An account with 100 ROOT
to reserve the asset in the chain storage and at least 0.1 XRP
for initial asset creation.
Go to the Portal Account page and select From Ethereum Wallet.
Select an account you wish to be the asset owner, when the "Connect with MetaMask" dialog opens up, click Next.
Confirm your account appears on the Account page under the Extensions section.
Go to the Portal Extrinsics page and input the values as per the screenshot below:
Extrinsic: assetsExt.createAsset()
Parameters:
name
: The name of the asset.
symbol
: The symbol of the asset.
decimals
: The number of decimals in the asset, max is 18 decimals.
minBalance
(optional): The minimum balance of this new asset that any single account must have. If an account’s balance is reduced below this, then it collapses to zero.
owner
(optional): The owner of the asset, defaults to the caller.
Click Submit Transaction when done and select Sign when prompted by MetaMask.
The transaction is confirmed when a green tick appears on the top right corner.
Go to the Portal Assets page and confirm your asset has been created.
Go to the Portal Extrinsics page and input the values as per the screenshot below:
Extrinsic: assetsExt.mint()
Parameters:
assetId
: The asset ID to mint. The caller must be the owner of the asset.
beneficiary
: The account to receive the minted tokens.
amount
: The amount to mint in the smallest unit. If your asset has 6
decimals, to mint 1 million tokens, it will be 1000000000000
(with 12 zeros).
Click Submit Transaction when done and select Sign when prompted by MetaMask.
The transaction is confirmed when a green tick appears on the top right corner.
Go to the Portal Extrinsics page and input the values as per the screenshot below:
Extrinsic: assetsExt.transfer()
Parameters:
assetId
: The asset ID to mint. The caller must be the owner of the asset.
destination
: The account to be transferred to.
amount
: The amount to transfer in the smallest unit. If your asset has 6
decimals, to mint 1 million tokens, it will be 1000000000000
(with 12 zeros).
keepAlive
: The flag to ensure caller still have enough existence balance.
Click Submit Transaction when done and select Sign when prompted by MetaMask.
The transaction is confirmed when a green tick appears on the top right corner.
It's possible to have your FuturePass account own an asset instead of a standard account. Follow the above steps but wrap all of the extrinsics in the futurepass.proxyExtrinsic
, as per the screenshot:
Once the asset is created in Step 2, you can convert your asset ID to an ERC-20 compatible format to use it on the EVM layer.
The native asset has the following ERC-20 address convention:
For example, if your asset id is 69372
, which is 11064
in hex or 00011064
with padded "0"
up to 8 characters, your asset ERC-20 address will be:
You can verify this by importing the above address to MetaMask, make sure you add The Root Network to MetaMask using the details here.