aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorRemco Bloemen <remco@wicked.ventures>2018-08-25 01:49:05 +0800
committerRemco Bloemen <remco@wicked.ventures>2018-08-25 07:46:24 +0800
commit3e4493b389334fa28ae0f0043e4dbda23f21adec (patch)
tree360cb556f02a352283f5b15172538565126181b7 /packages
parent749c6ecc30d1e52de4ef4f0da5864024d75d2ecb (diff)
downloaddexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.gz
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.bz2
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.lz
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.xz
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.zst
dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.zip
Disallow self filling
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol8
1 files changed, 7 insertions, 1 deletions
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(