Core Contracts

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

`_getBaseWeight` incorrectly calculates the weight of a user

Summary

The function _getBaseWeight is responsible for retrieving the user's current weight including any boosts. Unfortunately, even though the function accepts the parameter address account, it is not utilised within the execution process. Instead, we retrieve the contract's current gauge weight.

Vulnerability Details

The following line of code exhibits the vulnerability:

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

The account in context may have a balance, like 7500 (per the value in tests used as example via setInitialWeight) whereas the contract could have n leftover, or simply 0, which regardless, demonstrates incorrect accounting.

Impact

This would have a domino effect on functions which utilise this function, such as:

  • getUserWeight, which then negatively reflects on the process of _applyBoost

  • earned() calculation as it uses getUserWeight() within its operation for accounting reasons

  • _updateReward as it executes earned()

Tools Used

Manual review

Recommendations

Correctly address the account and not the contract.

Updates

Lead Judging Commences

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

Give us feedback!