In the distributePoints function, a potential risk of precision loss was identified. The specific code in question is:
Precision Loss Risk: In this line of code, the division operation is performed early in the expression pointsPerEpoch.mul(PRECISION_18).div(totalStaked), which can lead to precision loss during the calculation of point distribution.
Cause Analysis: Solidity performs integer division by truncating the decimal portion, meaning any fractional component is discarded. This indicates that all significant digits should be preserved as much as possible before performing the division, thereby minimizing the impact of rounding errors.
precision loss
Manual
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.