Core Contracts

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

BaseGauge's getBaseWeight ignores user account parameter, causing incorrect reward distribution

Summary

BaseGauge's _getBaseWeight function ignores the user's account parameter and returns the gauge's weight instead, leading to incorrect reward calculations for all users.

Vulnerability Details

In the BaseGauge contract, the _getBaseWeight function incorrectly uses address(this) instead of the provided account parameter:

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

This affects the reward calculation on earned function and

function earned(address account) public view returns (uint256) {
return (getUserWeight(account) *
(getRewardPerToken() - userStates[account].rewardPerTokenPaid) / 1e18
) + userStates[account].rewards;
}

getUserWeight function

function getUserWeight(address account) public view virtual returns (uint256) {
uint256 baseWeight = _getBaseWeight(account);
return _applyBoost(account, baseWeight);
}

Impact

All users receive rewards based on gauge weight instead of their individual weights and incorrect rewards will be distributed across all users.

Tools Used

Manual Review

Recommendations

Correct the _getBaseWeight function to use the account parameter

Updates

Lead Judging Commences

inallhonesty Lead Judge 4 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 4 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.