4646# Halting the execution opcodes can be placed without STOP instruction at the end
4747halting_opcodes = {
4848 Op .STOP ,
49- Op .RETURNCONTRACT ,
49+ Op .RETURNCODE ,
5050 Op .RETURN ,
5151 Op .REVERT ,
5252 Op .INVALID ,
@@ -88,7 +88,7 @@ def test_all_opcodes_in_container(
8888 sections = [Section .Code (code = bytecode )]
8989
9090 match opcode :
91- case Op .EOFCREATE | Op .RETURNCONTRACT :
91+ case Op .EOFCREATE | Op .RETURNCODE :
9292 sections .append (
9393 Section .Container (
9494 container = Container (
@@ -107,7 +107,7 @@ def test_all_opcodes_in_container(
107107 )
108108 sections .append (Section .Data ("1122334455667788" * 4 ))
109109
110- if opcode == Op .RETURNCONTRACT :
110+ if opcode == Op .RETURNCODE :
111111 eof_code = Container (sections = sections , kind = ContainerKind .INITCODE )
112112 else :
113113 eof_code = Container (sections = sections )
@@ -136,24 +136,24 @@ def test_invalid_opcodes_after_stop(
136136 """Test that an invalid opcode placed after STOP (terminating instruction) invalidates EOF."""
137137 terminating_code = Bytecode (terminating_opcode )
138138 match terminating_opcode : # Enhance the code for complex opcodes.
139- case Op .RETURNCONTRACT :
140- terminating_code = Op .RETURNCONTRACT [0 ]
139+ case Op .RETURNCODE :
140+ terminating_code = Op .RETURNCODE [0 ]
141141 case Op .RETURN | Op .REVERT :
142142 terminating_code = Op .PUSH0 + Op .PUSH0 + terminating_opcode
143143 case Op .RJUMP :
144144 terminating_code = Op .RJUMP [- 3 ]
145145
146146 eof_code = Container (
147147 kind = ContainerKind .INITCODE
148- if terminating_opcode == Op .RETURNCONTRACT
148+ if terminating_opcode == Op .RETURNCODE
149149 else ContainerKind .RUNTIME ,
150150 sections = [
151151 Section .Code (code = terminating_code + opcode ),
152152 Section .Data ("00" * 32 ),
153153 ]
154154 + (
155155 [Section .Container (container = Container .Code (Op .INVALID ))]
156- if terminating_opcode == Op .RETURNCONTRACT
156+ if terminating_opcode == Op .RETURNCODE
157157 else []
158158 ),
159159 )
@@ -194,7 +194,7 @@ def test_all_invalid_terminating_opcodes(
194194 Section .Container (
195195 container = Container (
196196 sections = [
197- Section .Code (code = Op .RETURNCONTRACT [0 ](0 , 0 )),
197+ Section .Code (code = Op .RETURNCODE [0 ](0 , 0 )),
198198 Section .Container (Container .Code (code = Op .STOP )),
199199 ]
200200 )
@@ -233,13 +233,13 @@ def test_all_unreachable_terminating_opcodes_after_stop(
233233 Section .Code (code = Op .STOP + Op .JUMPF [1 ]),
234234 Section .Code (code = Op .STOP ),
235235 ]
236- case Op .RETURNCONTRACT :
236+ case Op .RETURNCODE :
237237 sections = [
238238 Section .Code (code = Op .EOFCREATE [0 ](0 , 0 , 0 , 0 ) + Op .STOP ),
239239 Section .Container (
240240 container = Container (
241241 sections = [
242- Section .Code (code = Op .STOP + Op .RETURNCONTRACT [0 ](0 , 0 )),
242+ Section .Code (code = Op .STOP + Op .RETURNCODE [0 ](0 , 0 )),
243243 Section .Container (Container .Code (code = Op .STOP )),
244244 ]
245245 )
@@ -257,7 +257,7 @@ def test_all_unreachable_terminating_opcodes_after_stop(
257257 sections = sections ,
258258 ),
259259 expect_exception = EOFException .UNREACHABLE_INSTRUCTIONS
260- if opcode != Op .RETURNCONTRACT
260+ if opcode != Op .RETURNCODE
261261 else EOFException .INCOMPATIBLE_CONTAINER_KIND ,
262262 )
263263
@@ -282,13 +282,13 @@ def test_all_unreachable_terminating_opcodes_before_stop(
282282 Section .Code (code = Op .JUMPF [1 ] + Op .STOP ),
283283 Section .Code (code = Op .STOP ),
284284 ]
285- case Op .RETURNCONTRACT :
285+ case Op .RETURNCODE :
286286 sections = [
287287 Section .Code (code = Op .EOFCREATE [0 ](0 , 0 , 0 , 0 ) + Op .STOP ),
288288 Section .Container (
289289 container = Container (
290290 sections = [
291- Section .Code (code = Op .RETURNCONTRACT [0 ](0 , 0 ) + Op .STOP ),
291+ Section .Code (code = Op .RETURNCODE [0 ](0 , 0 ) + Op .STOP ),
292292 Section .Container (Container .Code (code = Op .STOP )),
293293 ]
294294 )
@@ -306,7 +306,7 @@ def test_all_unreachable_terminating_opcodes_before_stop(
306306 sections = sections ,
307307 ),
308308 expect_exception = EOFException .UNREACHABLE_INSTRUCTIONS
309- if opcode != Op .RETURNCONTRACT
309+ if opcode != Op .RETURNCODE
310310 else EOFException .INCOMPATIBLE_CONTAINER_KIND ,
311311 )
312312
@@ -336,13 +336,13 @@ def test_all_opcodes_stack_underflow(
336336 Section .Container (
337337 container = Container (
338338 sections = [
339- Section .Code (code = Op .RETURNCONTRACT [0 ](0 , 0 )),
339+ Section .Code (code = Op .RETURNCODE [0 ](0 , 0 )),
340340 Section .Container (Container .Code (code = Op .STOP )),
341341 ]
342342 )
343343 ),
344344 ]
345- elif opcode == Op .RETURNCONTRACT :
345+ elif opcode == Op .RETURNCODE :
346346 sections = [
347347 Section .Code (code = Op .EOFCREATE [0 ](0 , 0 , 0 , 0 ) + Op .STOP ),
348348 Section .Container (
0 commit comments