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.

Creating an Asset

The first step is to register an asset. The extrinsic assets.create should be submitted.

This extrinsic expects 3 parameters and requires a deposit of 100 WATRD to 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

Setting the Metadata

Once the asset has been created, the metadata for the asset must be set. This is accomplished by calling the assets.setMetadata extrinsic signed by the admin account specified in the asset creation stage.

The extrinsic has the following input parameters

  • id - this is the id of the asset that was specified in the creation of this asset on this chain

  • name - the name of the token (ex: USD Tether)

  • symbol - the token's symbol (ex: USDt)

  • decimals - the number of decimal places that this token should apply to balances

Register Revert Codes

In order for smart contracts on the EVM layer to be able to interact with the Substrate assets correctly, the asset. This operation requires root origin 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.

Last updated