QuantAMM

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

The `DifferenceMomentumUpdateRule::_getWeights` function contains an empty for loop with no functionality.

Summary

The DifferenceMomentumUpdateRule::_getWeights function has an empty for loop implementation with no functionality.

Vulnerability Details

The _getWeightsfunction contain empty for loop with no functionalities.

If the for loop is intended to perform calculations or operations, leaving it empty can be very dangerous for the contract, as it could lead to unintended behavior or skipped critical logic.

https://github.com/Cyfrin/2024-12-quantamm/blob/a775db4273eb36e7b4536c5b60207c9f17541b92/pkg/pool-quantamm/contracts/rules/DifferenceMomentumUpdateRule.sol#L90

for (uint i; i < newShortMovingAverages.length; ) {
unchecked {
++i;
}
}

Impact

Leaving a for loop empty, which is intended to perform calculations, can cause errors in contract calculations and lead to incorrect behavior.

Tools Used

Manual Review

Recommendations

  1. if redundant remove the for loop

  2. if some calculation has to perform update the for loop in that way.

Updates

Lead Judging Commences

n0kto Lead Judge 10 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.

Give us feedback!