depositAmount
which is the amount initially deposited by the bid taker to purchase points is wrongly calculated in preMarket::abortBidTaker
as a result of this the can loose a signifcant amount (if not all) of their deposit
PreMarkets::abortBidTaker
incorrectly calculates depositAmount
as seen in the code
https://github.com/Cyfrin/2024-08-tadle/blob/04fd8634701697184a3f3a5558b41c109866e5f8/src/core/PreMarkets.sol#L671-L675
depositAmount
is calculated as stockPoints * offerPoints / offerAmount , which is incorrect and since points have 0 decimal precision the demoniator is way too large , so the result is most likely rounded to zero. Leading to the bid taker loosing their deposited funds.
HIGH - loss of funds for bid taker
Manual Review
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.