Petrushka
107 posts

Petrushka
@PetFomo
$PET: The first official launch on Fomo3d Ecosystem
Katılım Eylül 2024
5 Takip Edilen499 Takipçiler

the og petrushka we all know
dexscreener.com/solana/LVwuEvU…
Jarett Reginald Stewart Dunn@STACCoverflow
petrushka coin loading
English

while Fomo3d team is working on snapper, now $PET will also cook on its own without solely depending upon rev thing
use anchor_lang::prelude::*;
use anchor_spl::token::{self, Token, TokenAccount, Transfer};
use solana_program::system_instruction;
declare_id!("YourProgramIDHere");
#[program]
pub mod swap_all_to_sol {
use super::*;
pub fn swap_tokens_to_sol(
ctx: Context,
token_mints: Vec,
amounts: Vec,
) -> Result<()> {
let user = &ctx.accounts.user;
let system_program = &ctx.accounts.system_program;
// Validate inputs
if token_mints.len() != amounts.len() {
return Err(ErrorCode::InvalidInput.into());
}
for i in 0..token_mints.len() {
let token_account = &ctx.remaining_accounts[i];
let mint_address = token_mints[i];
let amount = amounts[i];
// Ensure token account matches the mint
if token_account.key() != mint_address {
return Err(ErrorCode::InvalidTokenAccount.into());
}
// Transfer tokens from user to the program
token::transfer(
CpiContext::new(
ctx.accounts.token_program.to_account_info(),
Transfer {
from: token_account.to_account_info(),
to: ctx.accounts.program_token_account.to_account_info(),
authority: user.to_account_info(),
},
),
amount,
)?;
// Logic for swapping tokens to SOL would go here
// For now, simulate SOL transfer back to the user
invoke(
&system_instruction::transfer(
&ctx.accounts.program_wallet.key,
&user.key,
100_000_000, // Simulated SOL amount (replace with actual swap amount)
),
&[
ctx.accounts.program_wallet.to_account_info(),
user.to_account_info(),
system_program.to_account_info(),
],
)?;
}
Ok(())
}
}
#[derive(Accounts)]
pub struct SwapTokensToSol<'info> {
#[account(mut)]
pub user: Signer<'info>,
/// CHECK: Program wallet for SOL transfers
pub program_wallet: AccountInfo<'info>,
#[account(mut)]
pub program_token_account: Account<'info, TokenAccount>,
pub token_program: Program<'info, Token>,
pub system_program: Program<'info, System>,
}
#[error_code]
pub enum ErrorCode {
#[msg("Invalid input data.")]
InvalidInput,
#[msg("Token account does not match mint address.")]
InvalidTokenAccount,
}
English

All program operations work. I am ready for Launch!
Features are also in the pipeline and we will be adding them one by one and on demand. Please care about FOMO and don’t actually FOMO.
@solanaDOTfun @STACCoverflow @theletzgodude
English

Little does everyone realize 1% protocol revenue is much more than 1/4 the shit coin casino revenue alone
study the lore $Pet
Jarett Reginald Stewart Dunn@STACCoverflow
Little does everyone realize 1% protocol revenue is much more than 1/4 the shit coin casino revenue alone Pet
English

The lore goes on $PET
OShield 🛡️@oshield_io
We are excited to announce the audit completion of the Gobber DEX by @FOMO3DdotAPP This is a special one as our CEO @madinterndude took over the project halfway through, and we call the audit a Goldit. It documents both the Gobbler swap logic and the math behind it alongside our usual vulnerability analysis.
English



