QuantAMM

QuantAMM
49,600 OP
View results
Submission Details
Severity: low
Invalid

Admin Can Reset updateWeightRunner to the Same Address, Leading to Inefficient Gas Usage and Misleading Event Logs

Summary

The current implementation of the setUpdateWeightRunnerAddress allows admin to set the old address (the current value of updateWeightRunner) as the new _updateWeightRunner address, which could remain unchanged since the admin is setting the same value.

Vulnerability Details

If the admin set in the same address as before the system will remain unchanged, this effectively becomes a no-op functionality, as the system behavior remains the same.
The function event will definitely be emitted, but it will log the same address for both the old and new values. This might cause confusion i.e. if logs are being reviewed because it appears as though an update occurred, even though the address didn't change.
Meanwhile the transaction will still consume gas unnecessarily, even though no actual state change occurs.

Impact

Potential misuse: Where by admin might mistakenly think they needed to reset the address.
Gas consumption: Since no actual state changes.
Confusion when event are emitted but log the same address if being reviewed.

Tools Used

Manual review

Recommendations

To prevent this, the function should include a check to ensure the new address is different from the current one

require(_updateWeightRunner != address(updateWeightRunner), "ADDRESS_ALREADY_SET");
Updates

Lead Judging Commences

n0kto Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Informational or Gas / Admin is trusted / Pool creation is trusted / User mistake / Suppositions

Please read the CodeHawks documentation to know which submissions are valid. If you disagree, provide a coded PoC and explain the real likelyhood and the detailed impact on the mainnet without any supposition (if, it could, etc) to prove your point.

Support

FAQs

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