This commit is contained in:
Hardhat Chad
2025-09-22 13:41:32 -07:00
parent 23fe0870dc
commit 38e378f349
4 changed files with 28 additions and 1 deletions

View File

@@ -1,4 +1,6 @@
use ore_api::prelude::*;
use solana_program::log::sol_log;
use spl_token::amount_to_ui_amount;
use steel::*;
/// Claims a block reward.
@@ -43,6 +45,14 @@ pub fn process_claim_ore(accounts: &[AccountInfo<'_>], data: &[u8]) -> ProgramRe
// Normalize amount.
let amount = miner.rewards_ore.min(amount);
sol_log(
&format!(
"Claiming {} ORE",
amount_to_ui_amount(amount, TOKEN_DECIMALS)
)
.as_str(),
);
// Update miner.
miner.rewards_ore -= amount;