Core Contracts

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

The addGauge function will never work and always revert

Summary

In the GaugeController the addGauge is ccalled by the gaugeAdmin so that he can add gauges. Two types of Gauges can be added whether RWA or RAAC. However that function wil always revert due to this line here can be seen that the function uses && operator and due to that the function will revert as the caller HAVE to and can only slect one type of GAUGE to add and because that && operator being used the caller will not be able to do so as it enforces that both types should be passed in as the input for gaugeType which is basically impposible here

Vulnerability Details

function addGauge(
address gauge,
GaugeType gaugeType,
uint256 initialWeight
) external onlyGaugeAdmin {
if (gauges[gauge].lastUpdateTime != 0) revert GaugeAlreadyExists();
if (gaugeType != GaugeType.RWA && gaugeType != GaugeType.RAAC) {
revert InvalidGaugeType(); //AUDIT the above will always revert due to wrong operator being used i.e &&
}```
## Impact
Very high, as the gaugeAdmin will never be able to add new gauges, and the gauges are an crucial part of the protocol.
## Tools Used
MAnual Review
## Recommendations
Change the line to this:
`+ if (gaugeType != GaugeType.RWA || gaugeType != GaugeType.RAAC) {`
`- if (gaugeType != GaugeType.RWA && gaugeType != GaugeType.RAAC) {`
Updates

Lead Judging Commences

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

Support

FAQs

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

Give us feedback!