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:
- 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.
- Mint SPL tokens to pool account.
- Create output compressed accounts, one for every pubkey and amount pair.
- Serialize cpi instruction data and free memory up to pre_compressed_acounts_pos.
- Invoke system program to execute the compressed transaction.