When calculating how much amount to deposit for the number of points being bought, the createTaker
function actually gets the ratio of amount to points to get how much each point is worth, to know the amount for the taker to deposit, but in the abort bidTaker the same implemenation to get the amount to remove is not done, which return a wrong deposit amount back for the user to withdraw
Simple explanation to exhibit the issue
This is the correct calculation in createTaker
which if we do the calculations here,
points -1000 amount-10000, _points-600
600* 10000/1000 = 6000 -- The user will deposit 6000 amount to get 600 points
Now lets see the same implementation in abortBidTaker
Following this we see that the calculation would be
600 * 1000/10000 = 60
60 as amount is used to get the 72 total amount from the calculation below with the collateral
Which will be added to the MakerRefund and the stockInfoStatus will be set to finshed
Since the function is meant to help takers retrive their collateral if they are aborting, returning a wrong amount will lead to loss of fund since the stock status is set to finished at the end of the calculations
Manual Review
This formula should be used
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.