aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-08-28 04:07:57 +0800
committerGitHub <noreply@github.com>2018-08-28 04:07:57 +0800
commitfb5ea5d99f444967a72fdf2ea5cc50a3490f17e8 (patch)
tree8f45b97ea6f971977805f5fed257e12f301036bf /packages
parent1be310cef49da42e4534a945b95b633d5846d864 (diff)
parent6a99bfa68ebaf43feed2961401fb89fa4eba9cf3 (diff)
downloaddexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar.gz
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar.bz2
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar.lz
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar.xz
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.tar.zst
dexon-sol-tools-fb5ea5d99f444967a72fdf2ea5cc50a3490f17e8.zip
Merge pull request #1030 from 0xProject/fix/contracts/forwarderFillOrderNoThrow
Remove redundant mstores from fillOrderNoThrow
Diffstat (limited to 'packages')
-rw-r--r--packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol10
-rw-r--r--packages/contracts/src/2.0.0/protocol/Exchange/MixinWrapperFunctions.sol1
2 files changed, 3 insertions, 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..9e816716c 100644
--- a/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
+++ b/packages/contracts/src/2.0.0/extensions/Forwarder/MixinExchangeWrapper.sol
@@ -69,20 +69,14 @@ 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)))
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;
}