ore/
consts.rs

1use solana_program::{keccak::Hash, pubkey, pubkey::Pubkey};
2
3/// The unix timestamp after which mining can begin.
4pub const START_AT: i64 = 1712070600;
5
6/// The reward rate to intialize the program with.
7pub const INITIAL_REWARD_RATE: u64 = 10u64.pow(3u32);
8
9/// The mining difficulty to initialize the program with.
10pub const INITIAL_DIFFICULTY: Hash = Hash::new_from_array([
11    0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
12    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
13]);
14
15/// The decimal precision of the ORE token.
16/// Using SI prefixes, the smallest indivisible unit of ORE is a nanoORE.
17/// 1 nanoORE = 0.000000001 ORE = one billionth of an ORE
18pub const TOKEN_DECIMALS: u8 = 9;
19
20/// One ORE token, denominated in units of nanoORE.
21pub const ONE_ORE: u64 = 10u64.pow(TOKEN_DECIMALS as u32);
22
23/// The duration of an epoch, in units of seconds.
24pub const EPOCH_DURATION: i64 = 60;
25
26/// The target quantity of ORE to be mined per epoch, in units of nanoORE.
27/// Inflation rate ≈ 1 ORE / epoch (min 0, max 2)
28pub const TARGET_EPOCH_REWARDS: u64 = ONE_ORE;
29
30/// The maximum quantity of ORE that can be mined per epoch, in units of nanoORE.
31pub const MAX_EPOCH_REWARDS: u64 = ONE_ORE.saturating_mul(2);
32
33/// The quantity of ORE each bus is allowed to issue per epoch.
34pub const BUS_EPOCH_REWARDS: u64 = MAX_EPOCH_REWARDS.saturating_div(BUS_COUNT as u64);
35
36/// The number of bus accounts, for parallelizing mine operations.
37pub const BUS_COUNT: usize = 8;
38
39/// The smoothing factor for reward rate changes. The reward rate cannot change by more or less
40/// than a factor of this constant from one epoch to the next.
41pub const SMOOTHING_FACTOR: u64 = 2;
42
43// Assert MAX_EPOCH_REWARDS is evenly divisible by BUS_COUNT.
44static_assertions::const_assert!(
45    (MAX_EPOCH_REWARDS / BUS_COUNT as u64) * BUS_COUNT as u64 == MAX_EPOCH_REWARDS
46);
47
48/// The seed of the bus account PDA.
49pub const BUS: &[u8] = b"bus";
50
51/// The seed of the metadata account PDA.
52pub const METADATA: &[u8] = b"metadata";
53
54/// The seed of the mint account PDA.
55pub const MINT: &[u8] = b"mint";
56
57/// The seed of proof account PDAs.
58pub const PROOF: &[u8] = b"proof";
59
60/// The seed of the treasury account PDA.
61pub const TREASURY: &[u8] = b"treasury";
62
63/// The name for token metadata.
64pub const METADATA_NAME: &str = "Ore";
65
66/// The ticker symbol for token metadata.
67pub const METADATA_SYMBOL: &str = "ORE";
68
69/// The uri for token metdata.
70pub const METADATA_URI: &str = "https://ore.supply/metadata.json";
71
72/// Noise for deriving the mint PDA.
73pub const MINT_NOISE: [u8; 16] = [
74    166, 199, 85, 221, 225, 119, 21, 185, 160, 82, 242, 237, 194, 84, 250, 252,
75];
76
77/// The addresses of the bus accounts.
78pub const BUS_ADDRESSES: [Pubkey; BUS_COUNT] = [
79    pubkey!("9ShaCzHhQNvH8PLfGyrJbB8MeKHrDnuPMLnUDLJ2yMvz"),
80    pubkey!("4Cq8685h9GwsaD5ppPsrtfcsk3fum8f9UP4SPpKSbj2B"),
81    pubkey!("8L1vdGdvU3cPj9tsjJrKVUoBeXYvAzJYhExjTYHZT7h7"),
82    pubkey!("JBdVURCrUiHp4kr7srYtXbB7B4CwurUt1Bfxrxw6EoRY"),
83    pubkey!("DkmVBWJ4CLKb3pPHoSwYC2wRZXKKXLD2Ued5cGNpkWmr"),
84    pubkey!("9uLpj2ZCMqN6Yo1vV6yTkP6dDiTTXmeM5K3915q5CHyh"),
85    pubkey!("EpcfjBs8eQ4unSMdowxyTE8K3vVJ3XUnEr5BEWvSX7RB"),
86    pubkey!("Ay5N9vKS2Tyo2M9u9TFt59N1XbxdW93C7UrFZW3h8sMC"),
87];
88
89/// The address of the mint metadata account.
90pub const METADATA_ADDRESS: Pubkey = pubkey!("2nXZSxfjELuRatcoY64yHdFLZFi3mtesxobHmsoU3Dag");
91
92/// The address of the mint account.
93pub const MINT_ADDRESS: Pubkey = pubkey!("oreoN2tQbHXVaZsr3pf66A48miqcBXCDJozganhEJgz");
94
95/// The address of the treasury account.
96pub const TREASURY_ADDRESS: Pubkey = pubkey!("FTap9fv2GPpWGqrLj3o4c9nHH7p36ih7NbSWHnrkQYqa");