The createOffer()
function in the PreMarkets
contract contains an inconsistency where params.amount
, which represents the amount a user wants to sell or buy, is directly assigned to StockInfo.amount
. However, StockInfo.amount
should represent the collateral amount
used for a sell or buy order.
Inconsistency in createOffer()
Function: The function assigns params.amount
directly to StockInfo.amount.
However, StockInfo.amount
should represent the collateral amount
, not the amount the user wants to trade.
This creates inconsistency in the assignment opening ways for more calculations issues where this value is utilized.
Manual Review
Use the calculated collateral amount (transferAmount
) based on params.amount
and assign it to StockInfo.amount
.
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.