diff --git a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol index 94b5487101fb90c2960f95f465596c3803f532fa..281469603bc774c5b8de9e0b58650e1e37a33359 100644 --- a/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol +++ b/packages/contracts/contracts/optimistic-ethereum/OVM/execution/OVM_ExecutionManager.sol @@ -132,6 +132,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { // Update the cumulative gas based on the amount of gas used. _updateCumulativeGas(gasUsed, _transaction.queueOrigin); + + // Wipe the execution context. + _resetContext(); } @@ -1524,6 +1527,28 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { } } + /** + * Resets the transaction and message context. + */ + function _resetContext() + internal + { + transactionContext.ovmORIGIN = address(0); + transactionContext.ovmTIMESTAMP = 0; + transactionContext.ovmGASLIMIT = 0; + transactionContext.ovmTXGASLIMIT = 0; + transactionContext.ovmQUEUEORIGIN = 0; + + transactionRecord.ovmGasRefund = 0; + + messageContext.ovmCALLER = address(0); + messageContext.ovmADDRESS = address(0); + messageContext.isStatic = false; + + messageRecord.nuisanceGasLeft = 0; + messageRecord.revertFlag = RevertFlag.DID_NOT_REVERT; + } + /** * Checks whether we're inside contract creation code. * @return _inCreation Whether or not we're in a contract creation. diff --git a/packages/contracts/contracts/optimistic-ethereum/iOVM/execution/.iOVM_ExecutionManager.sol.swp b/packages/contracts/contracts/optimistic-ethereum/iOVM/execution/.iOVM_ExecutionManager.sol.swp new file mode 100644 index 0000000000000000000000000000000000000000..614abbecb8373fa6528620d80a2e18076332a8ca Binary files /dev/null and b/packages/contracts/contracts/optimistic-ethereum/iOVM/execution/.iOVM_ExecutionManager.sol.swp differ