The asset module provides functionality for handling bridged asset balances.
This module is used by the ETH and ERC20 pallets to store account balances for bridged assets.
Each asset is identified by a unique
H160 hash. This is useful for tracking ERC20 tokens which on Ethereum are identified by a 20-byte contract address.
For various reasons, we built our own asset pallet instead of reusing existing work:
assets: Too high-level and limited for our needs
generic-asset: Its enforced permissions system implies trusted operations. But our system is designed to be trustless.
balances: Only stores balances for a single asset. Our ERC20 pallet supports multiple different ERC20 assets.
Additionally, we need to store balances using
U256, which seemed difficult or impossible to plug into the above pallets.
transfer: Transferring a balance between accounts.
do_mint: Mint to an account's free balance.
do_burn: Burn an account's free balance.
Events for this module.