Core Contracts

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

Incorrect Base Weight Retrieval in `_getBaseWeight` Function

Summary

The _getBaseWeight function claims to return the base weight for an account but instead retrieves the base weight for the contract itself (address(this)).

Vulnerability Details

The function is defined as:

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

Here, the function takes an account parameter but does not use it. Instead, it calls getGaugeWeight with address(this), which retrieves the base weight for the contract rather than for the specified account.

Impact

Any logic that depends on _getBaseWeight(account) for account-specific calculations will be incorrect, potentially leading to miscalculations in staking rewards, voting power, or other weight-based operations.

Tools Used

  • Manual Code Review

Recommendations

  • If the intention is to fetch the base weight for a specific account, the function should pass account to the getGaugeWeight function, assuming the external contract supports per-account weight retrieval.

  • If the function is only meant to retrieve the gauge weight for the contract itself, the misleading account parameter should be removed to avoid confusion.

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!