The QuantAMMMathGuard::__clampWeights function does not include a check to verify whether (absoluteMin < absoluteMax) after calculating these values from the weight.length and _absoluteWeightGuardRail.
The funciton missing a check for the value of absoluteMin is always less than absoluteMax.
absoluteMinand absoluteMaxare calcualted from weight.length and _absoluteWeightGuardRailas given below :-
2 Also in the natspec about _absoluteWeightGuardRailsays that these are maximim allowed weight above _guardQuantAMMWeightsfunction. But in _clampWeightsfunction it is assigned to absoluteMin.
Either the NatSpec documentation or the implementation is incorrect.
The value of absoluteMin can be greater than absoluteMax, leading to incorrect calculations downstream.
Incorrect NatSpec documentation or improper assignment of _absoluteWeightGuardRail can also cause further calculation errors.
Manual Review
1 Add a check for value of absoluteMin is always less than absoluteMax
2 Correct the natspce or implementation of _absoluteWeightGuardRail.as needed
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.