The calculation of depositAmount should favor the protocol and be rounded up.
The issue arises because when calculating the depositAmount for a relisted offer, the OfferLibraries.getRefundAmount() function is used. However, this function is designed for refund calculations, which are rounded down (in two instances):
When reused for relisting the offer, the rounding is in the wrong direction as it should be rounded up (in two instances).
This can lead to unexpected behavior, such as a DoS for some users due to a missing dust amount of assets that will be needed later for withdrawals.
Incorrect calculations.
DoS.
Loss of funds.
Manual review.
Calculate depositAmount in the PreMarkets.relistOffer() function by rounding up the calculations if needed. Do not use OfferLibraries.getRefundAmount() for this purpose.
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.