QuantAMM

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

div before mul

Summary

In the getWeights() function in the contractsChannelFollowingUpdateRule, MomentumUpdateRule, PowerChannelUpdateRule, DifferenceMomentumUpdateRule, the calculation performs division before multiplication, which could result in precision loss.

Vulnerability Details

locals.newWeights[locals.i] = ONE.div(locals.denominator).mul(locals.newWeights[locals.i]);

Impact

Unnecessary precision loss when calculating newWeights

Tools Used

manual

Recommendations

locals.newWeights[locals.i] = ONE.mul(locals.newWeights[locals.i]).div(locals.denominator);
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Known issue
Assigned finding tags:

invalid_Rules_getWeights_precision_loss_div_mul

## [Low-24] Divide before multiply

Support

FAQs

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

Give us feedback!