aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-02-07 16:03:16 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:16 +0800
commit61726d84ac418464de556956e9fa7227b971d30c (patch)
tree1151c263f3a01495fc393ca77d7d3e7826c8e0b2
parent60d3bed3936b37f2d728603aa6f31c014e8033f7 (diff)
downloaddexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar.gz
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar.bz2
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar.lz
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar.xz
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.tar.zst
dexon-sol-tools-61726d84ac418464de556956e9fa7227b971d30c.zip
Cancel signature abstraction
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol13
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);