Skip to content

Commit 49f4697

Browse files
spencer-tbSamWilsn
authored andcommitted
feat(spec-specs): EIP-8037 - check static context upfront in CREATE opcodes
1 parent 252dc30 commit 49f4697

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

  • src/ethereum/forks/amsterdam/vm/instructions

src/ethereum/forks/amsterdam/vm/instructions/system.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ def generic_create(
9999
create_message_gas = max_message_call_gas(Uint(evm.gas_left))
100100
evm.gas_left -= create_message_gas
101101

102-
if evm.message.is_static:
103-
raise WriteInStaticContext
104-
105102
# Move full reservoir to child (no 63/64 rule for state gas). Parent's
106103
# `state_gas_left` is zeroed and restored when the child returns.
107104
create_message_state_gas_reservoir = evm.state_gas_left
@@ -182,6 +179,9 @@ def create(evm: Evm) -> None:
182179
The current EVM frame.
183180
184181
"""
182+
if evm.message.is_static:
183+
raise WriteInStaticContext
184+
185185
# STACK
186186
endowment = pop(evm.stack)
187187
memory_start_position = pop(evm.stack)
@@ -231,6 +231,9 @@ def create2(evm: Evm) -> None:
231231
The current EVM frame.
232232
233233
"""
234+
if evm.message.is_static:
235+
raise WriteInStaticContext
236+
234237
# STACK
235238
endowment = pop(evm.stack)
236239
memory_start_position = pop(evm.stack)

0 commit comments

Comments
 (0)