Skip to content

Commit ad94734

Browse files
shemnonmarioevz
andauthored
new(tests) EIP-7698 - legacy cannot create EOF (#1206)
* new(tests) EIP-7698 - legacy cannot create EOF Verify that a legacy contract creation cannot deploy an EOF contract. Signed-off-by: Danno Ferrin <danno@numisight.com> * that was ruff. Signed-off-by: Danno Ferrin <danno@numisight.com> * Update tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py --------- Signed-off-by: Danno Ferrin <danno@numisight.com> Co-authored-by: Mario Vega <marioevz@gmail.com>
1 parent b47779f commit ad94734

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/osaka/eip7692_eof_v1/eip7698_eof_creation_tx/test_eof_creation_tx.py

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import pytest
44

55
from ethereum_test_base_types.base_types import Address
6-
from ethereum_test_tools import Account, Alloc, Environment, StateTestFiller, Transaction
6+
from ethereum_test_tools import Account, Alloc, Environment, Initcode, StateTestFiller, Transaction
77
from ethereum_test_tools.eof.v1 import Container, Section
88
from ethereum_test_tools.vm.opcode import Opcodes as Op
99
from ethereum_test_types.helpers import compute_create_address
@@ -75,3 +75,29 @@ def test_eof_creation_tx_context(
7575
post=post,
7676
tx=tx,
7777
)
78+
79+
80+
def test_lecacy_cannot_create_eof(
81+
state_test: StateTestFiller,
82+
pre: Alloc,
83+
):
84+
"""Test that a legacy contract creation initcode cannot deploy an EOF contract."""
85+
env = Environment()
86+
sender = pre.fund_eoa()
87+
88+
initcode = Initcode(deploy_code=smallest_runtime_subcontainer)
89+
90+
destination_contract_address = compute_create_address(address=sender, nonce=sender.nonce)
91+
92+
tx = Transaction(sender=sender, to=None, gas_limit=100000, data=initcode)
93+
94+
post = {
95+
destination_contract_address: Account.NONEXISTENT,
96+
}
97+
98+
state_test(
99+
env=env,
100+
pre=pre,
101+
post=post,
102+
tx=tx,
103+
)

0 commit comments

Comments
 (0)