Only reset currentContextAddress if it was previously updated

This commit is contained in:
Amir Bandeali 2018-07-05 13:29:11 -07:00
parent d634775d40
commit 0ea3b10efd

View File

@ -99,9 +99,10 @@ contract MixinTransactions is
"FAILED_EXECUTION" "FAILED_EXECUTION"
); );
// Reset current transaction signer // Reset current transaction signer if it was previously updated
// TODO: Check if gas is paid when currentContextAddress is already 0. if (signerAddress != msg.sender) {
currentContextAddress = address(0); currentContextAddress = address(0);
}
} }
/// @dev Calculates EIP712 hash of the Transaction. /// @dev Calculates EIP712 hash of the Transaction.
@ -120,13 +121,15 @@ contract MixinTransactions is
{ {
bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH; bytes32 schemaHash = EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH;
bytes32 dataHash = keccak256(data); bytes32 dataHash = keccak256(data);
// Assembly for more efficiently computing: // Assembly for more efficiently computing:
// keccak256(abi.encode( // keccak256(abi.encode(
// EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH, // EIP712_ZEROEX_TRANSACTION_SCHEMA_HASH,
// salt, // salt,
// signerAddress, // signerAddress,
// keccak256(data) // keccak256(data)
// )); // ));
assembly { assembly {
let memPtr := mload(64) let memPtr := mload(64)
mstore(memPtr, schemaHash) mstore(memPtr, schemaHash)