sol-parser-sdk icon indicating copy to clipboard operation
sol-parser-sdk copied to clipboard

pumpfun claim_cashback 领取有问题, 少了几个 accounts

Open durong999 opened this issue 6 months ago • 2 comments

少了几个 accounts

/// Claim cashback (UserVolumeAccumulator → user lamports).
pub fn claim_cashback_pumpfun_instruction(payer: &Pubkey) -> Option<Instruction> {
    const CLAIM_CASHBACK_DISCRIMINATOR: [u8; 8] = [37, 58, 35, 126, 190, 53, 228, 197];
    let user_volume_accumulator = get_user_volume_accumulator_pda(payer)?;
    let ix_accounts = vec![
        AccountMeta::new(*payer, true),
        AccountMeta::new(user_volume_accumulator, false),
        crate::constants::SYSTEM_PROGRAM_META,
        accounts::EVENT_AUTHORITY_META,
        accounts::PUMPFUN_META,
    ];
    let ix =
        Instruction::new_with_bytes(accounts::PUMPFUN, &CLAIM_CASHBACK_DISCRIMINATOR, ix_accounts);
    Some(ix)
}
Image Image

durong999 avatar May 27 '26 01:05 durong999

The reported constructor is implemented in sol-trade-sdk, not in the parser crate. The current PumpFun IDL requires five accounts for claim_cashback; the constructor only supplied the first three.

A fix is ready in https://github.com/0xfnzero/sol-trade-sdk/pull/117. It adds event_authority and the PumpFun program account in the exact IDL order and adds a regression test for the full discriminator/account metadata.

Verification:

cargo test --locked instruction::pumpfun::tests
26 passed; 0 failed

I will close this issue after the PR is merged into sol-trade-sdk main.

0xfnzero avatar Aug 12 '26 22:08 0xfnzero

Fixed in 0xfnzero/sol-trade-sdk#117. The PumpFun claim_cashback instruction constructor is owned by sol-trade-sdk; the merged change adds the missing event authority and PumpFun program accounts and includes a regression test for the full account order. There is no code dependency between this issue and sol-parser-sdk, so this cross-repository tracking issue can now be closed.

0xfnzero avatar Aug 13 '26 01:08 0xfnzero