pub fn burn(sub_id: SubId, amount: u64)
Expand description
Burn amount
coins of the current contract’s sub_id
. This function burns them from the balance of the current contract.
Additional Information
To burn coins, they must be sent or owned by the contract in the transaction this function is called.
Arguments
sub_id
: [SubId] - The sub identifier of the asset which to burn.amount
: [u64] - The amount of coins to burn.
Reverts
- When the contract balance is less than
amount
.
Examples
use std::asset::burn;
fn foo() {
burn(SubId::zero(), 500);
}