Update formatting
This commit is contained in:
@@ -34,13 +34,11 @@ contract Exchange is
|
||||
|
||||
function Exchange(
|
||||
IToken _zrxToken,
|
||||
ITokenTransferProxy _tokenTransferProxy
|
||||
)
|
||||
ITokenTransferProxy _tokenTransferProxy)
|
||||
public
|
||||
MixinExchangeCore()
|
||||
MixinSignatureValidator()
|
||||
MixinSettlementProxy(_tokenTransferProxy, _zrxToken)
|
||||
MixinWrapperFunctions()
|
||||
{
|
||||
}
|
||||
{}
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -69,36 +69,44 @@ contract MixinSettlementProxy is
|
||||
)
|
||||
{
|
||||
makerTokenFilledAmount = getPartialAmount(takerTokenFilledAmount, order.takerTokenAmount, order.makerTokenAmount);
|
||||
require(TRANSFER_PROXY.transferFrom(
|
||||
require(
|
||||
TRANSFER_PROXY.transferFrom(
|
||||
order.makerTokenAddress,
|
||||
order.makerAddress,
|
||||
takerAddress,
|
||||
makerTokenFilledAmount
|
||||
));
|
||||
require(TRANSFER_PROXY.transferFrom(
|
||||
)
|
||||
);
|
||||
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(
|
||||
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(
|
||||
require(
|
||||
TRANSFER_PROXY.transferFrom(
|
||||
ZRX_TOKEN,
|
||||
takerAddress,
|
||||
order.feeRecipientAddress,
|
||||
takerFeeAmountPaid
|
||||
));
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
return (makerTokenFilledAmount, makerFeeAmountPaid, takerFeeAmountPaid);
|
||||
|
||||
Reference in New Issue
Block a user