burn

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

Deletes tokens from an account's balance, decreasing the total supply by the amount being burned. It's marked as Unsafe, as it doesn't check who is authorizing the burning, meaning any user could burn tokens from any account if this was exposed.

The functionality of burn can be expanded by using before_burn and after_burn

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

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

  • some conditions added in development through burn extensions (before_burn or after_burn) aren't met

  • the account balance is lower than amount

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

Throws "INSUFFICIENT BALANCE" if the account does not have enough of the asset to burn

Can only be called from an operation.

Parameters

account

the account to remove tokens from

asset

the asset to burn

amount

the amount of tokens to burn