Division before multiplication leads to unnecessary precision loss.
locals.newWeights[locals.i] = ONE.div(locals.denominator).mul(locals.newWeights[locals.i]);
This line of code is introduced in quite a few points in the codebase and will incur minor, but still unnecessary, precision loss.
Instances:
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/rules/AntimomentumUpdateRule.sol#L81C12-L81C63
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/rules/ChannelFollowingUpdateRule.sol#L134
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/rules/DifferenceMomentumUpdateRule.sol#L105
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/rules/MomentumUpdateRule.sol#L82
https://github.com/Cyfrin/2024-12-quantamm/blob/main/pkg/pool-quantamm/contracts/rules/PowerChannelUpdateRule.sol#L96
Minor inaccuracies in weight calculations.
Manual review
Follow the common practise of multiplication before division.
## [Low-24] Divide before multiply
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.