In the createTaker
function of the PreMarkets contract, there's a risk of precision loss when calculating the transferAmount
. This occurs when offerInfo.points
is significantly larger than _points
, potentially leading to rounding errors.
This precision loss could result in incorrect transfer amounts, potentially leading to financial losses for users or the platform. In extreme cases, users might receive fewer tokens than they should, or the contract might transfer more tokens than intended.
Manual Review
Consider using a larger scale factor for intermediate calculations to minimize precision loss.
Implement a check to ensure that the calculated transferAmount
is within an acceptable range.
Add safeguards to prevent extreme disparities between _points
and offerInfo.points
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.