mars/
consts.rs

1use solana_program::{keccak::Hash, pubkey, pubkey::Pubkey};
2
3/// The unix timestamp after which mining can begin.
4// Monday, April 23, 2024 2:00:00 PM GMT
5pub const START_AT: i64 = 1713880800;
6
7/// The unix timestamp after which mining will stop.
8// Sunday, April 23, 2029 2:00:00 PM GMT
9pub const END_AT: i64 = 1871647200;
10
11/// The reward rate to intialize the program with.
12pub const INITIAL_REWARD_RATE: u64 = 10 * 10u64.pow(3u32);
13
14/// The mining difficulty to initialize the program with.
15pub const INITIAL_DIFFICULTY: Hash = Hash::new_from_array([
16    0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
17    255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
18]);
19
20/// The decimal precision of the MARS token.
21/// The smallest indivisible unit of MARS is a miraMARS.
22/// 1 miraMARS = 0.00000001 MARS
23pub const TOKEN_DECIMALS: u8 = 8;
24
25/// One MARS token, denominated in units of miraMARS.
26pub const ONE_MARS: u64 = 10u64.pow(TOKEN_DECIMALS as u32);
27
28/// Ten MARS token
29pub const TEN_MARS: u64 = ONE_MARS.saturating_mul(10);
30
31/// The duration of an epoch, in units of seconds.
32pub const EPOCH_DURATION: i64 = 60;
33
34/// The target quantity of MARS to be mined per epoch, in units of miraMARS.
35/// Inflation rate ≈ 10 MARS / epoch (min 0, max 20)
36pub const TARGET_EPOCH_REWARDS: u64 = TEN_MARS;
37
38/// The maximum quantity of MARS that can be mined per epoch, in units of miraMARS.
39pub const MAX_EPOCH_REWARDS: u64 = TEN_MARS.saturating_mul(2);
40
41/// The quantity of MARS each bus is allowed to issue per epoch.
42pub const BUS_EPOCH_REWARDS: u64 = MAX_EPOCH_REWARDS.saturating_div(BUS_COUNT as u64);
43
44/// The number of bus accounts, for parallelizing mine operations.
45pub const BUS_COUNT: usize = 8;
46
47/// The smoothing factor for reward rate changes. The reward rate cannot change by more or less
48/// than a factor of this constant from one epoch to the next.
49pub const SMOOTHING_FACTOR: u64 = 2;
50
51// Assert MAX_EPOCH_REWARDS is evenly divisible by BUS_COUNT.
52static_assertions::const_assert!(
53    (MAX_EPOCH_REWARDS / BUS_COUNT as u64) * BUS_COUNT as u64 == MAX_EPOCH_REWARDS
54);
55
56/// The seed of the bus account PDA.
57pub const BUS: &[u8] = b"bus";
58
59/// The seed of the metadata account PDA.
60pub const METADATA: &[u8] = b"metadata";
61
62/// The seed of the mint account PDA.
63pub const MINT: &[u8] = b"mint";
64
65/// The seed of proof account PDAs.
66pub const PROOF: &[u8] = b"proof";
67
68/// The seed of the treasury account PDA.
69pub const TREASURY: &[u8] = b"treasury";
70
71/// The name for token metadata.
72pub const METADATA_NAME: &str = "Mars";
73
74/// The ticker symbol for token metadata.
75pub const METADATA_SYMBOL: &str = "MARS";
76
77/// The uri for token metdata.
78pub const METADATA_URI: &str = "https://github.com/miraland-labs/resources/blob/main/metadata/mars.json";
79
80/// Noise for deriving the mint PDA.
81// ExtremeWayOnMars
82pub const MINT_NOISE: [u8; 16] = [
83    105, 170, 164, 162, 145, 155, 145, 127, 141, 171, 117, 156, 115, 141, 162, 163,
84];
85
86/// The addresses of the bus accounts.
87pub const BUS_ADDRESSES: [Pubkey; BUS_COUNT] = [
88    pubkey!("6ZcZsUKTv19iFXSnpqjPXzE7joCsEeNpTC5oArFPXzQG"),
89    pubkey!("5jNbJehucBoCov1RkyHJQfMNrjSFG7LYZF79hvjDp4u5"),
90    pubkey!("Ctsj8HbZFe8oqbx3GRfxgz9g1RyTKHeh92UcsabUK6so"),
91    pubkey!("HKo6bDCzHyfYtBtbYeDXs1x3yvDzBWU5EpxhjBWxJB97"),
92    pubkey!("82BDDgQnQeFLjyP1mSpPHRPJdEGkiiZtBqEvjFxYL44W"),
93    pubkey!("CqacmEv1yENenKrZBUPV8LQZrje8ZiBdr8Y3MsEaS3QQ"),
94    pubkey!("Gw4ZkcJkiiLWbqR1qnu2YHg4TsfaEbgUE2Ky721cY1Rv"),
95    pubkey!("DkwXmEda41smeoQiztKopXMQjMW5QYLggddqLUz1Hpck"),
96];
97
98/// The address of the mint metadata account.
99pub const METADATA_ADDRESS: Pubkey = pubkey!("CC8Awvao6Ls5VjREyH78DGPh3SmdjdDZJxTmfsqZmsbJ");
100
101/// The address of the mint account.
102pub const MINT_ADDRESS: Pubkey = pubkey!("7RAV5UPRTzxn46kLeA8MiJsdNy9VKc5fip8FWEgTpTHh");
103
104/// The address of the treasury account.
105pub const TREASURY_ADDRESS: Pubkey = pubkey!("Dk13Cdjnjz2pxbsXbvzJiA2bUSMdsHU7Vf2G8yRGQvwC");