The OrderBook contract allows users to create time-limited sell orders, but once the order passes its deadlineTimestamp, it is never automatically marked inactive or removed from the orders mapping unless the seller explicitly calls cancelOrder(). There is no mechanism to clean up expired but unfilled orders.
Missing cleanup logic for expired orders.
The OrderBook contract allows users to create time-limited sell orders, but once the order passes its deadlineTimestamp, it is never automatically marked inactive or removed from the orders mapping unless the seller explicitly calls cancelOrder(). There is no mechanism to clean up expired but unfilled orders.
Likelihood:
There is no automatic cleanup for expired orders
Sellers have no incentive to cancel their expired listings
Users can forget or abandon their orders
Frontend interfaces may not warn about expired-but-active orders
Over time, any live deployment will accumulate stale data unless actively purged
Impact:
Orders are tracked using a monotonically increasing _nextOrderId counter.
All created orders (expired, cancelled, filled) remain in the orders mapping permanently.
Expired but unfilled orders retain the isActive = true status, even when they’re no longer fulfillable.
There is no off-chain incentive or on-chain mechanism to clean them up.
In the long term, orderId inflation and stale storage negatively impact:Proof of Concept
Copy this and paste in the test file it shows that expired orders just accumulate in the contract
check for expired orders and set them to false
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.