Watr Developer Portal
  • Home
  • Quickstart
    • Block Explorer
    • Creating a Polkadot Wallet
    • Requesting Watr Tokens
    • Connecting to Testnet
    • Keystore Setup
    • Submitting a Transaction
    • Building & Running Locally
  • Builders
    • Adding an Asset
    • Substrate Contracts
    • Ethereum Contracts
      • Deploy ERC-20 Contracts
      • Interact with ERC-20 Contract
      • Polkadot/Ethereum Address Translation
      • Add Watr to Metamask Wallet
      • Send WATR to/from Metamask Wallet
      • Launch local Ethereum block explorer
      • Remix
    • Watr SS58 Spec
  • Running A Node
    • Node Types
    • Standard Requirements
    • Deployment
Powered by GitBook
On this page
  • Creating an Asset
  • Setting the Metadata
  • Register Revert Codes
  1. Builders

Adding an Asset

PreviousBuildersNextSubstrate Contracts

Last updated 2 years ago

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 and we will be happy to assist.

contact us on telegram