Core Contracts

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

Incorrect Account Weight Retrieval in BaseGauge Leads to Inaccurate Reward Distribution

Summary:

The BaseGauge contract's _getBaseWeight function incorrectly returns the gauge's weight instead of the user's account weight, causing reward calculations to be based on incorrect weights and leading to improper reward distributions.

Vulnerability Details:

In the BaseGauge contract:

function _getBaseWeight(address account) internal view virtual returns (uint256) {
// ❌ WRONG: Returns gauge weight instead of account weight
return IGaugeController(controller).getGaugeWeight(address(this));
}
// This incorrect weight propagates through the reward calculation chain:
function getUserWeight(address account) public view virtual returns (uint256) {
uint256 baseWeight = _getBaseWeight(account); // Gets wrong weight
return _applyBoost(account, baseWeight);
}
function earned(address account) public view returns (uint256) {
// Uses incorrect weight in calculations
return (getUserWeight(account)
(getRewardPerToken() - userStates[account].rewardPerTokenPaid) / 1e18
) + userStates[account].rewards;
}

The issue occurs because:

  1. _getBaseWeight ignores its account parameter

  2. Returns gauge contract's weight instead of account-specific weight

  3. This incorrect weight is used in reward calculations

  4. All users' rewards are calculated using the same base weight

Impact:

  • Incorrect reward distribution to all users

  • Users receive rewards based on gauge weight rather than individual weights

  • Breaks the intended reward distribution mechanism

  • Economic impact on user rewards

  • Potential for unfair reward allocations

Tools Used:

Manual code review

Recommendations:

Use account parameter to get correct weight in _getBaseWeight.

Updates

Lead Judging Commences

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

BaseGauge::earned calculates rewards using getUserWeight instead of staked balances, potentially allowing users to claim rewards by gaining weight without proper reward checkpoint updates

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

BaseGauge::earned calculates rewards using getUserWeight instead of staked balances, potentially allowing users to claim rewards by gaining weight without proper reward checkpoint updates

Support

FAQs

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