max multiplier

This commit is contained in:
Hardhat Chad
2024-05-14 03:11:47 +00:00
parent a71024cfa1
commit 3cfffdffc0
3 changed files with 4 additions and 4 deletions

View File

@@ -57,7 +57,7 @@ static_assertions::const_assert!(
/// The duration of two years, in minutes. /// The duration of two years, in minutes.
/// Used to calculate the staking reward multiplier. /// Used to calculate the staking reward multiplier.
pub const TWO_YEARS: u64 = 60 * 24 * 365 * 2; pub const ONE_YEAR: u64 = 60 * 24 * 365;
/// The seed of the bus account PDA. /// The seed of the bus account PDA.
pub const BUS: &[u8] = b"bus"; pub const BUS: &[u8] = b"bus";

View File

@@ -38,7 +38,7 @@ pub fn process_deregister<'a, 'info>(
proof_info.realloc(0, true)?; proof_info.realloc(0, true)?;
// Send lamports to signer // Send lamports to signer
**signer.lamports.borrow_mut() = signer.lamports().saturating_add(proof_info.lamports()); **signer.lamports.borrow_mut() += proof_info.lamports();
**proof_info.lamports.borrow_mut() = 0; **proof_info.lamports.borrow_mut() = 0;
Ok(()) Ok(())

View File

@@ -21,7 +21,7 @@ use crate::{
loaders::*, loaders::*,
state::{Bus, Config, Proof}, state::{Bus, Config, Proof},
utils::AccountDeserialize, utils::AccountDeserialize,
EPOCH_DURATION, MIN_DIFFICULTY, ONE_MINUTE, TWO_YEARS, EPOCH_DURATION, MIN_DIFFICULTY, ONE_MINUTE, ONE_YEAR,
}; };
/// Mine is the primary workhorse instruction of the Ore program. Its responsibilities include: /// Mine is the primary workhorse instruction of the Ore program. Its responsibilities include:
@@ -114,7 +114,7 @@ pub fn process_mine<'a, 'info>(
.saturating_add(ONE_MINUTE) .saturating_add(ONE_MINUTE)
.le(&clock.unix_timestamp) .le(&clock.unix_timestamp)
{ {
let upper_bound = reward.saturating_mul(TWO_YEARS); let upper_bound = reward.saturating_mul(ONE_YEAR);
let staking_reward = proof let staking_reward = proof
.balance .balance
.min(upper_bound) .min(upper_bound)