debpf
pump.fun / instructions

Instruction

sweep_creator_fee

DecompiledHidden

Permissionless crank that pays out the creator fees a bonding curve has collected (kept in a counter on the curve account) to the coin creator's "creator-vault" PDA. Anyone can call it and pay the transaction fee, but the money can only go to the vault derived from the curve's stored creator, so a caller can't redirect it. For SOL curves it moves the lamports straight from the curve account; for curves priced in another token it sends that token from the curve's token account to the vault's token account, with the curve PDA signing. The payer may also cover rent: resizing the curve to 166 bytes, topping up an empty vault, or creating token accounts. If nothing has built up it just logs a message and exits. This instruction is not in the public IDL and no mainnet calls were found.

Discriminator
0x20f6bf3408c949ba
Calls in the sample
0
Reproduced, seen by the agent
—
Reproduced, never shown to the agent
—
Bytecodefn_247c1
247c1mov64 r8, r4
247c2mov64 r9, r3
247c3mov64 r7, r2
247c4stxdw [r10-448], r1
247c5lddw r1, 0x1ae46b ; "Instruction: SweepCreatorFee"
247c7mov64 r2, 0x1c
247c8call sol_log_
247c9mov64 r1, -0x1
247castxb [r10-388], r1
247cbstxw [r10-392], r1
247ccstxdw [r10-376], r8
247cdstxdw [r10-384], r9
247cemov64 r1, r10
247cfadd64 r1, -0x188
247d0stxdw [r10-4088], r1
247d1mov64 r1, r10
247d2add64 r1, -0xb8
247d3mov64 r3, r10
247d4add64 r3, -0x180
247d5mov64 r5, r10
247d6mov64 r2, r7
247d7call fn_1d135
247d8ldxdw r9, [r10-176]
247d9ldxdw r8, [r10-184]
247daldxb r6, [r10-6]
247dbjeq r6, 0x2, +116 ; -> 24850
247dcmov64 r1, r10
247ddadd64 r1, -0x160
247demov64 r2, r10
247dfadd64 r2, -0xa8
247e0mov64 r3, 0xa2
247e1call fn_35367
247e2ldxw r1, [r10-5]
247e3stxw [r10-189], r1
247e4ldxb r1, [r10-1]
247e5stxb [r10-185], r1
247e6stxb [r10-190], r6
247e7stxdw [r10-360], r9
247e8stxdw [r10-368], r8
247e9ldxw r1, [r10-392]
247eastxw [r10-152], r1
247ebldxb r1, [r10-388]
247ecstxb [r10-148], r1
247edldxdw r1, [r10-376]
247eestxdw [r10-160], r1
247efldxdw r1, [r10-384]
247f0stxdw [r10-168], r1
247f1mov64 r1, r10
247f2add64 r1, -0x170
247f3stxdw [r10-176], r1
247f4stxdw [r10-184], r7
247f5mov64 r1, r10
247f6add64 r1, -0x198
247f7mov64 r2, r10
247f8add64 r2, -0xb8
247f9mov64 r3, 0x1
247facall fn_0dda2
247fbldxdw r8, [r10-408]
247fcjeq r8, 0x2, +1 ; -> 247fe
247fdja +49 ; -> 2482f
247feldxdw r2, [r10-312]
247ffmov64 r1, r10
24800add64 r1, -0x1a8
24801lddw r3, 0x1adff9
24803mov64 r4, r7
24804call fn_00bc8
24805mov64 r8, 0x2
24806ldxdw r2, [r10-424]
24807jeq r2, 0x2, +9 ; -> 24811
24808ldxdw r3, [r10-416]
24809mov64 r1, r10
2480aadd64 r1, -0x1b8
2480blddw r4, 0x1ad9f2 ; "bonding_curve"
2480dmov64 r5, 0xd
2480ecall fn_005a9
2480fldxdw r9, [r10-432]
24810ldxdw r8, [r10-440]
24811ldxdw r1, [r10-264]
24812ldxdw r2, [r10-272]
24813ldxdw r3, [r2+0]
24814add64 r3, -0x1
24815stxdw [r2+0], r3
24816jne r3, 0x0, +3 ; -> 2481a
24817ldxdw r3, [r2+8]
24818add64 r3, -0x1
24819stxdw [r2+8], r3
2481aldxdw r2, [r1+0]
2481badd64 r2, -0x1
2481cstxdw [r1+0], r2
2481djne r2, 0x0, +3 ; -> 24821
2481eldxdw r2, [r1+8]
2481fadd64 r2, -0x1
24820stxdw [r1+8], r2
24821ldxdw r1, [r10-216]
24822ldxdw r2, [r10-224]
24823ldxdw r3, [r2+0]
24824add64 r3, -0x1
24825stxdw [r2+0], r3
24826jne r3, 0x0, +3 ; -> 2482a
24827ldxdw r3, [r2+8]
24828add64 r3, -0x1
24829stxdw [r2+8], r3
2482aldxdw r2, [r1+0]
2482badd64 r2, -0x1
2482cstxdw [r1+0], r2
2482djne r2, 0x0, +34 ; -> 24850
2482eja +30 ; -> 2484d
2482fldxdw r9, [r10-400]
24830ldxdw r1, [r10-264]
24831ldxdw r2, [r10-272]
24832ldxdw r3, [r2+0]
24833add64 r3, -0x1
24834stxdw [r2+0], r3
24835jne r3, 0x0, +3 ; -> 24839
24836ldxdw r3, [r2+8]
24837add64 r3, -0x1
24838stxdw [r2+8], r3
24839ldxdw r2, [r1+0]
2483aadd64 r2, -0x1
2483bstxdw [r1+0], r2
2483cjne r2, 0x0, +3 ; -> 24840
2483dldxdw r2, [r1+8]
2483eadd64 r2, -0x1
2483fstxdw [r1+8], r2
24840ldxdw r1, [r10-216]
24841ldxdw r2, [r10-224]
24842ldxdw r3, [r2+0]
24843add64 r3, -0x1
24844stxdw [r2+0], r3
24845jne r3, 0x0, +3 ; -> 24849
24846ldxdw r3, [r2+8]
24847add64 r3, -0x1
24848stxdw [r2+8], r3
24849ldxdw r2, [r1+0]
2484aadd64 r2, -0x1
2484bstxdw [r1+0], r2
2484cjne r2, 0x0, +3 ; -> 24850
2484dldxdw r2, [r1+8]
2484eadd64 r2, -0x1
2484fstxdw [r1+8], r2
24850ldxdw r1, [r10-448]
24851stxdw [r1+8], r9
24852stxdw [r1+0], r8
24853exit
Reconstructedsweep_creator_fee
// discriminator 20f6bf3408c949ba — NOT in the published IDL
// handler fn_247c1 -> try_accounts fn_1d135 -> sweep_fees_core(ctx, is_creator = true) fn_0dda2
// (SweepProtocolFee, fn_2472e, uses the same code with is_creator = false)
#[derive(Accounts)]
pub struct SweepFees<'info> {
#[account(mut)] payer: Signer/AccountInfo, // ConstraintMut (2000) if not writable
#[account(seeds = [b"global"], bump)] global: Account<Global>, // ConstraintSeeds (2006)
base_mint: InterfaceAccount<Mint>,
quote_mint: InterfaceAccount<Mint>,
quote_token_program: Interface<TokenInterface>,
associated_token_program: Program<AssociatedToken>,
system_program: Program<System>,
#[account(mut, seeds = [b"bonding-curve", base_mint.key()], bump,
// pc 1d3a9: bonding_curve.quote_mint == quote_mint
// OR (bonding_curve.quote_mint == Pubkey::default() && quote_mint == <native/WSOL const @0x1ac310>)
constraint = ...)] bonding_curve: Account<BondingCurve>,
#[account(mut, address = ATA(bonding_curve, quote_token_program, quote_mint))]
associated_quote_bonding_curve: AccountInfo,
#[account(mut)] recipient: AccountInfo,
#[account(mut, address = ATA(recipient, quote_token_program, quote_mint))]
associated_quote_recipient: AccountInfo,
#[account(seeds = [b"__event_authority"], bump)] event_authority, program,
}
pub fn sweep_creator_fee(ctx) -> Result<()> {
msg!("Instruction: SweepCreatorFee");
let bc = &mut ctx.accounts.bonding_curve;
// fn_076ea: if bonding_curve data_len < 166, realloc to 166 (rent paid by payer via system_program)
ensure_bonding_curve_size(bc, 166, &payer, &system_program)?;
// pc ddc8: recipient may not be the all-zero key (System Program id)
require!(recipient.key() != Pubkey::default(), Error(6000)); // sweep_fees.rs:123
// pc ddcc: recipient must be this coin's creator vault
let (vault, _) = Pubkey::find_program_address(&[b"creator-vault", bc.creator.as_ref()], &crate::ID);
require_keys_eq!(recipient.key(), vault, ConstraintSeeds /*2006*/); // sweep_fees.rs:145
// pc ded8: take and zero the accumulated creator fee
let amount = bc.creator_fee_accrued; // BondingCurve field (struct off +120)
bc.creator_fee_accrued = 0;
if amount == 0 {
msg!(<"no creator fee to sweep" style message>); // pc dedc, formatted with is_creator
return Ok(());
}
let is_sol = bc.quote_mint == Pubkey::default(); // pc dfe2
if is_sol {
// pc dff0: top up an un-rent-exempt vault
let min = Rent::get()?.minimum_balance(0); // 890_880 lamports
if recipient.lamports() < min {
system_program::transfer(payer -> recipient, min)?; // fn_10f5c, full minimum, paid by payer
}
// fn_1202e: direct lamport move (program owns bonding_curve)
require!(bc.lamports() >= amount, ProgramError::InsufficientFunds);
**bc.lamports -= amount;
**recipient.lamports = recipient.lamports().checked_add(amount)?;
} else {
// fn_029be x2: idempotently create associated_quote_bonding_curve and
// associated_quote_recipient (payer funds rent)
// fn_119af: token_interface::transfer_checked(
// from = associated_quote_bonding_curve, to = associated_quote_recipient,
// authority = bonding_curve, mint = quote_mint, amount, decimals = quote_mint.decimals,
// signer seeds = [b"bonding-curve", base_mint, bump])
}
// pc e095: emit_cpi! (via event_authority) event with
// { timestamp: Clock::get().unix_timestamp, base_mint, bonding_curve, quote_mint: bc.quote_mint,
// recipient, amount, is_creator_fee: true }
Ok(())
}

Replay model

The executable model the agent wrote. Every tally above comes from running it against mainnet.

// no model entered yet

Accounts

Not published. The accounts and arguments were recovered from the bytecode; see the reconstruction.

program 6EF8rr…BEwF6P