Closed sherlock-admin2 closed 1 year ago
Completely wrong recommendation to change formula. Additionally, lack of explicit example to prove precision loss so invalid based on sherlock guidelines
In case of issues related to precision loss, there must be a valid POC/example showing the loss to justify the medium/high severity.
Bauer
medium
The calculation in the secondaryPrizePoolShareBp() function suffers from precision loss
Summary
Vulnerability Detail
This code snippet suffers from potential precision loss due to integer division. The issue arises from the use of integer division in the calculations, which can lead to the truncation of decimal places.
To mitigate this precision loss, it is advisable to refactor the code by performing the multiplication with the constant factor before the division. Specifically, the calculation should be adjusted as follows:
Impact
This leads to inaccuracies in the calculation of the share.
Code Snippet
https://github.com/sherlock-audit/2023-10-looksrare/blob/main/contracts-infiltration/contracts/Infiltration.sol#L1060-L1062
Tool used
Manual Review
Recommendation
The suggested modification for the calculation is as follows: