pub fn mint_to_contract(to: ContractId, sub_id: SubId, amount: u64) 
Expand description

Mint amount coins of the current contract’s asset_id and send them
UNCONDITIONALLY to the contract at to.

Additional Information

This will transfer coins to a 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.


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


use std::{constants::ZERO_B256, asset::mint_to_contract};

fn foo() {
    let to = ContractId::from(ZERO_B256);
    mint_to_contract(to, ZERO_B256, 500);