diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-25 11:03:28 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-25 11:03:28 +0800 |
commit | 00e7c70b4df04a5a606a674bf13310badd70d527 (patch) | |
tree | d97ac9e8230813050cc04860b575cb3941934e70 /packages/contracts/src/2.0.0/protocol/Exchange/MixinMatchOrders.sol | |
parent | 0aa9ed3839b2b3b99967fc98ac92a48656b4ca5b (diff) | |
parent | d652deea232417bbef223bde46d8c12e9922b277 (diff) | |
download | dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar.gz dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar.bz2 dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar.lz dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar.xz dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.tar.zst dexon-sol-tools-00e7c70b4df04a5a606a674bf13310badd70d527.zip |
Merge pull request #986 from 0xProject/feature/contracts/assertions
Add more assertions to assertValidFill
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.sol | 22 |
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, |