In PreMarkets we have abortOffer
which is used to by createOffer(ask) or listOffer() creators to abort the ongoing deal.
If the offer is still Virgin
and no deals have been conducted, then there are no issues as the entire amount submitted as collateral needs to be refunded.
however, when the some points are used i.e ideally the offerstatus should set to Ongoing
, however it is never set so in the contract.
Thus despite having fare share of offers matched, the creater can still call abort and get entire amount as refund.
As per the code snippet below, lets say if a user lists 2000 points for 50 usdc and has 40 usdc worth of trades matched, hence the usedPoints
will be (4/5) * 2000, 1600, however since the status is bever changed, the remaining amount will still be 2000.
This will cause issue in calculating further data as transferAmount
is dependent on remainingAmount
and so on.
At the end the makerRefund amount will be excessive and this can be used by the taker to start draining the capital pool
Change the code to following:
Whenever the createTaker()
is executed, change the offerStatus from Virgin to Ongoing!
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.