Instruction
collect_creator_fee
Sweeps the accumulated SOL creator fees from a coin creator's `creator-vault` PDA to the creator wallet, leaving only the rent-exempt minimum for an empty account (currently 650,240 lamports) in the vault. Anyone can call it because the creator does not have to sign, but the money can only go to the creator whose key derives the vault. The call fails if the vault holds nothing above the rent minimum, if the creator account is executable, if the creator would still not be rent-exempt after receiving the fees, or if the creator's owner equals a fixed constant (error 6050; I did not resolve which program that constant is). It emits a CollectCreatorFeeEvent with the timestamp, the creator and the amount.
- Discriminator
- 0x1416567bc61cdb84
- Calls in the sample
- 1
- Reproduced, seen by the agent
- 1 / 1
- Reproduced, never shown to the agent
- —
1 of 1 real mainnet calls reproduced exactly. Every SOL and token movement the model predicted matched the chain to the last unit. Unseen calls were never shown to the agent.
24c26mov64 r8, r424c27mov64 r9, r324c28mov64 r7, r224c29stxdw [r10-448], r124c2alddw r1, 0x1ae4f6 ; "Instruction: CollectCreatorFee"24c2cmov64 r2, 0x1e24c2dcall sol_log_24c2esth [r10-418], 0xffff24c2fstxdw [r10-408], r824c30stxdw [r10-416], r924c31mov64 r1, r1024c32add64 r1, -0x1a224c33stxdw [r10-4088], r124c34mov64 r1, r1024c35add64 r1, -0xc824c36mov64 r3, r1024c37add64 r3, -0x1a024c38mov64 r5, r1024c39mov64 r2, r724c3acall fn_16bef24c3bldxdw r9, [r10-192]24c3cldxdw r8, [r10-200]24c3dldxb r6, [r10-6]24c3ejeq r6, 0x2, +42 ; -> 24c6924c3fmov64 r1, r1024c40add64 r1, -0x18024c41mov64 r2, r1024c42add64 r2, -0xb824c43mov64 r3, 0xb224c44call fn_3536724c45ldxw r1, [r10-5]24c46stxw [r10-205], r124c47ldxb r1, [r10-1]24c48stxb [r10-201], r124c49stxb [r10-206], r624c4astxdw [r10-392], r924c4bstxdw [r10-400], r824c4cldxb r1, [r10-417]24c4dstxb [r10-167], r124c4eldxb r1, [r10-418]24c4fstxb [r10-168], r124c50ldxdw r1, [r10-408]24c51stxdw [r10-176], r124c52ldxdw r1, [r10-416]24c53stxdw [r10-184], r124c54mov64 r1, r1024c55add64 r1, -0x19024c56stxdw [r10-192], r124c57stxdw [r10-200], r724c58mov64 r1, r1024c59add64 r1, -0x1b824c5amov64 r2, r1024c5badd64 r2, -0xc824c5ccall fn_0505624c5dldxdw r8, [r10-440]24c5ejeq r8, 0x2, +1 ; -> 24c6024c5fja +5 ; -> 24c6524c60mov64 r1, r1024c61add64 r1, -0x19024c62call fn_0171f24c63mov64 r8, 0x224c64ja +4 ; -> 24c6924c65ldxdw r9, [r10-432]24c66mov64 r1, r1024c67add64 r1, -0x19024c68call fn_0171f24c69ldxdw r1, [r10-448]24c6astxdw [r1+8], r924c6bstxdw [r1+0], r824c6cexit
// discriminator 1416567bc61cdb84, no args#[derive(Accounts)]pub struct CollectCreatorFee<'info> {#[account(mut)]pub creator: AccountInfo<'info>, // NOT required to sign (per IDL / validation)#[account(mut, seeds = [b"creator-vault", creator.key().as_ref()], bump)] // ConstraintSeeds (2006), pc 16d02pub creator_vault: AccountInfo<'info>,pub system_program: Program<'info, System>,/// CHECK: #[event_cpi]pub event_authority: AccountInfo<'info>, // PDA ["__event_authority"]pub program: AccountInfo<'info>,}pub fn collect_creator_fee(ctx: Context<CollectCreatorFee>) -> Result<()> {msg!("Instruction: CollectCreatorFee");let creator = &ctx.accounts.creator;// pc 05059: compare creator.owner with a 32-byte constant at 0x1ae07b;// if they are EQUAL -> formatted log + error 6050 (0x17a2), collect_creator_fee.rs:103require!(creator.owner != CONST_1ae07b, PumpError::Code6050);// pc 05083if creator.executable {msg!("Creator account is executable, so it cannot receive lamports");return Err(..);}let rent = Rent::get()?; // fn_32de9let vault_lamports = ctx.accounts.creator_vault.lamports();let vault_min = rent.minimum_balance(0); // (128+0)*5080*1.0 = 650_240 todaylet amount = vault_lamports.saturating_sub(vault_min);if vault_lamports <= vault_min { // pc 050d2msg!("No creator fee to collect");return Err(..);}// pc 050d4: creator must end up rent-exempt for its own sizelet after = creator.lamports().saturating_add(amount);if after < rent.minimum_balance(creator.data_len()) { // pc 050e8msg!("Creator account does not have enough rent-exemption lamports");return Err(..);}// pc 0519d: system transfer vault -> creator, signed by vault PDAsystem_program::transfer(CpiContext::new_with_signer(system_program, Transfer { from: creator_vault, to: creator },&[&[b"creator-vault", creator.key().as_ref(), &[bump]]]),amount)?;// pc 051bc..0521f: emit_cpi! via self-CPI signed by "__event_authority"emit_cpi!(CollectCreatorFeeEvent {timestamp: Clock::get()?.unix_timestamp,creator: creator.key(),creator_fee: amount,});Ok(())}
Replay model
The executable model the agent wrote. Every tally above comes from running it against mainnet.
function model(ctx){// Rent sysvar (read on-chain): lamports_per_byte_year=5080, exemption_threshold=1.0const LPBY = 5080n, THRESH_NUM = 1n; // threshold 1.0const minVault = (128n + 0n) * LPBY * THRESH_NUM; // Rent::minimum_balance(0)const vault = ctx.accounts[1].lamports;if (vault <= minVault) return { lamports: {}, tokens: {} }; // "No creator fee to collect" -> tx failsconst amount = vault - minVault;return { lamports: { 0: amount, 1: -amount }, tokens: {} };}
Accounts
- 0creatorwritten
- 1creator_vaultwritten
- 2system_program
- 3event_authority
- 4program
program 6EF8rr…BEwF6P