From 7cd26298b0088ac337a894f6bf2d26bb0e30b40b Mon Sep 17 00:00:00 2001 From: Hardhat Chad Date: Tue, 23 Jul 2024 15:12:52 +0000 Subject: [PATCH] update consts --- api/src/consts.rs | 4 ++-- program/src/reset.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/src/consts.rs b/api/src/consts.rs index e45eabc..5ae12b9 100644 --- a/api/src/consts.rs +++ b/api/src/consts.rs @@ -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"). diff --git a/program/src/reset.rs b/program/src/reset.rs index 7c53c57..6ca36ad 100644 --- a/program/src/reset.rs +++ b/program/src/reset.rs @@ -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(); }