Commit 1826d149 authored by Kelvin Fichter's avatar Kelvin Fichter

Wipe context after em.run

parent 9b63875c
...@@ -132,6 +132,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { ...@@ -132,6 +132,9 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager {
// Update the cumulative gas based on the amount of gas used. // Update the cumulative gas based on the amount of gas used.
_updateCumulativeGas(gasUsed, _transaction.queueOrigin); _updateCumulativeGas(gasUsed, _transaction.queueOrigin);
// Wipe the execution context.
_resetContext();
} }
...@@ -1524,6 +1527,28 @@ contract OVM_ExecutionManager is iOVM_ExecutionManager { ...@@ -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. * Checks whether we're inside contract creation code.
* @return _inCreation Whether or not we're in a contract creation. * @return _inCreation Whether or not we're in a contract creation.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment