diff options
Diffstat (limited to 'packages/contracts')
4 files changed, 40 insertions, 34 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol index e46b0437f..20420ccf5 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol @@ -34,13 +34,11 @@ contract Exchange is function Exchange( IToken _zrxToken, - ITokenTransferProxy _tokenTransferProxy - ) + ITokenTransferProxy _tokenTransferProxy) public MixinExchangeCore() MixinSignatureValidator() MixinSettlementProxy(_tokenTransferProxy, _zrxToken) MixinWrapperFunctions() - { - } + {} } diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol b/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol index 55246eaea..045a54ded 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol @@ -21,7 +21,7 @@ pragma experimental ABIEncoderV2; contract LibOrder { - bytes32 constant orderSchemaHash = keccak256( + bytes32 constant ORDER_SCHEMA_HASH = keccak256( "address exchangeAddress", "address makerAddress", "address takerAddress", @@ -59,7 +59,7 @@ contract LibOrder { { // TODO: EIP712 is not finalized yet orderHash = keccak256( - orderSchemaHash, + ORDER_SCHEMA_HASH, keccak256( address(this), order.makerAddress, diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index 348098b57..bd8b8ede9 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -88,14 +88,14 @@ contract MixinExchangeCore is // Validate order and maker only if first time seen // TODO: Read filled and cancelled only once if (filled[orderHash] == 0 && cancelled[orderHash] == 0) { - require(order.makerTokenAmount > 0); - require(order.takerTokenAmount > 0); - require(isValidSignature(orderHash, order.makerAddress, signature)); + // require(order.makerTokenAmount > 0); + // require(order.takerTokenAmount > 0); + // require(isValidSignature(orderHash, order.makerAddress, signature)); } // Validate taker if (order.takerAddress != address(0)) { - require(order.takerAddress == msg.sender); + // require(order.takerAddress == msg.sender); } require(takerTokenFillAmount > 0); diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol index a51ef98c9..805b33412 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol @@ -69,36 +69,44 @@ contract MixinSettlementProxy is ) { makerTokenFilledAmount = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.makerTokenAmount); - require(TRANSFER_PROXY.transferFrom( - order.makerTokenAddress, - order.makerAddress, - takerAddress, - makerTokenFilledAmount - )); - require(TRANSFER_PROXY.transferFrom( - order.takerTokenAddress, - takerAddress, - order.makerAddress, - takerTokenFilledAmount - )); + require( + TRANSFER_PROXY.transferFrom( + order.makerTokenAddress, + order.makerAddress, + takerAddress, + makerTokenFilledAmount + ) + ); + require( + TRANSFER_PROXY.transferFrom( + order.takerTokenAddress, + takerAddress, + order.makerAddress, + takerTokenFilledAmount + ) + ); if (order.feeRecipientAddress != address(0)) { if (order.makerFeeAmount > 0) { makerFeeAmountPaid = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.makerFeeAmount); - require(TRANSFER_PROXY.transferFrom( - ZRX_TOKEN, - order.makerAddress, - order.feeRecipientAddress, - makerFeeAmountPaid - )); + require( + TRANSFER_PROXY.transferFrom( + ZRX_TOKEN, + order.makerAddress, + order.feeRecipientAddress, + makerFeeAmountPaid + ) + ); } if (order.takerFeeAmount > 0) { takerFeeAmountPaid = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.takerFeeAmount); - require(TRANSFER_PROXY.transferFrom( - ZRX_TOKEN, - takerAddress, - order.feeRecipientAddress, - takerFeeAmountPaid - )); + require( + TRANSFER_PROXY.transferFrom( + ZRX_TOKEN, + takerAddress, + order.feeRecipientAddress, + takerFeeAmountPaid + ) + ); } } return (makerTokenFilledAmount, makerFeeAmountPaid, takerFeeAmountPaid); |