Adding an Asset
Tokens on Watr can also be used outside of the evm. They can, for example, be teleported to other parachains to be used there. Tokens to be used in this manner are represented by precompiled contracts that expose the ERC20 interface by default.
The first step is to register an asset. The extrinsic
assets.createshould be submitted.
This extrinsic expects 3 parameters and requires a deposit of
100 WATRDto complete on devnet.
- Id - this will be the unique id of this asset on this chain
- admin - this is the account that is permitted to call admin related functions on the asset
- MinBalance - the minumum balance of the asset required. This should be provided in minor units, example
1000 = 0.001 USDt
Once the asset has been created, the metadata for the asset must be set. This is accomplished by calling the
assets.setMetadataextrinsic signed by the
adminaccount specified in the asset creation stage.
The extrinsic has the following input parameters
- id - this is the
idof the asset that was specified in the creation of this asset on this chain
- name - the name of the token (ex:
- symbol - the token's symbol (ex:
- decimals - the number of decimal places that this token should apply to balances
In order for smart contracts on the EVM layer to be able to interact with the Substrate assets correctly, the asset. This operation requires
rootorigin and so can not be completed without intervention from the Watr team. If you require this action, please contact us on telegram and we will be happy to assist.