ore_api/
consts.rs

1use const_crypto::ed25519;
2use solana_program::{pubkey, pubkey::Pubkey};
3
4/// The authority allowed to initialize the program.
5pub const ADMIN_ADDRESS: Pubkey = pubkey!("HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk");
6
7/// The decimal precision of the ORE token.
8/// There are 100 billion indivisible units per ORE (called "grams").
9pub const TOKEN_DECIMALS: u8 = 11;
10
11/// One ORE token, denominated in indivisible units.
12pub const ONE_ORE: u64 = 10u64.pow(TOKEN_DECIMALS as u32);
13
14/// The duration of one minute, in seconds.
15pub const ONE_MINUTE: i64 = 60;
16
17/// The duration of one hour, in seconds.
18pub const ONE_HOUR: i64 = 60 * ONE_MINUTE;
19
20/// The duration of one day, in seconds.
21pub const ONE_DAY: i64 = 24 * ONE_HOUR;
22
23/// The number of seconds for when the winning square expires.
24pub const ONE_WEEK: i64 = 7 * ONE_DAY;
25
26/// The number of slots in one week.
27pub const ONE_MINUTE_SLOTS: u64 = 150;
28
29/// The number of slots in one hour.
30pub const ONE_HOUR_SLOTS: u64 = 60 * ONE_MINUTE_SLOTS;
31
32/// The number of slots in 12 hours.
33pub const TWELVE_HOURS_SLOTS: u64 = 12 * ONE_HOUR_SLOTS;
34
35/// The number of slots in one day.
36pub const ONE_DAY_SLOTS: u64 = 24 * ONE_HOUR_SLOTS;
37
38/// The number of slots in one week.
39pub const ONE_WEEK_SLOTS: u64 = 7 * ONE_DAY_SLOTS;
40
41/// The number of slots for breather between rounds.
42pub const INTERMISSION_SLOTS: u64 = 35;
43
44/// The maximum token supply (5 million).
45pub const MAX_SUPPLY: u64 = ONE_ORE * 5_000_000;
46
47/// The seed of the automation account PDA.
48pub const AUTOMATION: &[u8] = b"automation";
49
50/// The seed of the board account PDA.
51pub const BOARD: &[u8] = b"board";
52
53/// The seed of the config account PDA.
54pub const CONFIG: &[u8] = b"config";
55
56/// The seed of the miner account PDA.
57pub const MINER: &[u8] = b"miner";
58
59/// The seed of the seeker account PDA.
60pub const SEEKER: &[u8] = b"seeker";
61
62/// The seed of the square account PDA.
63pub const SQUARE: &[u8] = b"square";
64
65/// The seed of the stake account PDA.
66pub const STAKE: &[u8] = b"stake";
67
68/// The seed of the round account PDA.
69pub const ROUND: &[u8] = b"round";
70
71/// The seed of the treasury account PDA.
72pub const TREASURY: &[u8] = b"treasury";
73
74/// Program id for const pda derivations
75const PROGRAM_ID: [u8; 32] = unsafe { *(&crate::id() as *const Pubkey as *const [u8; 32]) };
76
77/// The address of the config account.
78pub const CONFIG_ADDRESS: Pubkey =
79    Pubkey::new_from_array(ed25519::derive_program_address(&[CONFIG], &PROGRAM_ID).0);
80
81/// The address of the mint account.
82pub const MINT_ADDRESS: Pubkey = pubkey!("oreoU2P8bN6jkk3jbaiVxYnG1dCXcYxwhwyK9jSybcp");
83
84/// The address of the sol mint account.
85pub const SOL_MINT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
86
87/// The address to indicate ORE rewards are split between all miners.
88pub const SPLIT_ADDRESS: Pubkey = pubkey!("SpLiT11111111111111111111111111111111111112");
89
90/// The address of the treasury account.
91pub const TREASURY_ADDRESS: Pubkey =
92    Pubkey::new_from_array(ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).0);
93
94/// The address of the treasury account.
95pub const TREASURY_BUMP: u8 = ed25519::derive_program_address(&[TREASURY], &PROGRAM_ID).1;
96
97/// Denominator for fee calculations.
98pub const DENOMINATOR_BPS: u64 = 10_000;
99
100/// The address of the boost reserve token account.
101pub const BOOST_RESERVE_TOKEN: Pubkey = pubkey!("Gce36ZUsBDJsoLrfCBxUB5Sfq2DsGunofStvxFx6rBiD");
102
103/// The fee paid to bots if they checkpoint a user.
104pub const CHECKPOINT_FEE: u64 = 10_000; // 0.00001 SOL