Skip to content

Commit

Permalink
solana: pass token_program to ATA (support token22)
Browse files Browse the repository at this point in the history
The associated token program instructions default to the legacy SPL
token program. We pass the token_program as an argument to support
token2022 tokens too.
  • Loading branch information
kcsongor committed Apr 25, 2024
1 parent 3f45ce1 commit 63c3743
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub struct Initialize<'info> {
payer = payer,
associated_token::mint = mint,
associated_token::authority = token_authority,
associated_token::token_program = token_program,
)]
/// The custody account that holds tokens in locking mode.
/// NOTE: the account is unconditionally initialized, but not used in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ pub struct ReleaseInbound<'info> {
#[account(
mut,
associated_token::authority = inbox_item.recipient_address,
associated_token::mint = mint
associated_token::mint = mint,
associated_token::token_program = token_program,
)]
pub recipient: InterfaceAccount<'info, token_interface::TokenAccount>,

Expand Down

0 comments on commit 63c3743

Please sign in to comment.