aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol')
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol22
1 files changed, 16 insertions, 6 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol
index 4b8360c23..075a610b5 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol
@@ -64,8 +64,20 @@ contract MixinMatchOrders is
// Fetch taker address
address takerAddress = getCurrentContextAddress();
-
+
// Either our context is valid or we revert
+ assertFillableOrder(
+ leftOrder,
+ leftOrderInfo,
+ takerAddress,
+ leftSignature
+ );
+ assertFillableOrder(
+ rightOrder,
+ rightOrderInfo,
+ takerAddress,
+ rightSignature
+ );
assertValidMatch(leftOrder, rightOrder);
// Compute proportional fill amounts
@@ -80,20 +92,18 @@ contract MixinMatchOrders is
assertValidFill(
leftOrder,
leftOrderInfo,
- takerAddress,
matchedFillResults.left.takerAssetFilledAmount,
matchedFillResults.left.takerAssetFilledAmount,
- leftSignature
+ matchedFillResults.left.makerAssetFilledAmount
);
assertValidFill(
rightOrder,
rightOrderInfo,
- takerAddress,
matchedFillResults.right.takerAssetFilledAmount,
matchedFillResults.right.takerAssetFilledAmount,
- rightSignature
+ matchedFillResults.right.makerAssetFilledAmount
);
-
+
// Update exchange state
updateFilledState(
leftOrder,