The protocol does not provide a native function for users to cancel a buyOrder
transaction that has been submitted to the mempool. Once a user broadcasts their intent to buy, it is irrevocable from their perspective.
This forces users who have made a mistake or changed their mind to rely on indirect methods like revoking token approvals, which can be easily circumvented by a malicious or rational miner. This architectural omission represents a critical lack of user agency and can lead to significant, forced financial losses.
Likelihood:
A user may wish to cancel a pending buyOrder
for several valid reasons:
They entered the wrong orderId
by mistake.
Market conditions have changed, making the trade no longer desirable.
They have detected that the target order is malicious (e.g., due to an ID preemption attack).
Impact:
In the current design, the user has no reliable way to prevent the transaction from executing. A rational miner can see both the user's buyOrder
and their subsequent attempt to cancel (e.g., approve(..., 0)
) in the mempool and can choose to ignore the cancellation, process the buyOrder
, and claim the transaction fee. The protocol's design fails to provide users with a fundamental safety feature: the ability to retract an unconfirmed action.
The following scenario shows a user, Dan, who mistakenly submits a buyOrder
for Bob's expensive, incorrect order. Dan has no way to cancel this mistaken transaction and is forced into a bad trade.
To fully solve this, the protocol's architecture for trade execution must be redesigned. The recommended approach is to implement a commit-reveal scheme, which provides a natural and secure way for users to cancel their intent.
This involves replacing the direct buyOrder
call with a two-step process:
commit
: The user submits a hash of their intent, hiding the details.
reveal
: The user reveals the details, and the trade executes.
A cancellation function can then be added to allow a user to securely delete their commitment before it is revealed.
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.