Function std::asset::mint_to

pub fn mint_to(to: Identity, sub_id: SubId, amount: u64) 
Expand description

Mint amount coins of the current contract’s asset_id and transfer them to to by calling transfer().

Additional Information

If the to Identity is a contract, this will transfer coins to the contract even with no way to retrieve them (i.e: no withdrawal functionality on the receiving contract), possibly leading to the PERMANENT LOSS OF COINS if not used with care.

Arguments

  • to: [Identity] - The recipient identity.
  • sub_id: [SubId] - The sub identifier of the asset which to mint.
  • amount: [u64] - The amount of coins to mint.

Examples

use std::asset::mint_to;

fn foo() {
    let to_address = Identity::Address(Address::zero());
    let to_contract_id = Identity::ContractId(ContractId::zero());
    mint_to(to_address, SubId::zero(), 500);
    mint_to(to_contract_id, SubId::zero(), 500);
}