diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-02-07 16:03:16 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-04-21 04:56:16 +0800 |
commit | 61726d84ac418464de556956e9fa7227b971d30c (patch) | |
tree | 1151c263f3a01495fc393ca77d7d3e7826c8e0b2 /packages/contracts/src | |
parent | 60d3bed3936b37f2d728603aa6f31c014e8033f7 (diff) | |
download | dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar.gz dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar.bz2 dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar.lz dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar.xz dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.tar.zst dexon-0x-contracts-61726d84ac418464de556956e9fa7227b971d30c.zip |
Cancel signature abstraction
Diffstat (limited to 'packages/contracts/src')
-rw-r--r-- | packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index 67f9d2ea2..4f7c3d4a1 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -165,7 +165,8 @@ contract MixinExchangeCore is function cancelOrder( address[5] orderAddresses, uint256[6] orderValues, - uint256 takerTokenCancelAmount) + uint256 takerTokenCancelAmount, + bytes signature) public returns (uint256 takerTokenCancelledAmount) { @@ -183,8 +184,14 @@ contract MixinExchangeCore is orderHash: getOrderHash(orderAddresses, orderValues) }); - require(order.maker == msg.sender); - require(order.makerTokenAmount > 0 && order.takerTokenAmount > 0 && takerTokenCancelAmount > 0); + require(order.makerTokenAmount > 0); + require(order.takerTokenAmount > 0); + require(takerTokenCancelAmount > 0); + require(isValidSignature( + order.orderHash, + order.maker, + signature + )); if (block.timestamp >= order.expirationTimestampInSec) { LogError(uint8(Errors.ORDER_EXPIRED), order.orderHash); |