I wrote a piece of code that uses associated_token::mint
and associated_token::authority
and I passed the Token Program but did not pass the Associated Token Program. Considering All Accounts must be specified before any Instruction, I expected this to fail because the Associated Token Program was not passed but the Instruction was successful. Why is the Associated Token Program Account not necessary when using associated_token
?
Add a comment
|
1 Answer
You need the Associated Token Program when creating an ATA on the Rust end, but don't need it just to validate an ATA.
So if the ATA was created earlier, or you create your ATAs on the client side, you don't need the Associated Token Program.