mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-14 07:26:51 +00:00
update consts
This commit is contained in:
@@ -6,7 +6,7 @@ use solana_program::{pubkey, pubkey::Pubkey};
|
||||
pub const INITIALIZER_ADDRESS: Pubkey = pubkey!("HBUh9g46wk2X89CvaNN15UmsznP59rh6od1h8JwYAopk");
|
||||
|
||||
/// The base reward rate to intialize the program with.
|
||||
pub const INITIAL_BASE_REWARD_RATE: u64 = 2u64.pow(6);
|
||||
pub const INITIAL_BASE_REWARD_RATE: u64 = BASE_REWARD_RATE_MIN_THRESHOLD;
|
||||
|
||||
/// The minimum allowed base reward rate, at which point the min difficulty should be increased
|
||||
pub const BASE_REWARD_RATE_MIN_THRESHOLD: u64 = 2u64.pow(5);
|
||||
@@ -18,7 +18,7 @@ pub const BASE_REWARD_RATE_MAX_THRESHOLD: u64 = 2u64.pow(8);
|
||||
pub const TOLERANCE: i64 = 5;
|
||||
|
||||
/// The minimum difficulty to initialize the program with.
|
||||
pub const INITIAL_MIN_DIFFICULTY: u32 = 8;
|
||||
pub const INITIAL_MIN_DIFFICULTY: u32 = 1;
|
||||
|
||||
/// The decimal precision of the ORE token.
|
||||
/// There are 100 billion indivisible units per ORE (called "grains").
|
||||
|
||||
@@ -109,7 +109,7 @@ pub fn process_reset<'a, 'info>(
|
||||
}
|
||||
|
||||
// If base reward rate is too high, then decrement difficulty by 1 and halve base reward rate
|
||||
if config.base_reward_rate.ge(&BASE_REWARD_RATE_MAX_THRESHOLD) && config.min_difficulty.gt(&0) {
|
||||
if config.base_reward_rate.ge(&BASE_REWARD_RATE_MAX_THRESHOLD) && config.min_difficulty.gt(&1) {
|
||||
config.min_difficulty = config.min_difficulty.checked_sub(1).unwrap();
|
||||
config.base_reward_rate = config.base_reward_rate.checked_div(2).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user