Closed sherlock-admin closed 10 months ago
bulej93
medium
it is not advised to divide before you multiply, this could lead to some kind of precision loss
every time we do some division before multiplication we lose some precision, this can happen if the numeration is smaller than denominator
loss of precision
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/LockingPositionService.sol#L590-L592
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/LockingPositionService.sol#L672-L676
Manual Review
Precision loss with no example required by sherlock rules
In case of issues related to precision loss, there must be a valid POC/example showing the loss to justify the medium/high severity.
bulej93
medium
multiplication after division could lead to precision loss
Summary
it is not advised to divide before you multiply, this could lead to some kind of precision loss
Vulnerability Detail
every time we do some division before multiplication we lose some precision, this can happen if the numeration is smaller than denominator
Impact
loss of precision
Code Snippet
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/LockingPositionService.sol#L590-L592
https://github.com/sherlock-audit/2023-11-convergence/blob/main/sherlock-cvg/contracts/Locking/LockingPositionService.sol#L672-L676
Tool used
Manual Review
Recommendation