I am trying to write a program to transfer a SPL Token but I'm having trouble when I pass the token_program account to my instruction:
#[derive(Accounts)]
pub struct InitializeAuction<'info> {
/// State of our auction program (up to you)
#[account(
init,
payer = signer,
space = 8 + BoyncAuction::AUCTION_SIZE
)]
pub state: Account<'info, BoyncAuction>,
/// Account which holds tokens bidded by biders
#[account(mut)]
pub treasury: AccountInfo<'info>,
#[account(mut)]
pub signer: Signer<'info>,
pub system_program: Program<'info, System>,
pub token_program: Program<'info, Token>,
}
When I compile I get the error:
error[E0277]: the trait bound `Token: Id` is not satisfied
--> programs/auction/src/lib.rs:62:24
|
62 | pub token_program: Program<'info, Token>,
| ^^^^^^^^^^^^^^^^^^^^^ the trait `Id` is not implemented for `Token`
|
I am using code from a not so old youtube example that compiled.
I am currently using anchor-cli 0.25.0
, is something change that will not allow me to use a Token Program Account this way?