OrderBook

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

Extra time order

Description

  • The user can amend his order to add extra time anytime he wants

  • There is no real restriction on the duration of the order's validity.

Risk

Likelihood:

  • When a user amend his order

Impact:

  • An order can be active as long as the user wants

Proof of Concept

function test_extraTimeOrder() public {
// clara creates sell order for wsol
vm.startPrank(clara);
wsol.approve(address(book), 2e18);
uint256 claraId = book.createSellOrder(
address(wsol),
2e18,
300e6,
2.5 days
);
vm.stopPrank();
vm.warp(block.timestamp + 2 days);
// clara amends her wsol order
vm.prank(clara);
book.amendSellOrder(claraId, 2e18, 300e6, 2.5 days);
vm.warp(block.timestamp + 2 days);
vm.prank(clara);
book.amendSellOrder(claraId, 2e18, 300e6, 2.5 days);
vm.warp(block.timestamp + 2 days);
vm.prank(clara);
book.amendSellOrder(claraId, 2e18, 300e6, 2.5 days);
assert(book.getOrder(claraId).isActive == true);
}

Recommended Mitigation

  • Take into consideration the deadline set at the order creation

Updates

Lead Judging Commences

yeahchibyke Lead Judge
7 days ago
yeahchibyke Lead Judge 6 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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