wrong math for depositAmount in the abortBidTaker function leads to loss of funds for the users
when the origin offer aborts its own offer by calling the abortAskOffer function, sub-offers of the origin offer are eligible to abort their own by calling the abortBidTaker function. however, they claim 0 amount after that because of the wrong math in the depositAmount calculation
the depositAmount calculation must be stockInfo.points * preOfferInfo.amount / preOfferInfo.points but it's not. since there is a precision for the amount (1e18), this will always be greater than the numerator which leads to 0
The following code demonstrates this scenario by adding it to the Premarkets.t.sol:
Suboffers of the origin offer can't claim their funds after the origin calls the abortAskOffer function
manual review, unit tests
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.