Orders that pass their deadlineTimestamp
still show isActive = true
, even though they can’t be bought. This leads to misleading UX and unnecessary state bloat.
Impact:
Users may see expired orders as active
Increases contract storage usage
Could be abused to spam expired listings
Normal Behavior:
When an order reaches its deadlineTimestamp
, it should no longer be considered active or available for purchase. Ideally, expired orders should be automatically marked as inactive or cleaned up to reflect their status accurately and prevent user confusion or contract bloat.
Specific Issue:
Expired orders remain in an active state even after their deadlineTimestamp
has passed. Although the buyOrder
function correctly prevents purchasing these orders, the order's isActive
flag remains true
, leading to inconsistent state representation and requiring manual cancellation to reflect the correct status.
Likelihood:
This issue will occur whenever a seller creates a sell order and it reaches its deadlineTimestamp
without being filled. In this case, the order remains marked as isActive = true
, even though it can no longer be executed.
The contract does not include any automatic expiration logic, and functions like getOrder
or getOrderDetailsString
do not adjust the status unless cancellation is performed manually. This makes the stale order appear active to frontends, indexers, or external integrations.
Impact:
Stale orders remain active, misleading buyers and UIs into thinking they are valid and fillable, potentially causing failed transactions and poor user experience.
Frontends and third-party integrators may rely on the isActive
flag alone, leading to inaccurate display of order statuses, broken logic in dApps, or wasted gas fees.
Patrick creates a sell order with a short deadline (e.g., 1 minute).
Wait until the deadline passes
Call getOrder(orderId)
and observe:
order.isActive == true
order.deadlineTimestamp < block.timestamp
Attempt to call buyOrder(orderId)
— it reverts with OrderExpired
.
This shows the order is still marked active on-chain, despite being unfillable.
No special setup or exploits are needed this behavior occurs naturally after deadline expiry.
To ensure expired orders cannot be considered "active", update the getOrderDetailsString
function so it correctly reflects expired orders.
The `buyOrder()` function checks if an order is expired but fails to update the `isActive` flag when reverting, causing expired orders to remain marked as active in storage.
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.