aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-03-09 07:57:26 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:16 +0800
commit9cc1956b4b25081810680d79b12f80727c96c1ef (patch)
treee2cf6ee1fa811edd2a3f07c88cee3e523294b8c2 /packages/contracts
parenta35138e2b97af9d8671a931350813c52e2371c40 (diff)
downloaddexon-0x-contracts-9cc1956b4b25081810680d79b12f80727c96c1ef.tar.gz
dexon-0x-contracts-9cc1956b4b25081810680d79b12f80727c96c1ef.tar.zst
dexon-0x-contracts-9cc1956b4b25081810680d79b12f80727c96c1ef.zip
Update formatting
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/Exchange.sol6
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/LibOrder.sol4
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol8
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinSettlementProxy.sol56
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);