aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-08-25 07:13:17 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-08-25 07:46:24 +0800
commite21599285941a092a6c6f2dbf58f14f467dcca85 (patch)
tree39af43f14d83cbcdf47e2dceb274f7996296e4a9 /packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol
parente6f5cac87887709b5a3baaec059005301723f0a5 (diff)
downloaddexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar.gz
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar.bz2
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar.lz
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar.xz
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.tar.zst
dexon-0x-contracts-e21599285941a092a6c6f2dbf58f14f467dcca85.zip
Fix mixin api
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol')
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol21
1 files changed, 13 insertions, 8 deletions
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 4fd71092c..dc62db448 100644
--- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol
+++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol
@@ -95,7 +95,12 @@ contract MixinExchangeCore is
address takerAddress = getCurrentContextAddress();
// Assert that the order is fillable by taker
- assertFillableOrder(order, orderInfo, taker, signature);
+ assertFillableOrder(
+ order,
+ orderInfo,
+ takerAddress,
+ signature
+ );
// Get amount of takerAsset to fill
uint256 remainingTakerAssetAmount = safeSub(order.takerAssetAmount, orderInfo.orderTakerAssetFilledAmount);
@@ -107,10 +112,10 @@ contract MixinExchangeCore is
// Validate context
assertValidFill(
order,
+ orderInfo,
takerAssetFillAmount,
takerAssetFilledAmount,
- fillResults.makerAssetFilledAmount,
- signature
+ fillResults.makerAssetFilledAmount
);
// Update exchange internal state
@@ -270,7 +275,7 @@ contract MixinExchangeCore is
function assertFillableOrder(
Order memory order,
OrderInfo memory orderInfo,
- address taker,
+ address takerAddress,
bytes memory signature
)
internal
@@ -319,16 +324,16 @@ contract MixinExchangeCore is
/// @dev Validates context for fillOrder. Succeeds or throws.
/// @param order to be filled.
+ /// @param orderInfo OrderStatus, orderHash, and amount already filled of order.
/// @param takerAssetFillAmount Desired amount of order to fill by taker.
/// @param takerAssetFilledAmount Amount of takerAsset that will be filled.
/// @param makerAssetFilledAmount Amount of makerAsset that will be transfered.
- /// @param signature Proof that the orders was created by its maker.
function assertValidFill(
Order memory order,
- uint256 takerAssetFillAmount,
+ OrderInfo memory orderInfo,
+ uint256 takerAssetFillAmount, // TODO: use FillResults
uint256 takerAssetFilledAmount,
- uint256 makerAssetFilledAmount,
- bytes memory signature
+ uint256 makerAssetFilledAmount
)
internal
view