In a comment on the sponsor's public Discord, it was confirmed that upon the abort of an offer, the entire collateral is expected to be returned to the maker. The problem is that in the current implementation, this does not work as expected, and the collateral corresponding to the usedPoints
is not returned. I will demonstrate this using the PreMarket.abortAskOffer
function.
First, here is a fragment from the sponsor's comment with a link to it.
https://discord.com/channels/1127263608246636635/1268902639555579954/1270804093463695502
I am also attaching the part of the PreMarket.abortAskOffer
function that shows how the corresponding refund amount is calculated. It is clearly seen that the entire collateral is reduced by the collateral corresponding to the recorded amount of usedPoints
(i.e., the points that were purchased by the taker).
Finally, I am attaching a proof of concept (POC) that demonstrates this in practice.
Loss of funds for the maker and wrong implementation of the contract based on the sponsor's comment
Manual review
Note, #148, #826, #1784 all stems from the fact that order statuses are not appropriately updated when a taker order is created against a maker offer. If the status is switched to `Ongoing/Filled` respectively, the virgin checks will fail appropriately and subsequently all this issues will be fixed. They could possibly be duplicates, so leaving open for appeal. This actually is closely related to issue #148. If a taker has created an Bid/Ask offer agains a original maker offer and the Status is adjusted to Ongoing/Filled accordingly, then this wrong refund won't occur, so could be duplicates, given only Virgin orders can be aborted (same applies for canceled orders, since only virgin orders are supposed to be able to be canceled). Since the status update is incorrect, then if a virgin order that is partially filled is aborted, the collateral is not returned correctly even though the order is not settled, causing a loss of funds to makers.
Note, #148, #826, #1784 all stems from the fact that order statuses are not appropriately updated when a taker order is created against a maker offer. If the status is switched to `Ongoing/Filled` respectively, the virgin checks will fail appropriately and subsequently all this issues will be fixed. They could possibly be duplicates, so leaving open for appeal. This actually is closely related to issue #148. If a taker has created an Bid/Ask offer agains a original maker offer and the Status is adjusted to Ongoing/Filled accordingly, then this wrong refund won't occur, so could be duplicates, given only Virgin orders can be aborted (same applies for canceled orders, since only virgin orders are supposed to be able to be canceled). Since the status update is incorrect, then if a virgin order that is partially filled is aborted, the collateral is not returned correctly even though the order is not settled, causing a loss of funds to makers.
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.