fix(pump): default token program to legacy SPL Token instead of Token-2022
The `effective_pump_mint_token_program` helper was defaulting to TOKEN_PROGRAM_2022 when `token_program` was Pubkey::default(), causing Anchor error 0xbbf (account owned by wrong program) for all legacy PumpFun coins whose ATAs are owned by the original Token Program. Fall back to TOKEN_PROGRAM (legacy) when no explicit token program is provided. Token-2022 must be set explicitly for create_v2 coins. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
60d1db4755
commit
49843d8a20
@@ -34,7 +34,7 @@ use solana_sdk::{instruction::Instruction, pubkey::Pubkey, signer::Signer};
|
||||
fn effective_pump_mint_token_program(protocol_params: &PumpFunParams) -> Pubkey {
|
||||
let tp = protocol_params.token_program;
|
||||
if tp == Pubkey::default() {
|
||||
TOKEN_PROGRAM_2022
|
||||
crate::constants::TOKEN_PROGRAM // legacy SPL Token — safe default; Token-2022 must be explicit
|
||||
} else {
|
||||
tp
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user