Skip to content

test_simple_eofcreate()

Documentation for tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py::test_simple_eofcreate@a86d4327.

Generate fixtures for these test cases for Pragueeip7692 with:

Pragueeip7692 only:

fill -v tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py::test_simple_eofcreate --fork=PragueEIP7692 --evm-bin=/path/to/evm-tool-dev-version

For all forks up to and including Pragueeip7692:

fill -v tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py::test_simple_eofcreate --until=PragueEIP7692

Verifies a simple EOFCREATE case

Source code in tests/prague/eip7692_eof_v1/eip7620_eof_create/test_eofcreate.py
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
def test_simple_eofcreate(
    state_test: StateTestFiller,
    pre: Alloc,
):
    """
    Verifies a simple EOFCREATE case
    """
    env = Environment()
    sender = pre.fund_eoa()
    contract_address = pre.deploy_contract(
        code=Container(
            sections=[
                Section.Code(
                    code=Op.SSTORE(0, Op.EOFCREATE[0](0, 0, 0, 0)) + Op.STOP,
                ),
                Section.Container(container=smallest_initcode_subcontainer),
            ],
            data=b"abcdef",
        ),
        storage={0: 0xB17D},  # a canary to be overwritten
    )
    # Storage in 0 should have the address,
    post = {
        contract_address: Account(
            storage={
                0: compute_eofcreate_address(contract_address, 0, smallest_initcode_subcontainer)
            }
        )
    }
    tx = Transaction(
        to=contract_address,
        gas_limit=10_000_000,
        gas_price=10,
        protected=False,
        sender=sender,
    )
    state_test(env=env, pre=pre, post=post, tx=tx)