OrderBook

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

Lack of Emergency Pause Mechanism

Root + Impact

Description

  • The contract lacks an emergency pause mechanism to halt trading in case of discovered vulnerabilities

  • Critical functions like createSellOrder, buyOrder, and amendSellOrder cannot be paused

// @> No pause mechanism exists for emergency situations
function buyOrder(uint256 _orderId) public {
// ... function continues without any pause check
}

Risk

Likelihood:

  • Medium - Emergency situations requiring immediate halt of operations can occur

  • No mechanism exists to quickly respond to discovered vulnerabilities

Impact:

  • High - Cannot prevent further exploitation once a vulnerability is discovered

  • Could lead to significant financial losses during incident response

Proof of Concept

// If a critical vulnerability is discovered:
// 1. Trading cannot be halted immediately
// 2. Funds continue to be at risk until contract upgrade
// 3. No way to prevent new orders during emergency

Recommended Mitigation

+ import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol";
+ contract OrderBook is Ownable, Pausable {
// ... existing code
+ function pause() external onlyOwner {
+ _pause();
+ }
+
+ function unpause() external onlyOwner {
+ _unpause();
+ }
function createSellOrder(
address _tokenToSell,
uint256 _amountToSell,
uint256 _priceInUSDC,
uint256 _deadlineDuration
+ ) public whenNotPaused returns (uint256) {
// ... existing function
}
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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