From 61726d84ac418464de556956e9fa7227b971d30c Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Wed, 7 Feb 2018 00:03:16 -0800 Subject: Cancel signature abstraction --- .../current/protocol/Exchange/MixinExchangeCore.sol | 13 ++++++++++--- 1 file 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); -- cgit