QuantAMM

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

Precission loss in `_clampWeights`

Vulnerability Details

In the _clampWeights, there is a div before mul because of which there may be a loss of accuracy when calculating the value when _weights[i] != absoluteMin First sumRemainerWeight.div(sumOtherWeights) which is equal to proportionalRemainder and then _weights[i].mul(proportionalRemainder);

if (sumOtherWeights != 0) {
int256 proportionalRemainder = sumRemainerWeight.div(sumOtherWeights);
for (uint i; i < weightLength; ++i) {
if (_weights[i] != absoluteMin) {
_weights[i] = _weights[i].mul(proportionalRemainder);
}
}
}

Impact

Precission loss when calculating _weights[i]

Tools Used

Manual

Recommendations

_weights[i] = _weights[i].mul.sumRemainerWeight.div(sumOtherWeights)
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!