The OrderBook
contract does not automatically return tokens from expired orders. Sellers must manually call cancelSellOrder
to retrieve their tokens after an order's deadlineTimestamp
has passed. This can lead to tokens becoming permanently locked within the contract if sellers fail to perform this manual cancellation.
Root Cause: The contract relies solely on explicit seller action (cancelSellOrder
) to retrieve tokens from orders that have passed their deadline, leading to potential token stagnation.
Solidity
Likelihood: Medium. Users frequently forget or deem it uneconomical (due to gas fees) to perform cleanup transactions for small or expired amounts.
Impact: Low to Medium.
Economic Inefficiency: Seller's capital remains idle and inaccessible within the contract.
Poor User Experience: Sellers face additional steps and potential gas costs to retrieve their own funds.
Misleading TVL: The contract might show a higher Total Value Locked (TVL) than what is actively tradable, due to locked, expired tokens.
Seller A
creates an order for 100 WETH
with a deadlineTimestamp
.
The deadlineTimestamp
passes, and the order expires.
No one can fill Seller A
's order.
Seller A
does not call cancelSellOrder(orderId)
.
Result: The 100 WETH
remains locked indefinitely in the OrderBook
contract, inaccessible to Seller A
without a manual cancellation.
Introduce a dedicated function or modify cancelSellOrder
to explicitly facilitate claiming tokens from expired orders without requiring an "active" status beyond the deadline.
Option 1 (Modify cancelSellOrder
): Adjust the logic to allow cancellation for both active orders and those that are expired but not yet marked inactive.
Diff
Option 2 (New claimExpiredOrder
function - cleaner separation): Add a specific function for claiming only expired orders.
Solidity
Reference Files:
src/OrderBook.sol
By design only `seller` can call `cancelSellOrder()` on their `order`. But when an `order` expires, and the `seller` doesn't have access to the protocol, the expired `order `should be be able to be cancelled by an `admin`.
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.