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

  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. TODO: if is delegate check delegated amount and decrease it, there needs to be an output compressed account with the same compressed account data as the input compressed account.
  3. Check that compressed accounts are of same mint.
  4. Check that sum of input compressed accounts is equal to sum of output compressed accounts 5.1 create_output_compressed_accounts 5.2 create delegate change compressed_accounts.
  5. Serialize and add token_data data to in compressed_accounts.
  6. Invoke light_system_program::execute_compressed_transaction.