Skip to main content

Assets

A simple, secure module for dealing with fungible assets.

The Assets module provides functionality for asset management of fungible asset classes with a fixed supply, including:

  • Asset Issuance (Minting)
  • Asset Transferal
  • Asset Freezing
  • Asset Destruction (Burning)
  • Delegated Asset Transfers ("Approval API")

Goals

The assets system in Substrate is designed to make the following possible:

  • Issue new assets in a permissioned or permissionless way, if permissionless, then with a deposit required.
  • Allow accounts to be delegated the ability to transfer assets without otherwise existing on-chain.
  • Move assets between accounts.
  • Update an asset class's total supply.
  • Allow administrative activities by specially privileged accounts including freezing account balances and minting/burning assets.

Functions

  • approveTransfer(id, delegate, amount): approve an amount of asset for transfer by a delegated third-party account.

  • block(id, who): disallow further unprivileged transfers of an asset id to and from an account who.

  • burn(id, who, amount): reduce the balance of who by as much as possible up to amount assets of id.

  • cancelApproval(id, delegate): cancel all of some asset approved for delegated transfer by a third-party account.

  • clearMetadata(id): clear the metadata for an asset.

  • create(id, admin, minBalance): issue a new class of fungible assets from a public origin.

  • destroyAccounts(id): destroy all accounts associated with a given asset.

  • destroyApprovals(id): destroy all approvals associated with a given asset up to the max.

  • finishDestroy(id): complete destroying asset and unreserve currency.

  • forceAssetStatus(id, owner, issuer, admin, freezer, minBalance, isSufficient, isFrozen): alter the attributes of a given asset.

  • forceCancelApproval(id, owner, delegate): cancel all of some asset approved for delegated transfer by a third-party account.

  • forceClearMetadata(id): clear the metadata for an asset.

  • forceCreate(id, owner, isSufficient, minBalance): issue a new class of fungible assets from a privileged origin.

  • forceSetMetadata(id, name, symbol, decimals, isFrozen): Force the metadata for an asset to some value.

  • forceTransfer(id, source, dest, amount): Move some assets from one account to another.

  • freeze(id, who): Disallow further unprivileged transfers of an asset id from an account who. who must already exist as an entry in Accounts of the asset. If you want to freeze an account that does not have an entry, use touch_other first.

  • freezeAsset(id): Disallow further unprivileged transfers for the asset class.

  • mint(id, beneficiary, amount): Mint assets of a particular class.

  • refund(id, allowBurn): Return the deposit (if any) of an asset account or a consumer reference (if any) of an account.

  • refundOther(id, who): Return the deposit (if any) of a target asset account. Useful if you are the depositor.

  • setMetadata(id, name, symbol, decimals): Set the metadata for an asset.

  • setMinBalance(id, minBalance): Sets the minimum balance of an asset.

  • setTeam(id, issuer, admin, freezer): Change the Issuer, Admin and Freezer of an asset.

  • startDestroy(id): Start the process of destroying a fungible asset class.

  • thaw(id, who): Allow unprivileged transfers to and from an account again.

  • thawAsset(id): Allow unprivileged transfers for the asset again.

  • touch(id): Create an asset account for non-provider assets.

  • touchOther(id, who): Create an asset account for who.

  • transfer(id, target, amount): Move some assets from the sender account to another.

  • transferApproved(id, owner, destination, amount): Transfer some asset balance from a previously delegated account to some third-party account.

  • transferKeepAlive(id, target, amount): Move some assets from the sender account to another, keeping the sender account alive.

  • transferOwnership(id, owner): Change the Owner of an asset.

The possible inputs for interacting with this pallet are below:

id: The identifier of the asset to have some amount burned.

who: The account to be debited from.

target / destination / dest: The account to be credited.

source: The account to be debited.

owner: The new Owner of this asset.