2

Thanks for your concerns.

I was building smart contract on Solana. I used token-2022 and anchor_spl::token_interface::{Mint, TokenAccount}

I checked Mint and TokenAccount. There is Owners trait instead of Owner trait

But #[derive(Accounts)] macro needs Owner trait I guess

How can I fix this glitch?enter image description here

1 Answer 1

5

token_interface requires using InterfaceAccount instead of Account.

This won't work:

pub token_account: Account<'info, TokenAccount>,

Correct usage is:

pub token_account: InterfaceAccount<'info, TokenAccount>,
1
  • Thank you, it works!!
    – CodeNinja
    Commented Jul 13, 2023 at 14:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.