orz/
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/// Capped supply at 21M.
24pub const TOTAL_SUPPLY: u64 = 21000000 * ONE_ORE;
25
26/// The duration of an epoch, in units of seconds.
27pub const EPOCH_DURATION: i64 = 60;
28
29/// The target quantity of ORE to be mined per epoch, in units of nanoORE.
30/// Inflation rate ≈ 1 ORE / epoch (min 0, max 2)
31pub const TARGET_EPOCH_REWARDS: u64 = ONE_ORE;
32
33/// The maximum quantity of ORE that can be mined per epoch, in units of nanoORE.
34pub const MAX_EPOCH_REWARDS: u64 = ONE_ORE.saturating_mul(2);
35
36/// The quantity of ORE each bus is allowed to issue per epoch.
37pub const BUS_EPOCH_REWARDS: u64 = MAX_EPOCH_REWARDS.saturating_div(BUS_COUNT as u64);
38
39/// The number of bus accounts, for parallelizing mine operations.
40pub const BUS_COUNT: usize = 8;
41
42/// The smoothing factor for reward rate changes. The reward rate cannot change by more or less
43/// than a factor of this constant from one epoch to the next.
44pub const SMOOTHING_FACTOR: u64 = 2;
45
46// Assert MAX_EPOCH_REWARDS is evenly divisible by BUS_COUNT.
47static_assertions::const_assert!(
48    (MAX_EPOCH_REWARDS / BUS_COUNT as u64) * BUS_COUNT as u64 == MAX_EPOCH_REWARDS
49);
50
51/// The seed of the bus account PDA.
52pub const BUS: &[u8] = b"bus";
53
54/// The seed of the metadata account PDA.
55pub const METADATA: &[u8] = b"metadata";
56
57/// The seed of the mint account PDA.
58pub const MINT: &[u8] = b"mint";
59
60/// The seed of proof account PDAs.
61pub const PROOF: &[u8] = b"proof";
62
63/// The seed of the treasury account PDA.
64pub const TREASURY: &[u8] = b"treasury";
65
66/// The name for token metadata.
67pub const METADATA_NAME: &str = "Orz";
68
69/// The ticker symbol for token metadata.
70pub const METADATA_SYMBOL: &str = "ORZ";
71
72/// The uri for token metdata.
73pub const METADATA_URI: &str = "https://orz.supply/metadata.json";
74
75/// Noise for deriving the mint PDA.
76pub const MINT_NOISE: [u8; 16] = [
77    166, 199, 85, 221, 225, 119, 21, 185, 160, 82, 242, 237, 194, 84, 250, 252,
78];
79
80/// The addresses of the bus accounts.
81pub const BUS_ADDRESSES: [Pubkey; BUS_COUNT] = [
82    pubkey!("38F53JbVmhu8ApqANgijxMsznrgVykts23qsbQRCR6NF"),
83    pubkey!("JAQ9fh75riwJ56hq9MfZZYYskGEvT6jq3XG5gmSFnGVi"),
84    pubkey!("CB18Ut9cXn6fwgTStdNnYpQWyWZ3VAwq9YDBD1azVKzX"),
85    pubkey!("2M1CoMN7uyjCg3JYcnLs7CYxMRfnabC4aRuPp7QqTRV2"),
86    pubkey!("8WETJQ2KcDcUA7PA2jMzBcPudko2RagQBf6pcXF6rVN4"),
87    pubkey!("CQnmYUJBnTZGT4iQU1iEjBmM1oyMb4h98AoTETrsQqLB"),
88    pubkey!("3WEH5D43hPVyQ2ZicR4ZYf3g8E3wr5na5BnWNEuLroPa"),
89    pubkey!("GqwdPTLizBcDs856CRurPTryWPPiG86YgDd7WbatM2SA"),
90];
91
92/// The address of the mint metadata account.
93pub const METADATA_ADDRESS: Pubkey = pubkey!("Eir4pmjx83z8MAUfTpCCxiAMCiumqKKcwtoZ7aqkPbgu");
94
95/// The address of the mint account.
96pub const MINT_ADDRESS: Pubkey = pubkey!("3eEUXWsvEF3Mrd2m7VWWz9Akk7PirNJi9uZNcG93KoSM");
97
98/// The address of the treasury account.
99pub const TREASURY_ADDRESS: Pubkey = pubkey!("12iUmMQWTzSpmgKxTP1vgWK4h7aBntNe114RdzEpeDz4");