aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-02-09 10:08:04 +0800
committerAmir Bandeali <abandeali1@gmail.com>2018-04-21 04:56:16 +0800
commit60d3bed3936b37f2d728603aa6f31c014e8033f7 (patch)
treef031bb88a178693755218a0ad1f0972b6d619838 /packages
parent3133ca00815763ff2b7ef768169df2e3b6c10677 (diff)
downloaddexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar.gz
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar.bz2
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar.lz
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar.xz
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.tar.zst
dexon-sol-tools-60d3bed3936b37f2d728603aa6f31c014e8033f7.zip
Cache order maker signature (ZEIP-15)
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/contracts/current/protocol/Exchange/MixinExchangeCore.sol18
1 files changed, 10 insertions, 8 deletions
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)) {