This commit is contained in:
Hardhat Chad
2024-04-30 18:23:53 +00:00
parent 54bd0a025c
commit 42b81b1d0f
3 changed files with 4 additions and 5 deletions

View File

@@ -16,6 +16,7 @@ use solana_program::{
// TODO Admin fn for min difficulty?
// TODO Admin fn for spam/liveness tolerances?
// TODO Alternative to bincode?
// TODO Is downgrade necessary?
declare_id!("mineRHF5r6S7HyD9SppBfVMXMavDkJsxwGesEvxZr2A");

View File

@@ -94,7 +94,7 @@ pub fn process_mine<'a, 'info>(
.saturating_mul(2u64.saturating_pow(difficulty));
sol_log(&format!("Base {}", reward));
// Apply staking multiplier, only if last deposit was at least 1 block ago to prevent flash loan attacks
// Apply staking multiplier, only if last deposit was at least 1 block ago to prevent flash loan attacks.
if clock.slot.gt(&proof.last_deposit_slot) {
// TODO Move staking requirement into config? Admin adjustable?
let max_stake = reward.saturating_mul(TWO_YEARS);

View File

@@ -15,12 +15,10 @@ pub struct Bus {
/// The ID of the bus account.
pub id: u64,
// TODO Update logic to count up rather than down
/// The quantity of rewards this bus can issue in the current epoch epoch.
/// The quantity of rewards this bus has left to issue in the current epoch epoch.
pub rewards: u64,
// TODO Come up with better name
/// The rewards that would have been paid out this epoch if the bus had no limit.
/// The rewards that would have been paid out by this bus in the current epoch if the bus had no limit.
pub theoretical_rewards: u64,
}