Function light_compressed_token::process_mint::process_mint_to

source ยท
pub fn process_mint_to<'info>(
    ctx: Context<'_, '_, '_, 'info, MintToInstruction<'info>>,
    recipient_pubkeys: Vec<Pubkey>,
    amounts: Vec<u64>,
    lamports: Option<u64>,
) -> Result<()>
Expand description

Mints tokens from an spl token mint to a list of compressed accounts and stores minted tokens in spl token pool account.

Steps:

  1. Allocate memory for cpi instruction data. We allocate memory in the beginning so that we can free all memory of the allocation prior to the cpi in cpi_execute_compressed_transaction_mint_to.
  2. Mint SPL tokens to pool account.
  3. Create output compressed accounts, one for every pubkey and amount pair.
  4. Serialize cpi instruction data and free memory up to pre_compressed_acounts_pos.
  5. Invoke system program to execute the compressed transaction.