QuantAMM

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

An empty loop in DifferenceMomentumUpdateRule.sol#_getWeights.

Summary

There is an empty loop in the function _getWeights, which seems to be due to the lack of a check for newShortMovingAverages.

Vulnerability Details

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

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

There is an empty loop in the function _getWeights. Maybe the project owner forgot to delete this code, or maybe they missed the check for newShortMovingAverages.

Impact

Leaving unused code behind or missing some critical checks, such as missing a check on newShortMovingAverages.

Tools Used

VScode

Recommendations

Confirm this code.

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!