Module managed_coin.move
This module is a more convenient wrapper for the more general coins module. It allows to more easily define fungible tokens without explicitly managing capabilities.
Function: initialize
This function can be used to create a new fungible token.
Inputs
account: &signer
Validation: None.
Impact: Creator of the asset — will have the ability to mint and burn.
maximum_supply: Option<u128>
Validation: None.
Impact: If provided, sets a maximum supply cap.
name: String
Validation: None.
Impact: Name of the new asset.
symbol: String
Validation: None.
Impact: Symbol of the new asset.
decimals: u8
Validation: Must be at most 32 (indirectly).
Impact: Number of decimal positions for the asset.
icon_uri: String
Validation: None.
Impact: URI for the icon of the created asset.
project_uri: String
Validation: None.
Impact: URI for the created asset.
Function: burn
This function can be used by the creator of a fungible asset to burn a quantity of the asset. The asset is withdrawn from the store associated with the creator address, meaning the creator cannot burn assets owned by a third party.
Inputs
account: &signer
Validation: Must be the owner of the fungible-asset metadata.
Impact: Authorizes the operation.
metadata: Object<Metadata>
Validation: None required.
Impact: Identifies the asset to be burned.
amount: u64
Validation: None explicitly required (
account
must own a sufficient amount of assets).Impact: Amount of assets to burn.
Function: mint
This function can be used by the creator of a fungible asset to mint a quantity of the asset.
Inputs
account: &signer
Validation: Must be the owner of the fungible-asset metadata.
Impact: Authorizes the operation.
dst_addr: address
Validation: None.
Impact: Owner of the newly minted assets.
metadata: Object<Metadata>
Validation: None required.
Impact: Identifies the asset to be minted.
amount: u64
Validation: Must not cause minting of more than the maximum supply.
Impact: Amount of assets to mint.