From 60d3bed3936b37f2d728603aa6f31c014e8033f7 Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Thu, 8 Feb 2018 18:08:04 -0800 Subject: Cache order maker signature (ZEIP-15) --- .../current/protocol/Exchange/MixinExchangeCore.sol | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'packages') diff --git a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol index 083491a7a..67f9d2ea2 100644 --- a/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol @@ -97,14 +97,16 @@ contract MixinExchangeCore is orderHash: getOrderHash(orderAddresses, orderValues) }); - // Validate maker - require(order.makerTokenAmount > 0); - require(order.takerTokenAmount > 0); - require(isValidSignature( - order.orderHash, - order.maker, - signature - )); + // Validate order and maker only if first time seen + if (filled[order.orderHash] == 0 && cancelled[order.orderHash] == 0) { + require(order.makerTokenAmount > 0); + require(order.takerTokenAmount > 0); + require(isValidSignature( + order.orderHash, + order.maker, + signature + )); + } // Validate taker if (order.taker != address(0)) { -- cgit v1.2.3