During bid takers abort of an offer, there is a wrong calculation of the transfer amount that is to be added to the senders token balance.
As we can see in the code snippet, stock points are multiplied with offer points and divided by the offer amount which does not make sense and leads to an incorrect calculation of the transferAmount
.
Incorrect amount is added to the senders token balance introducing a disbalance in the protocols overall funds.
We detect this to be of HIGH severity because funds are lost for users due to mishandling funds (wrong calculation).
manual review
Rewrite the calculation to following:
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.