Buyer/Bider receives 0(zero)
collateralToken back when they abortBidTaker()
due to wrong calculation of depositAmount
A user can create
an ask offer using preMarket:createOffer(), then buyer/biders can buy those points using preMarket:createTaker() after paying collateralToken
. Also offerOwner can abort the offer using preMarket:abortAskOffer()
.
Once the offer is aborted, buyer/bider can also abort
their bidTaker using preMarket:abortBidTaker()
, receiving their collateralToken
back which they paid while creating taker. Now the problem is they receives 0(zero) collateralToken back due to wrong calculation of depositAmount
in preMarket:abortBidTaker()
For calculating depostitAmount, stockInfo.points
& preOfferInfo.points
are multiplied(which are simple numbers) and divided by preOfferInfo.amount
(which is in 18 decimals). As result, depositAmount becomes 0(zero) due to rounding
//Here is PoC which shows the above situation
Buyer/Bider loss
all his collateralToken if offer is aborted
Manual Review
Multiply preOfferInfo.amount
& stockInfo.points
then divide them with preOfferInfo.points
Valid high severity, due to incorrect computation of `depositAmount` within `abortBidTaker`, when aborting bid offers created by takers, the collateral refund will be completely wrong for the taker, and depending on the difference between the value of `points` and `amount`, it can possibly even round down to zero, causing definite loss of funds. If not, if points were worth less than the collateral, this could instead be used to drain the CapitalPool contract instead.
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.