Core Contracts

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

`BaseGauge:_getBaseWeight` is broken causing incorrect reward calculation.

Summary

_getBaseWeight is using address(this) to calculate the weight instead of account.

Vulnerability Details

When a user does any operation in BaseGauge like stake,withdraw,getReward etc. the updateReward modifier is called and it will update the user reward based on stake duration and user weight for gauge. But if you look at the _getBaseWeight which is a function we call in this sequence

updateRewardearnedgetUserWeight_getBaseWeight

function _getBaseWeight(
address account
) internal view virtual returns (uint256) {
return IGaugeController(controller).getGaugeWeight(address(this));
}

As you can see the code is actually trying to get the weight of address(this) in the gauge instead of the account.

Impact

This will cause the incorrect reward calculation for user and user will lose their reward.

Recommendation

Use account instead of address(this) to get the user’s gauge weight.

Updates

Lead Judging Commences

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

BaseGauge._getBaseWeight ignores account parameter and returns gauge's total weight, allowing users to claim rewards from gauges they never voted for or staked in

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

BaseGauge._getBaseWeight ignores account parameter and returns gauge's total weight, allowing users to claim rewards from gauges they never voted for or staked in

Support

FAQs

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

Give us feedback!