mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-16 15:10:20 +00:00
sniper fee duration
This commit is contained in:
@@ -67,6 +67,9 @@ pub const DENOMINATOR_BPS: u64 = 10_000;
|
||||
/// Window to submit hashes, in slots.
|
||||
pub const INITIAL_BLOCK_DURATION: u64 = 1500;
|
||||
|
||||
/// Window to submit hashes, in slots.
|
||||
pub const INITIAL_SNIPER_FEE_DURATION: u64 = 100;
|
||||
|
||||
/// Window to submit hashes, in slots.
|
||||
pub const MINING_WINDOW: u64 = 1500;
|
||||
|
||||
|
||||
@@ -54,9 +54,7 @@ pub struct Initialize {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
pub struct Log {
|
||||
pub block_id: [u8; 8],
|
||||
}
|
||||
pub struct Log {}
|
||||
|
||||
#[repr(C)]
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
|
||||
@@ -2,16 +2,13 @@ use spl_associated_token_account::get_associated_token_address;
|
||||
use steel::*;
|
||||
|
||||
use crate::{
|
||||
consts::{BLOCK, MINT_ADDRESS, TREASURY_ADDRESS},
|
||||
consts::{MARKET, MINT_ADDRESS, TREASURY_ADDRESS},
|
||||
instruction::*,
|
||||
state::*,
|
||||
};
|
||||
|
||||
pub fn log(signer: Pubkey, block_id: u64, msg: &[u8]) -> Instruction {
|
||||
let mut data = Log {
|
||||
block_id: block_id.to_le_bytes(),
|
||||
}
|
||||
.to_bytes();
|
||||
pub fn log(signer: Pubkey, msg: &[u8]) -> Instruction {
|
||||
let mut data = Log {}.to_bytes();
|
||||
data.extend_from_slice(msg);
|
||||
Instruction {
|
||||
program_id: crate::ID,
|
||||
@@ -20,17 +17,8 @@ pub fn log(signer: Pubkey, block_id: u64, msg: &[u8]) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn program_log(
|
||||
block_id: u64,
|
||||
accounts: &[AccountInfo],
|
||||
msg: &[u8],
|
||||
) -> Result<(), ProgramError> {
|
||||
invoke_signed(
|
||||
&log(*accounts[0].key, block_id, msg),
|
||||
accounts,
|
||||
&crate::ID,
|
||||
&[BLOCK, &block_id.to_le_bytes()],
|
||||
)
|
||||
pub fn program_log(accounts: &[AccountInfo], msg: &[u8]) -> Result<(), ProgramError> {
|
||||
invoke_signed(&log(*accounts[0].key, msg), accounts, &crate::ID, &[MARKET])
|
||||
}
|
||||
|
||||
pub fn mine(signer: Pubkey, authority: Pubkey, id: u64, nonce: u64) -> Instruction {
|
||||
|
||||
@@ -13,6 +13,9 @@ pub struct Config {
|
||||
// The block duration in slots.
|
||||
pub block_duration: u64,
|
||||
|
||||
// The duration in slots for which the sniper fee is applied.
|
||||
pub sniper_fee_duration: u64,
|
||||
|
||||
// The address that receives fees.
|
||||
pub fee_collector: Pubkey,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user