Incorrect logic will return wrong depositAmount
in PreMarkets::abortBidTaker()
.
In PreMarkets::abortBidTaker()
the deposit amount is calculated incorrectly. The current logic looks like this:
Assume, stockInfo.points = 100, preOfferInfo.points = 1000 & preOfferInfo.amount = 2000. It means price of 1 point is 2. If we follow the current implementation & put it to Math.sol::mulDiv() then we will get this:
But it is wrong, for 100 points the deposit amount should be 200 because price of 1 point is 2.
Wrong depositAmount
will be calculated.
Manual review, Chisel
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.