diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-09 06:12:10 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-09 06:12:10 +0800 |
commit | 5e8ad0aef422b526751d1c0924f458cf87ea05f5 (patch) | |
tree | b30046a820741038e3a21ed450ee158a5fe7bf87 /packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol | |
parent | d7d51791a6bba5dae274c50257038b2bb8fb626b (diff) | |
parent | 19cda0eb036b6876964d8074aea1295142d25027 (diff) | |
download | dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar.gz dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar.bz2 dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar.lz dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar.xz dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.tar.zst dexon-sol-tools-5e8ad0aef422b526751d1c0924f458cf87ea05f5.zip |
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package
Diffstat (limited to 'packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol')
-rw-r--r-- | packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol | 16 |
1 files changed, 10 insertions, 6 deletions
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 88d2da7d7..b5de1a5de 100644 --- a/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol +++ b/packages/contracts/src/2.0.0/protocol/Exchange/MixinTransactions.sol @@ -123,19 +123,23 @@ contract MixinTransactions is bytes32 dataHash = keccak256(data); // Assembly for more efficiently computing: - // keccak256(abi.encode( + // keccak256(abi.encodePacked( // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH, // salt, - // signerAddress, + // bytes32(signerAddress), // keccak256(data) // )); assembly { + // Load free memory pointer let memPtr := mload(64) - mstore(memPtr, schemaHash) - mstore(add(memPtr, 32), salt) - mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) - mstore(add(memPtr, 96), dataHash) + + mstore(memPtr, schemaHash) // hash of schema + mstore(add(memPtr, 32), salt) // salt + mstore(add(memPtr, 64), and(signerAddress, 0xffffffffffffffffffffffffffffffffffffffff)) // signerAddress + mstore(add(memPtr, 96), dataHash) // hash of data + + // Compute hash result := keccak256(memPtr, 128) } |