test_extcodecopy_bounds()¶
Documentation for tests/frontier/opcodes/test_extcodecopy.py::test_extcodecopy_bounds@8db70f93.
Generate fixtures for these test cases for Amsterdam with:
fill -v tests/frontier/opcodes/test_extcodecopy.py::test_extcodecopy_bounds --fork Amsterdam
Test EXTCODECOPY with out-of-bounds code offset.
Perform three EXTCODECOPY operations on a 15-byte target contract: 1. Huge code offset + large size -> all zeros (beyond code) 2. Huge code offset + small size -> all zeros (beyond code) 3. Offset 5 + size 12 -> partial code copy + zero padding
Each result is read via MLOAD(0) and MLOAD(32) and stored. Only the third operation produces a non-zero result because the dest_offset=1 shifts the copied bytes into the MLOAD(0) word.
Source code in tests/frontier/opcodes/test_extcodecopy.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 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 79 80 81 82 83 84 | |
Parametrized Test Cases¶
This test generates 1 parametrized test case across 14 forks.