Skip to content

Commit 63c3743

Browse files
committed
solana: pass token_program to ATA (support token22)
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.
1 parent 3f45ce1 commit 63c3743

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

solana/programs/example-native-token-transfers/src/instructions/initialize.rs

+1
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ pub struct Initialize<'info> {
6565
payer = payer,
6666
associated_token::mint = mint,
6767
associated_token::authority = token_authority,
68+
associated_token::token_program = token_program,
6869
)]
6970
/// The custody account that holds tokens in locking mode.
7071
/// NOTE: the account is unconditionally initialized, but not used in

solana/programs/example-native-token-transfers/src/instructions/release_inbound.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ pub struct ReleaseInbound<'info> {
2121
#[account(
2222
mut,
2323
associated_token::authority = inbox_item.recipient_address,
24-
associated_token::mint = mint
24+
associated_token::mint = mint,
25+
associated_token::token_program = token_program,
2526
)]
2627
pub recipient: InterfaceAccount<'info, token_interface::TokenAccount>,
2728

0 commit comments

Comments
 (0)