diff --git a/tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py b/tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py index eb5dc99dda..c854fa34a9 100644 --- a/tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py +++ b/tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py @@ -23,15 +23,15 @@ def test_legacy_calls_eof_sstore( ): """Test EXTCODE* opcodes calling EOF and legacy contracts""" env = Environment() - address_eof_contract = pre.deploy_contract( - Container( - sections=[ - Section.Code( - code=Op.RJUMP[0] + Op.STOP, - ) - ] - ) + eof_code = Container( + sections=[ + Section.Code( + code=Op.RJUMP[0] + Op.STOP, + ) + ] ) + assert len(eof_code) == 23 + address_eof_contract = pre.deploy_contract(eof_code) legacy_code = Op.PUSH1(2) + Op.JUMPDEST + Op.STOP address_legacy_contract = pre.deploy_contract(legacy_code) @@ -50,6 +50,9 @@ def test_legacy_calls_eof_sstore( + Op.SSTORE(storage_test.store_next(2), Op.EXTCODESIZE(address_eof_contract)) + Op.EXTCODECOPY(address_eof_contract, 0x20, 0, 6) + Op.SSTORE(storage_test.store_next(b"\xef" + (b"\0" * 31)), Op.MLOAD(0x20)) + + Op.MSTORE(0x40, b"\xcc" * 32) # clobber memory slot + + Op.EXTCODECOPY(address_eof_contract, 0x40, len(eof_code) - 4, 8) # out-of-bounds "read" + + Op.SSTORE(storage_test.store_next(b"\xcc" * 24), Op.MLOAD(0x40)) + Op.SSTORE( storage_test.store_next(keccak256(b"\xef\x00")), Op.EXTCODEHASH(address_eof_contract), diff --git a/tests/osaka/eip7692_eof_v1/eof_tracker.md b/tests/osaka/eip7692_eof_v1/eof_tracker.md index e8ee5d1794..61a8d87009 100644 --- a/tests/osaka/eip7692_eof_v1/eof_tracker.md +++ b/tests/osaka/eip7692_eof_v1/eof_tracker.md @@ -82,9 +82,9 @@ ### Execution - [ ] Execution of EOF contracts (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_ExecutionFiller.yml) -- [ ] Legacy executing EXTCODESIZE of EOF contract (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_ExecutionFiller.yml) -- [ ] Legacy executing EXTCODEHASH of EOF contract (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_ExecutionFiller.yml) -- [ ] Legacy executing EXTCODECOPY of EOF contract (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_ExecutionFiller.yml) +- [x] Legacy executing EXTCODESIZE of EOF contract ([`tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py::test_legacy_calls_eof_sstore`](./eip3540_eof_v1/test_extcode/test_legacy_calls_eof_sstore.md)) +- [x] Legacy executing EXTCODEHASH of EOF contract ([`tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py::test_legacy_calls_eof_sstore`](./eip3540_eof_v1/test_extcode/test_legacy_calls_eof_sstore.md)) +- [x] Legacy executing EXTCODECOPY of EOF contract ([`tests/osaka/eip7692_eof_v1/eip3540_eof_v1/test_extcode.py::test_legacy_calls_eof_sstore`](./eip3540_eof_v1/test_extcode/test_legacy_calls_eof_sstore.md)) - [ ] `*CALLs` from legacy contracts to EOF contracts (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_CallsFiller.yml) - [ ] `EXT*CALLs` from EOF to legacy contracts (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_CallsFiller.yml) - [ ] EXTDELEGATECALL from EOF to EOF contract (ethereum/tests: src/EIPTestsFiller/StateTests/stEOF/stEIP3540/EOF1_CallsFiller.yml)