mint

function mint(account: account, asset: asset, amount: big_integer)(source)

Creates new tokens, increasing the total supply by the amount being minted, and gives them to an account. It's marked as Unsafe, as it doesn't check who is authorizing the minting, meaning any user could mint tokens to any account if this was exposed.

The functionality of mint can be expanded by using before_mint and after_mint

Throws "UNAUTHORIZED MINTING" if the asset's issuing blockchain is not this blockchain

Throws "INVALID AMOUNT" if the asset's total supply, increased by the amount being minted, is higher than 2^256.

Throws if the required assets cannot be minted. Common cases include:

  • the amount to mint is not in the accepted range (0; 2^256) (exclusive)

  • some conditions added in development through mint extensions (before_mint or after_mint) aren't met

Can only be called from an operation.

Parameters

account

the account to give the newly minted tokens to

asset

the asset to mint

amount

the amount of tokens to mint