I am trying to transfer some spl tokens from one account to another. The account's authority is a PDA of the program:
if source_account.amount > 0 {
invoke_signed(
&spl_token::instruction::transfer(
&token_program_info.key,
&source_account_info.key,
&dest_account_info.key,
&transfer_authority_info.key,
&[],
source_account.amount,
)?,
&[
token_program_info.clone(),
token_pot_info.clone(),
dest_account_info.clone(),
transfer_authority_info.clone(),
],
&[authority_seeds],
)?;
}
My program succeeds without this, but when I add this code back in I receive an error: Err
value: TransactionError(InstructionError(0, ProgramFailedToComplete))'
for context, the transfer authority is definitely correct as when i edit it I get a different error: PrivelegeEscaltion.
The accounts are also initialised, I printed out the amount both of them store currently and it works. They are same mint...