diff options
author | Remco Bloemen <remco@wicked.ventures> | 2018-08-25 01:49:05 +0800 |
---|---|---|
committer | Remco Bloemen <remco@wicked.ventures> | 2018-08-25 07:46:24 +0800 |
commit | 3e4493b389334fa28ae0f0043e4dbda23f21adec (patch) | |
tree | 360cb556f02a352283f5b15172538565126181b7 /packages/contracts | |
parent | 749c6ecc30d1e52de4ef4f0da5864024d75d2ecb (diff) | |
download | dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.gz dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.tar.zst dexon-sol-tools-3e4493b389334fa28ae0f0043e4dbda23f21adec.zip |
Disallow self filling
Diffstat (limited to 'packages/contracts')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/MixinExchangeCore.sol | 8 |
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( |