Core Contracts

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

[M-05] Unused parameter in BaseGauge's _getBaseWeight() function

Summary

The _getBaseWeight() function doesn't use the account parameter and instead uses address(this) for every call.

Vulnerability Details

The function at any given moment, will give the same result no matter the account for which the weight is asked for.
This is not the intended behaviour as it transpires from the implementation.

Location

Impact

This mistake results in all functions that rely on _getBaseWeight() to give wrong results.
These functions include getUserWeight() and earned(), which are crucial to compute the rewards to be given to the users that interact with the gauge system of the protocol, clearly compromising its functionality.

Tools Used

Manual review.

Recommendations

Use the account address parameter instead of address(this).

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!