Within the abortAskOffer function, there's a subtraction operation that may underflow if transferAmount slightly exceeds totalDepositAmount, particularly when earlier calculations have introduced precision loss.
An underflow in this calculation could lead to an inaccurate makerRefundAmount, resulting in possible financial discrepancies, which may harm users or the platform.
The potential issue is illustrated in the following example:
Link to code
To prevent the underflow, implement a safeguard before performing the subtraction:
This ensures that the subtraction operation is safe and will not result in underflow.
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.