Core Contracts

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

Incorrect operator in `GaugeController.sol::addGauge()` function.

Title

Incorrect operator in GaugeController.sol::addGauge() function.

Summary

Contract - GaugeController.sol

The addGauge function is used to add new gauge to system, but this function will always fails due to -

if (gaugeType != GaugeType.RWA && gaugeType != GaugeType.RAAC) {
revert InvalidGaugeType();
}
  • as gaugeType cannot be both GaugeType.RWA and GaugeType.RAAC, simultiltanusly. the above condition will always fail.

  • it's because wrong && operator is used, instead of || operator.

Vulnerability Details

Same as above.

Impact

addGauge() will always revert leading to DOS.

Tools Used

Manual

Recommendations

Instead of && operator, use || operator.

if (gaugeType != GaugeType.RWA || gaugeType != GaugeType.RAAC) {
revert InvalidGaugeType();
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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