The abortAskOffer
function allows an ask offer maker to abort their offer and reclaim their collateral(+ if no sub-trades have occurred in the case of Turbo
mode). The intended behavior of this function is to refund the offer maker with their full collateral, and all ongoing deals with existing takers should be aborted, as confirmed by the sponsor's clarification in the contest channel:
As highlighted in the sponsor's message: The Maker get all the collateral fund back
However, the current implementation of the function does not refund the maker with their full collateral:
In the snippet above, the offer maker is only refunded with the unused portion of the amount (the margin), while the transferAmount
represents the unused amount and the totalDepositAmount
represents the used points amount:
Note: Ignore the incorrect calculation of
remainingAmount
when the offer is not in theVirgin
status, as it should be based onofferInfo.points - offerInfo.usedPoints
, notofferInfo.usedPoints
. Still, the intended is thatremainingAmount
represents the amount of the unused points
The abortAskOffer
function is not working as intended and fails to refund the ask offer maker with the full collateral they initially deposited.
Manual Review
Ensure that the ask offer maker is refunded with their entire collateral when aborting the ask offer, as originally intended.
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.