Function light_compressed_token::process_transfer::process_transfer

source ยท
pub fn process_transfer<'a, 'b, 'c, 'info: 'b + 'c>(
    ctx: Context<'a, 'b, 'c, 'info, TransferInstruction<'info>>,
    inputs: Vec<u8>,
) -> Result<()>
Expand description

Process a token transfer instruction build inputs -> sum check -> build outputs -> add token data to inputs -> invoke cpi

  1. Unpack compressed input accounts and input token data, this uses standardized signer / delegate and will fail in proof verification in case either is invalid.
  2. Check that compressed accounts are of same mint.
  3. Check that sum of input compressed accounts is equal to sum of output compressed accounts
  4. create_output_compressed_accounts
  5. Serialize and add token_data data to in compressed_accounts.
  6. Invoke light_system_program::execute_compressed_transaction.