ore_boost_api/
consts.rs

1use const_crypto::ed25519;
2use solana_program::{pubkey, pubkey::Pubkey};
3
4/// The authority allowed to initialize the program.
5pub const INITIALIZER_ADDRESS: Pubkey = pubkey!("HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk");
6
7/// The denominator of boost multipliers for percentage calculations.
8pub const BOOST_DENOMINATOR: u64 = 1000;
9
10/// The number of attempts (random samples) a miner gets to reserve a boost multiplier.
11pub const ROTATION_SAMPLE_COUNT: u64 = 15;
12
13/// The seed of the boost PDA.
14pub const BOOST: &[u8] = b"boost";
15
16/// The seed of the config PDA.
17pub const CONFIG: &[u8] = b"config";
18
19/// The seed of the stake PDA.
20pub const STAKE: &[u8] = b"stake";
21
22/// The seed of the directory PDA.
23pub const DIRECTORY: &[u8] = b"directory";
24
25/// The seed of the checkpoint PDA.
26pub const CHECKPOINT: &[u8] = b"checkpoint";
27
28/// The seed of the reservation PDA.
29pub const RESERVATION: &[u8] = b"reservation";
30
31/// The time interval between checkpoints (in seconds)
32pub const CHECKPOINT_INTERVAL: i64 = 3600; // 1 hour
33
34/// Program ID for const pda derivations
35const PROGRAM_ID: [u8; 32] = unsafe { *(&crate::id() as *const Pubkey as *const [u8; 32]) };
36
37/// The address of the config account.
38pub const CONFIG_ADDRESS: Pubkey =
39    Pubkey::new_from_array(ed25519::derive_program_address(&[CONFIG], &PROGRAM_ID).0);