Core Contracts

Regnum Aurum Acquisition Corp
HardhatReal World AssetsNFT
77,280 USDC
View results
Submission Details
Severity: high
Valid

Incorrect boost calculation scaling leads to dramatically reduced user rewards

Description

The BaseGauge::_applyBoost function incorrectly divides by 1e18 precision when calculating boosted weights, while both baseWeight and boost values use 1e4 (BPS) precision. This results in division by 1e18 instead of 1e4, causing the final boosted weight to be 1e14 times smaller than intended. This severe precision error makes user rewards practically non-existent even with proper veToken balances.

Proof of Concept

Test demonstrating the issue:

Add this test case to BaseGauge.test.js:

it("shows incorrect boost scaling", async () => {
// User 1 has 1000 veRAAC tokens
console.log(await veRAACToken.balanceOf(user1.address));
// Total supply is 1500 veRAAC tokens
console.log(await veRAACToken.totalSupply());
const weight = await baseGauge.getUserWeight(user1.address);
// Faulty calculation in `_applyBoost` result in 0 weight although user has veRAAC tokens
expect(weight).to.be.eq(0); // (e4 * e4) / 1e18 = 0 (rounded down)
});

Comment out this portion in MockBaseGauge.sol:

// // Override boost calculation for testing
// function _applyBoost(address account, uint256 baseWeight) internal view override returns (uint256) {
// return baseWeight; // Return base weight without boost for testing
// }

Impact

High severity - All user rewards are effectively nullified due to precision loss in boost calculations. This completely breaks the core incentive mechanism of the protocol.

Recommendation

  • Fix scaling in boost calculation

- return (baseWeight * boost) / 1e18;
+ return (baseWeight * boost) / 1e4; // Use BPS precision (1e4)
Updates

Lead Judging Commences

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

BaseGauge reward calculations divide by 1e18 despite using 1e4 precision weights, causing all user weights to round down to zero and preventing reward distribution

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!