From 3e4493b389334fa28ae0f0043e4dbda23f21adec Mon Sep 17 00:00:00 2001 From: Remco Bloemen Date: Fri, 24 Aug 2018 10:49:05 -0700 Subject: Disallow self filling --- .../contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'packages') diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol index 1a0a1a135..b8b3899e8 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol @@ -314,7 +314,13 @@ contract MixinExchangeCore is "INVALID_TAKER" ); } - + + // Orders can not be self-filled (use cancel instead) + require( + order.makerAddress != takerAddress, + "INVALID_TAKER" + ); + // Validate Maker signature (check only if first time seen) if (orderInfo.orderTakerAssetFilledAmount == 0) { require( -- cgit