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
- Unpack compressed input accounts and input token data, this uses standardized signer / delegate and will fail in proof verification in case either is invalid.
- Check that compressed accounts are of same mint.
- Check that sum of input compressed accounts is equal to sum of output compressed accounts
- create_output_compressed_accounts
- Serialize and add token_data data to in compressed_accounts.
- Invoke light_system_program::execute_compressed_transaction.