In the _depositTokenWhenCreateTaker
function, rounding inconsistencies can lead to slight inaccuracies in deposit amounts. Specifically, the getDepositAmount
function utilizes Math.Rounding.Ceil
, but additional fees are added without aligning with this rounding method.
These inconsistencies may result in users being charged slightly more than required for their deposits. Although each discrepancy might be small, repeated transactions could cause an unfair accumulation of extra funds within the contract.
The following demonstrates the rounding inconsistency:
Link to code
Ensure consistent rounding throughout the calculations:
Consider adopting a more precise calculation method to minimize rounding errors.
Duplicate of #456, however, for issues noting rounding directions, will be low severity given the impact is not proven sufficiently with a PoC/numerical example and most rounding will not result in significant losses e.g. most examples only proved at most a 1 wei difference when computing `depositAmount/platFormFees` and involves lower amount offers
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.