OrderBook

First Flight #43
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

Order Expiry Lock (Denial of Funds)

Description

Problem

  • If a seller forgets or is unable to cancel an expired order, their tokens are locked forever.

Chained Risk:

  • If the seller is a contract that is later destroyed or blacklisted, tokens can never be withdrawn.

// Only the seller can cancel an expired order
function cancelSellOrder(uint256 _orderId) public {
Order storage order = orders[_orderId];
if (order.seller != msg.sender) revert NotOrderSeller();
// ...
}

Risk

Likelihood:

  • Reason 1 // Describe WHEN this will occur (avoid using "if" statements)

  • Reason 2

Impact:

  • Impact 1

  • Impact 2

Proof of Concept

Recommended Mitigation

- if (order.seller != msg.sender) revert NotOrderSeller();
+ if (order.seller != msg.sender && block.timestamp < order.deadlineTimestamp) revert NotOrderSeller();
Updates

Lead Judging Commences

yeahchibyke Lead Judge
about 2 months ago
yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.