diff options
author | Amir Bandeali <abandeali1@gmail.com> | 2018-08-09 02:50:18 +0800 |
---|---|---|
committer | Amir Bandeali <abandeali1@gmail.com> | 2018-08-09 06:44:43 +0800 |
commit | d10e2652aeb3bde01fd729ef21b3eb5cafcfb27d (patch) | |
tree | 91d6f28fc65f51dd95396533bfc88d5c6cefdfb9 /packages/contracts/src | |
parent | 9a5d7b76352e804d532e7a6d08d83f7b0ea7bd7f (diff) | |
download | dexon-0x-contracts-d10e2652aeb3bde01fd729ef21b3eb5cafcfb27d.tar.gz dexon-0x-contracts-d10e2652aeb3bde01fd729ef21b3eb5cafcfb27d.tar.zst dexon-0x-contracts-d10e2652aeb3bde01fd729ef21b3eb5cafcfb27d.zip |
Revert incrementing memory ptr in dispatchTransferFrom
Diffstat (limited to 'packages/contracts/src')
3 files changed, 3 insertions, 9 deletions
diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol index b34903668..e9f882194 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinAssetProxyDispatcher.sol @@ -159,22 +159,18 @@ contract MixinAssetProxyDispatcher is } /////// Call `assetProxy.transferFrom` using the constructed calldata /////// - let inputLen := sub(cdEnd, cdStart) let success := call( gas, // forward all gas assetProxy, // call address of asset proxy 0, // don't send any ETH cdStart, // pointer to start of input - inputLen, // length of input + sub(cdEnd, cdStart), // length of input cdStart, // write output over input 512 // reserve 512 bytes for output ) if iszero(success) { revert(cdStart, returndatasize()) } - - // Increment free memory pointer - mstore(64, add(cdStart, inputLen)) } } } diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol b/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol index b5de1a5de..821d30279 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol @@ -142,7 +142,6 @@ contract MixinTransactions is // Compute hash result := keccak256(memPtr, 128) } - return result; } diff --git a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol index f047342b3..4aad37709 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/libs/LibAbiEncoder.sol @@ -204,11 +204,10 @@ contract LibAbiEncoder { } // Set length of calldata - let calldataLen := sub(dataAreaEnd, add(fillOrderCalldata, 0x20)) - mstore(fillOrderCalldata, calldataLen) + mstore(fillOrderCalldata, sub(dataAreaEnd, add(fillOrderCalldata, 0x20))) // Increment free memory pointer - mstore(0x40, add(fillOrderCalldata, add(calldataLen, 0x20))) + mstore(0x40, dataAreaEnd) } return fillOrderCalldata; |