Skip to content

Commit 320ac64

Browse files
authored
Merge pull request #2161 from AleoHQ/fix/reward-truncation-and-overflow
[TOB] Remove possible truncation in `block_reward`
2 parents 3f446a7 + 7ac03f7 commit 320ac64

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ledger/block/src/helpers/target.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub const fn block_reward(total_supply: u64, block_time: u16, coinbase_reward: u
2727
// Compute the expected block height at year 1.
2828
let block_height_at_year_1 = block_height_at_year(block_time, 1);
2929
// Compute the annual reward: (0.05 * S).
30-
let annual_reward = (total_supply / 1000) * 50;
30+
let annual_reward = total_supply / 20;
3131
// Compute the block reward: (0.05 * S) / H_Y1.
3232
let block_reward = annual_reward / block_height_at_year_1 as u64;
3333
// Return the sum of the block reward, coinbase reward, and transaction fees.

0 commit comments

Comments
 (0)