This commit is contained in:
Hardhat Chad
2025-09-17 14:59:46 -07:00
parent f8445b3f6f
commit 7c94459df0
8 changed files with 97 additions and 27 deletions

View File

@@ -4,13 +4,14 @@ use steel::*;
#[derive(Clone, Copy, Debug, Eq, PartialEq, TryFromPrimitive)]
pub enum OreInstruction {
// User
ClaimSOL = 0,
ClaimORE = 1,
Initialize = 2,
InitializeSquares = 3,
Prospect = 4,
Redeem = 5,
Reset = 6,
Boost = 0,
ClaimSOL = 1,
ClaimORE = 2,
Initialize = 3,
InitializeSquares = 4,
Prospect = 5,
Redeem = 6,
Reset = 7,
// Admin
SetAdmin = 8,
@@ -20,6 +21,10 @@ pub enum OreInstruction {
ClaimSeeker = 13,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct Boost {}
#[repr(C)]
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimSOL {
@@ -111,6 +116,7 @@ pub struct SetSniperFeeDuration {
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
pub struct ClaimSeeker {}
instruction!(OreInstruction, Boost);
instruction!(OreInstruction, ClaimSOL);
instruction!(OreInstruction, ClaimORE);
instruction!(OreInstruction, Redeem);

View File

@@ -7,6 +7,28 @@ use crate::{
state::*,
};
// let [signer_info, config_info, mint_info, reserve_tokens_info, treasury_info, system_program, token_program] =
pub fn boost(signer: Pubkey) -> Instruction {
let config_address = config_pda().0;
let mint_address = MINT_ADDRESS;
let reserve_tokens_address = BOOST_RESERVE_TOKEN;
let treasury_address = TREASURY_ADDRESS;
Instruction {
program_id: crate::ID,
accounts: vec![
AccountMeta::new(signer, true),
AccountMeta::new(config_address, false),
AccountMeta::new(mint_address, false),
AccountMeta::new(reserve_tokens_address, false),
AccountMeta::new(treasury_address, false),
AccountMeta::new_readonly(system_program::ID, false),
AccountMeta::new_readonly(spl_token::ID, false),
],
data: Boost {}.to_bytes(),
}
}
// let [signer_info, board_info, config_info, mint_info, treasury_info, vault_info, system_program, token_program, associated_token_program] =
pub fn initialize(signer: Pubkey) -> Instruction {

View File

@@ -10,16 +10,18 @@ pub struct Config {
// The address that can set the admin.
pub admin: Pubkey,
// The block duration in slots.
pub block_duration: u64,
// The last boost timestamp.
pub last_boost: i64,
// The duration in slots for which the sniper fee is applied.
#[deprecated(since = "1.0.0", note = "Unused")]
pub sniper_fee_duration: u64,
// The address that receives fees.
pub fee_collector: Pubkey,
// The fee rate taken for each swap.
#[deprecated(since = "1.0.0", note = "Unused")]
pub fee_rate: u64,
}