From b16f5f55fb66aac624dfb82b881026b588f66b79 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Fri, 17 Aug 2018 14:19:19 -0700 Subject: Check fillable early --- .../contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'packages/contracts') diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol index 36060a1b6..e281de264 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol @@ -90,6 +90,12 @@ contract MixinExchangeCore is { // Fetch order info OrderInfo memory orderInfo = getOrderInfo(order); + + // An order can only be filled if its status is FILLABLE. + require( + orderInfo.orderStatus == uint8(OrderStatus.FILLABLE), + "ORDER_UNFILLABLE" + ); // Fetch taker address address takerAddress = getCurrentContextAddress(); -- cgit v1.2.3