spam/
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, 255, 255, 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 SPAM token.
16/// Using SI prefixes, the smallest indivisible unit of SPAM is a nanoSPAM.
17/// 1 nanoSPAM = 0.000000001 SPAM = one billionth of an SPAM
18pub const TOKEN_DECIMALS: u8 = 9;
19
20/// One SPAM token, denominated in units of nanoSPAM.
21pub const ONE_SPAM: 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 SPAM to be mined per epoch, in units of nanoSPAM.
27/// Inflation rate ≈ 1 SPAM / epoch (min 0, max 2)
28pub const TARGET_EPOCH_REWARDS: u64 = ONE_SPAM;
29
30/// The maximum quantity of SPAM that can be mined per epoch, in units of nanoSPAM.
31pub const MAX_EPOCH_REWARDS: u64 = ONE_SPAM.saturating_mul(2);
32
33/// The quantity of SPAM 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 mint account PDA.
52pub const MINT: &[u8] = b"mint";
53
54/// The seed of proof account PDAs.
55pub const PROOF: &[u8] = b"proof";
56
57/// The seed of the treasury account PDA.
58pub const TREASURY: &[u8] = b"treasury";
59
60/// Noise for deriving the mint PDA.
61pub const MINT_NOISE: [u8; 16] = [
62    210, 212, 200, 30, 119, 36, 136, 231, 233, 213, 138, 58, 17, 208, 176, 157
63];
64
65/// The addresses of the bus accounts.
66pub const BUS_ADDRESSES: [Pubkey; BUS_COUNT] = [
67    pubkey!("DzLpPA3uYgTzSnCJDamwKhKzYyKKPraN1SJdv3hboBMB"),
68    pubkey!("2Zn77yZspohsPkLP9zcWX3dxuQ69dTRNyJciVEDENJh3"),
69    pubkey!("4p8nEz7XMayiAkHYCrgs5WPWv4DUAxzcKpzX4X1Lyf61"),
70    pubkey!("5g6DanqLyEwEm2zrbJCR67g4NwGMNwPcF6gB9AqbxncJ"),
71    pubkey!("8ktdXVusqMvNHkZmUnSoRy2kjQEsVsGC387K9vXL2Q6"),
72    pubkey!("DrKC38wdpumpkJwPLEa7yky9su1v82Ng2kNPy7UMt5fa"),
73    pubkey!("CM6ergyxwT2kKaGD2EMXwgi8KBKDa5sCZESWRhhqRT1z"),
74    pubkey!("F9kpy13nmNkxGUA5riGbAkLkR6Ky62LgiydUD5AfTEKm"),
75];
76
77/// The address of the mint account.
78pub const MINT_ADDRESS: Pubkey = pubkey!("spamwgqKEBE2BtsfE2QesxpmYZZKp3LfHsEdF1MLpfU");
79
80/// The address of the treasury account.
81pub const TREASURY_ADDRESS: Pubkey = pubkey!("3amHhT6cLgvfjKWbka6DYjs9zS5pLFnmYw1g8C6DPa4x");