Instruction
sweep_creator_fee
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
- —
247c1mov64 r8, r4247c2mov64 r9, r3247c3mov64 r7, r2247c4stxdw [r10-448], r1247c5lddw r1, 0x1ae46b ; "Instruction: SweepCreatorFee"247c7mov64 r2, 0x1c247c8call sol_log_247c9mov64 r1, -0x1247castxb [r10-388], r1247cbstxw [r10-392], r1247ccstxdw [r10-376], r8247cdstxdw [r10-384], r9247cemov64 r1, r10247cfadd64 r1, -0x188247d0stxdw [r10-4088], r1247d1mov64 r1, r10247d2add64 r1, -0xb8247d3mov64 r3, r10247d4add64 r3, -0x180247d5mov64 r5, r10247d6mov64 r2, r7247d7call fn_1d135247d8ldxdw r9, [r10-176]247d9ldxdw r8, [r10-184]247daldxb r6, [r10-6]247dbjeq r6, 0x2, +116 ; -> 24850247dcmov64 r1, r10247ddadd64 r1, -0x160247demov64 r2, r10247dfadd64 r2, -0xa8247e0mov64 r3, 0xa2247e1call fn_35367247e2ldxw r1, [r10-5]247e3stxw [r10-189], r1247e4ldxb r1, [r10-1]247e5stxb [r10-185], r1247e6stxb [r10-190], r6247e7stxdw [r10-360], r9247e8stxdw [r10-368], r8247e9ldxw r1, [r10-392]247eastxw [r10-152], r1247ebldxb r1, [r10-388]247ecstxb [r10-148], r1247edldxdw r1, [r10-376]247eestxdw [r10-160], r1247efldxdw r1, [r10-384]247f0stxdw [r10-168], r1247f1mov64 r1, r10247f2add64 r1, -0x170247f3stxdw [r10-176], r1247f4stxdw [r10-184], r7247f5mov64 r1, r10247f6add64 r1, -0x198247f7mov64 r2, r10247f8add64 r2, -0xb8247f9mov64 r3, 0x1247facall fn_0dda2247fbldxdw r8, [r10-408]247fcjeq r8, 0x2, +1 ; -> 247fe247fdja +49 ; -> 2482f247feldxdw r2, [r10-312]247ffmov64 r1, r1024800add64 r1, -0x1a824801lddw r3, 0x1adff924803mov64 r4, r724804call fn_00bc824805mov64 r8, 0x224806ldxdw r2, [r10-424]24807jeq r2, 0x2, +9 ; -> 2481124808ldxdw r3, [r10-416]24809mov64 r1, r102480aadd64 r1, -0x1b82480blddw r4, 0x1ad9f2 ; "bonding_curve"2480dmov64 r5, 0xd2480ecall fn_005a92480fldxdw r9, [r10-432]24810ldxdw r8, [r10-440]24811ldxdw r1, [r10-264]24812ldxdw r2, [r10-272]24813ldxdw r3, [r2+0]24814add64 r3, -0x124815stxdw [r2+0], r324816jne r3, 0x0, +3 ; -> 2481a24817ldxdw r3, [r2+8]24818add64 r3, -0x124819stxdw [r2+8], r32481aldxdw r2, [r1+0]2481badd64 r2, -0x12481cstxdw [r1+0], r22481djne r2, 0x0, +3 ; -> 248212481eldxdw r2, [r1+8]2481fadd64 r2, -0x124820stxdw [r1+8], r224821ldxdw r1, [r10-216]24822ldxdw r2, [r10-224]24823ldxdw r3, [r2+0]24824add64 r3, -0x124825stxdw [r2+0], r324826jne r3, 0x0, +3 ; -> 2482a24827ldxdw r3, [r2+8]24828add64 r3, -0x124829stxdw [r2+8], r32482aldxdw r2, [r1+0]2482badd64 r2, -0x12482cstxdw [r1+0], r22482djne r2, 0x0, +34 ; -> 248502482eja +30 ; -> 2484d2482fldxdw r9, [r10-400]24830ldxdw r1, [r10-264]24831ldxdw r2, [r10-272]24832ldxdw r3, [r2+0]24833add64 r3, -0x124834stxdw [r2+0], r324835jne r3, 0x0, +3 ; -> 2483924836ldxdw r3, [r2+8]24837add64 r3, -0x124838stxdw [r2+8], r324839ldxdw r2, [r1+0]2483aadd64 r2, -0x12483bstxdw [r1+0], r22483cjne r2, 0x0, +3 ; -> 248402483dldxdw r2, [r1+8]2483eadd64 r2, -0x12483fstxdw [r1+8], r224840ldxdw r1, [r10-216]24841ldxdw r2, [r10-224]24842ldxdw r3, [r2+0]24843add64 r3, -0x124844stxdw [r2+0], r324845jne r3, 0x0, +3 ; -> 2484924846ldxdw r3, [r2+8]24847add64 r3, -0x124848stxdw [r2+8], r324849ldxdw r2, [r1+0]2484aadd64 r2, -0x12484bstxdw [r1+0], r22484cjne r2, 0x0, +3 ; -> 248502484dldxdw r2, [r1+8]2484eadd64 r2, -0x12484fstxdw [r1+8], r224850ldxdw r1, [r10-448]24851stxdw [r1+8], r924852stxdw [r1+0], r824853exit
// 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 vaultlet (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 feelet 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_creatorreturn Ok(());}let is_sol = bc.quote_mint == Pubkey::default(); // pc dfe2if is_sol {// pc dff0: top up an un-rent-exempt vaultlet min = Rent::get()?.minimum_balance(0); // 890_880 lamportsif 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