From f60adbdd723dcf1e5c980c357a8c2c4c337d3a87 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 27 Aug 2018 10:30:37 -0700 Subject: Remove redundant mstores from fillOrderNoThrow --- .../src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol index a7ff400b9..b5b8fc3e0 100644 --- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol +++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol @@ -69,14 +69,7 @@ contract MixinExchangeWrapper is fillOrderCalldata, // write output over input 128 // output size is 128 bytes ) - switch success - case 0 { - mstore(fillResults, 0) - mstore(add(fillResults, 32), 0) - mstore(add(fillResults, 64), 0) - mstore(add(fillResults, 96), 0) - } - case 1 { + if success { mstore(fillResults, mload(fillOrderCalldata)) mstore(add(fillResults, 32), mload(add(fillOrderCalldata, 32))) mstore(add(fillResults, 64), mload(add(fillOrderCalldata, 64))) -- cgit From 6a99bfa68ebaf43feed2961401fb89fa4eba9cf3 Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Mon, 27 Aug 2018 12:01:58 -0700 Subject: Add clarifying comments --- .../contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol | 1 + packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol index b5b8fc3e0..9e816716c 100644 --- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol +++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol @@ -76,6 +76,7 @@ contract MixinExchangeWrapper is mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96))) } } + // fillResults values will be 0 by default if call was unsuccessful return fillResults; } diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol index 39fa724cc..a5459a21e 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol @@ -96,6 +96,7 @@ contract MixinWrapperFunctions is mstore(add(fillResults, 96), mload(add(fillOrderCalldata, 96))) } } + // fillResults values will be 0 by default if call was unsuccessful return fillResults; } -- cgit