diff --git a/tests/ported_static/stEIP1559/test_base_fee_diff_places.py b/tests/ported_static/stEIP1559/test_base_fee_diff_places.py deleted file mode 100644 index 51016abbbae..00000000000 --- a/tests/ported_static/stEIP1559/test_base_fee_diff_places.py +++ /dev/null @@ -1,1276 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/baseFeeDiffPlacesFiller.yml -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/baseFeeDiffPlacesFiller.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.valid_until("Prague") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="normal", - ), - pytest.param( - 1, - 0, - 0, - id="normal", - ), - pytest.param( - 2, - 0, - 0, - id="normal", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - pytest.param( - 5, - 0, - 0, - id="d5", - ), - pytest.param( - 6, - 0, - 0, - id="d6", - ), - pytest.param( - 7, - 0, - 0, - id="d7", - ), - pytest.param( - 8, - 0, - 0, - id="d8", - ), - pytest.param( - 9, - 0, - 0, - id="d9", - ), - pytest.param( - 10, - 0, - 0, - id="d10", - ), - pytest.param( - 11, - 0, - 0, - id="d11", - ), - pytest.param( - 12, - 0, - 0, - id="d12", - ), - pytest.param( - 13, - 0, - 0, - id="d13", - ), - pytest.param( - 14, - 0, - 0, - id="d14", - ), - pytest.param( - 15, - 0, - 0, - id="d15", - ), - pytest.param( - 16, - 0, - 0, - id="d16", - ), - pytest.param( - 17, - 0, - 0, - id="d17", - ), - pytest.param( - 18, - 0, - 0, - id="d18", - ), - pytest.param( - 19, - 0, - 0, - id="d19", - ), - pytest.param( - 20, - 0, - 0, - id="d20", - ), - pytest.param( - 21, - 0, - 0, - id="d21", - ), - pytest.param( - 22, - 0, - 0, - id="d22", - ), - pytest.param( - 23, - 0, - 0, - id="d23", - ), - pytest.param( - 24, - 0, - 0, - id="d24", - ), - pytest.param( - 25, - 0, - 0, - id="d25", - ), - pytest.param( - 26, - 0, - 0, - id="d26", - ), - pytest.param( - 27, - 0, - 0, - id="d27", - ), - pytest.param( - 28, - 0, - 0, - id="d28", - ), - pytest.param( - 29, - 0, - 0, - id="d29", - ), - pytest.param( - 30, - 0, - 0, - id="d30", - ), - pytest.param( - 31, - 0, - 0, - id="d31", - ), - pytest.param( - 32, - 0, - 0, - id="d32", - ), - pytest.param( - 33, - 0, - 0, - id="d33", - ), - pytest.param( - 34, - 0, - 0, - id="d34", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_base_fee_diff_places( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x000000000000000000000000000000000000C0DE) - contract_1 = Address(0x000000000000000000000000000000000020C0DE) - contract_2 = Address(0x00000000000000000000000000000000C0DEC0DE) - contract_3 = Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC) - contract_4 = Address(0x000000000000000000000000000000000000CA11) - contract_5 = Address(0x00000000000000000000000000000000CA1100F1) - contract_6 = Address(0x00000000000000000000000000000000CA1100F2) - contract_7 = Address(0x00000000000000000000000000000000CA1100F4) - contract_8 = Address(0x00000000000000000000000000000000CA1100FA) - contract_9 = Address(0x0000000000000000000000000000000000060006) - contract_10 = Address(0x000000000000000000000000000000000060BACC) - contract_11 = Address(0x00000000000000000000000000000000DEADDEAD) - contract_12 = Address(0x00000000000000000000000000000060BACCFA57) - sender = pre.fund_eoa(amount=0x3635C9ADC5DEA00000, nonce=1) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=4503599627370496, - ) - - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # - # // Here the result is is mload(0). We want to run it, but - # // prefix it with a zero so we'll be safe from being considered - # // an invalid program. - # // - # // If we use this as a constructor the result will be - # // the code of the created contract, but we can live - # // with that. We won't call it. - # mstore(0x40, mload(0x00)) - # return(0x3F, 0x21) - # } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.MSTORE(offset=0x40, value=Op.MLOAD(offset=0x0)) - + Op.RETURN(offset=0x3F, size=0x21), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # - # // Here the result is is mload(0). - # return(0x00, 0x20) - # } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000020C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # return(0, 0x20) // return the result as our return value - # } - contract_4 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000CA11), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # sstore(0,mload(0)) - # invalid() - # } - contract_9 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.INVALID, - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x0000000000000000000000000000000000060006), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # sstore(0,mload(0)) - # revert(0,0x20) - # } - contract_10 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.REVERT(offset=0x0, size=0x20), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000060BACC), # noqa: E501 - ) - # Source: yul - # berlin { - # selfdestruct(0) - # } - contract_11 = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT(address=0x0), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000DEADDEAD), # noqa: E501 - ) - # Source: yul - # berlin { - # let addr := 0x20C0DE - # let length := extcodesize(addr) - # - # // Read the code from 0x20C0DE - # extcodecopy(addr, 0, 0, length) - # - # // Return this memory as the code for the contract - # return(0, length) - # } - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.PUSH1[0x0] - + Op.PUSH3[0x20C0DE] - + Op.DUP2 - + Op.EXTCODESIZE(address=Op.DUP2) - + Op.SWAP3 - + Op.DUP4 - + Op.SWAP3 - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.RETURN, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000C0DEC0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_6 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F2), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(call(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_5 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F1), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(staticcall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_8 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100FA), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(delegatecall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_7 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F4), # noqa: E501 - ) - # Source: yul - # berlin { - # let action := calldataload(4) - # let res := 1 // If the result of a call is revert, revert here too - # let addr := 1 // If the result of CREATE[2] is zero, it reverted - # - # // For when we need code in our memory - # let codeBuffer := 0x20 - # // When running the template in the constructor - # let codeLength := extcodesize(0xC0DE) - # // When running the template in the created code - # let codeLength2 := extcodesize(0xC0DEC0DE) - # - # // Goat should be overwritten - # mstore(0, 0x60A7) - # - # switch action - # case 0 { // run the code snippet as normal code - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # } - # - # // One level of call stack - # case 0xF1 { // call a contract to run this code - # res := call(gas(), 0xca11, 0, 0, 0, 0, 0x20) // call template code - # } - # case 0xF2 { // callcode a contract to run this code - # ... (290 more lines) - contract_3 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=0x60A7) - + Op.PUSH1[0x1] - + Op.DUP1 - + Op.CALLDATALOAD(offset=0x4) - + Op.EXTCODESIZE(address=0xC0DEC0DE) - + Op.PUSH1[0x20] - + Op.EXTCODESIZE(address=0xC0DE) - + Op.JUMPI(pc=0x58A, condition=Op.ISZERO(Op.DUP4)) - + Op.JUMPI(pc=0x574, condition=Op.EQ(0xF1, Op.DUP4)) - + Op.JUMPI(pc=0x55E, condition=Op.EQ(0xF2, Op.DUP4)) - + Op.JUMPI(pc=0x549, condition=Op.EQ(0xF4, Op.DUP4)) - + Op.JUMPI(pc=0x534, condition=Op.EQ(0xFA, Op.DUP4)) - + Op.JUMPI(pc=0x51C, condition=Op.EQ(0xF1F1, Op.DUP4)) - + Op.JUMPI(pc=0x504, condition=Op.EQ(0xF2F1, Op.DUP4)) - + Op.JUMPI(pc=0x4ED, condition=Op.EQ(0xF4F1, Op.DUP4)) - + Op.JUMPI(pc=0x4D6, condition=Op.EQ(0xFAF1, Op.DUP4)) - + Op.JUMPI(pc=0x4BE, condition=Op.EQ(0xF1F2, Op.DUP4)) - + Op.JUMPI(pc=0x4A6, condition=Op.EQ(0xF2F2, Op.DUP4)) - + Op.JUMPI(pc=0x48F, condition=Op.EQ(0xF4F2, Op.DUP4)) - + Op.JUMPI(pc=0x478, condition=Op.EQ(0xFAF2, Op.DUP4)) - + Op.JUMPI(pc=0x460, condition=Op.EQ(0xF1F4, Op.DUP4)) - + Op.JUMPI(pc=0x448, condition=Op.EQ(0xF2F4, Op.DUP4)) - + Op.JUMPI(pc=0x431, condition=Op.EQ(0xF4F4, Op.DUP4)) - + Op.JUMPI(pc=0x41A, condition=Op.EQ(0xFAF4, Op.DUP4)) - + Op.JUMPI(pc=0x402, condition=Op.EQ(0xF1FA, Op.DUP4)) - + Op.JUMPI(pc=0x3EA, condition=Op.EQ(0xF2FA, Op.DUP4)) - + Op.JUMPI(pc=0x3D3, condition=Op.EQ(0xF4FA, Op.DUP4)) - + Op.JUMPI(pc=0x3BC, condition=Op.EQ(0xFAFA, Op.DUP4)) - + Op.JUMPI(pc=0x384, condition=Op.EQ(0xFD, Op.DUP4)) - + Op.JUMPI(pc=0x34A, condition=Op.EQ(0xFE, Op.DUP4)) - + Op.JUMPI(pc=0x311, condition=Op.EQ(0xFF, Op.DUP4)) - + Op.JUMPI(pc=0x2EB, condition=Op.EQ(0xF0, Op.DUP4)) - + Op.JUMPI(pc=0x2C1, condition=Op.EQ(0xF5, Op.DUP4)) - + Op.POP - + Op.JUMPI(pc=0x297, condition=Op.EQ(0xF0F1, Op.DUP3)) - + Op.JUMPI(pc=0x26B, condition=Op.EQ(0xF5F1, Op.DUP3)) - + Op.JUMPI(pc=0x248, condition=Op.EQ(0xF0F2, Op.DUP3)) - + Op.JUMPI(pc=0x223, condition=Op.EQ(0xF5F2, Op.DUP3)) - + Op.JUMPI(pc=0x201, condition=Op.EQ(0xF0F4, Op.DUP3)) - + Op.JUMPI(pc=0x1DD, condition=Op.EQ(0xF5F4, Op.DUP3)) - + Op.JUMPI(pc=0x1B4, condition=Op.EQ(0xF0FA, Op.DUP3)) - + Op.JUMPI(pc=0x189, condition=Op.EQ(0xF5FA, Op.DUP3)) - + Op.POP * 2 - + Op.PUSH5[0x60BACCFA57] - + Op.JUMPI(pc=0x16E, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBAD0BAD0BAD0) - + Op.JUMPDEST - + Op.JUMPI(pc=0x168, condition=Op.ISZERO) * 2 - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.STOP - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.POP - + Op.MSTORE(offset=0x0, value=0x3FF) - + Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP3 - + Op.POP - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP3 - + Op.SWAP4 - + Op.POP - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP4 - + Op.SWAP5 - + Op.POP - + Op.SWAP2 - + Op.POP * 2 - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0xDEADDEAD, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=0x61A8, - address=0x60006, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0x60BACC, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMP(pc=0x156), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 - ) - # Source: yul - # berlin { - # let depth := calldataload(0) - # - # if eq(depth,0) { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # return(0, 0x20) - # } - # - # // Dig deeper - # mstore(0, sub(depth,1)) - # - # // Call yourself with depth-1 - # if iszero(call(gas(), 0x60BACCFA57, 0, 0, 0x20, 0, 0x20)) { - # // Propagate failure if we failed - # revert(0, 0x20) - # } - # - # // Propagate success - # return (0, 0x20) - # } - contract_12 = pre.deploy_contract( # noqa: F841 - code=Op.CALLDATALOAD(offset=0x0) - + Op.JUMPI(pc=0x2D, condition=Op.ISZERO(Op.DUP1)) - + Op.PUSH1[0x1] - + Op.SWAP1 - + Op.MSTORE(offset=0x0, value=Op.SUB) - + Op.JUMPI( - pc=0x27, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000060BACCFA57), # noqa: E501 - ) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0xF1), - Bytes("693c6139") + Hash(0xF2), - Bytes("693c6139") + Hash(0xF4), - Bytes("693c6139") + Hash(0xFA), - Bytes("693c6139") + Hash(0xF1F1), - Bytes("693c6139") + Hash(0xF2F1), - Bytes("693c6139") + Hash(0xF4F1), - Bytes("693c6139") + Hash(0xFAF1), - Bytes("693c6139") + Hash(0xF1F2), - Bytes("693c6139") + Hash(0xF2F2), - Bytes("693c6139") + Hash(0xF4F2), - Bytes("693c6139") + Hash(0xFAF2), - Bytes("693c6139") + Hash(0xF1F4), - Bytes("693c6139") + Hash(0xF2F4), - Bytes("693c6139") + Hash(0xF4F4), - Bytes("693c6139") + Hash(0xFAF4), - Bytes("693c6139") + Hash(0xF1FA), - Bytes("693c6139") + Hash(0xF2FA), - Bytes("693c6139") + Hash(0xF4FA), - Bytes("693c6139") + Hash(0xFAFA), - Bytes("693c6139") + Hash(0xFD), - Bytes("693c6139") + Hash(0xFE), - Bytes("693c6139") + Hash(0xFF), - Bytes("693c6139") + Hash(0xF0), - Bytes("693c6139") + Hash(0xF5), - Bytes("693c6139") + Hash(0xF0F1), - Bytes("693c6139") + Hash(0xF5F1), - Bytes("693c6139") + Hash(0xF0F2), - Bytes("693c6139") + Hash(0xF5F2), - Bytes("693c6139") + Hash(0xF0F4), - Bytes("693c6139") + Hash(0xF5F4), - Bytes("693c6139") + Hash(0xF0FA), - Bytes("693c6139") + Hash(0xF5FA), - Bytes("693c6139") + Hash(contract_12, left_padding=True), - ] - tx_gas = [4503599627370496] - - tx = Transaction( - sender=sender, - to=contract_3, - data=tx_data[d], - gas_limit=tx_gas[g], - nonce=1, - gas_price=2000, - ) - - post = { - contract_3: Account(storage={0: 10}), - contract_10: Account(storage={0: 24743}), - contract_9: Account(storage={0: 24743}), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_base_fee_diff_places_osaka.py b/tests/ported_static/stEIP1559/test_base_fee_diff_places_osaka.py deleted file mode 100644 index 219a1153241..00000000000 --- a/tests/ported_static/stEIP1559/test_base_fee_diff_places_osaka.py +++ /dev/null @@ -1,1267 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/baseFeeDiffPlacesOsakaFiller.yml -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/baseFeeDiffPlacesOsakaFiller.yml"], -) -@pytest.mark.valid_from("Osaka") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="normal", - ), - pytest.param( - 1, - 0, - 0, - id="normal", - ), - pytest.param( - 2, - 0, - 0, - id="normal", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - pytest.param( - 5, - 0, - 0, - id="d5", - ), - pytest.param( - 6, - 0, - 0, - id="d6", - ), - pytest.param( - 7, - 0, - 0, - id="d7", - ), - pytest.param( - 8, - 0, - 0, - id="d8", - ), - pytest.param( - 9, - 0, - 0, - id="d9", - ), - pytest.param( - 10, - 0, - 0, - id="d10", - ), - pytest.param( - 11, - 0, - 0, - id="d11", - ), - pytest.param( - 12, - 0, - 0, - id="d12", - ), - pytest.param( - 13, - 0, - 0, - id="d13", - ), - pytest.param( - 14, - 0, - 0, - id="d14", - ), - pytest.param( - 15, - 0, - 0, - id="d15", - ), - pytest.param( - 16, - 0, - 0, - id="d16", - ), - pytest.param( - 17, - 0, - 0, - id="d17", - ), - pytest.param( - 18, - 0, - 0, - id="d18", - ), - pytest.param( - 19, - 0, - 0, - id="d19", - ), - pytest.param( - 20, - 0, - 0, - id="d20", - ), - pytest.param( - 21, - 0, - 0, - id="d21", - ), - pytest.param( - 22, - 0, - 0, - id="d22", - ), - pytest.param( - 23, - 0, - 0, - id="d23", - ), - pytest.param( - 24, - 0, - 0, - id="d24", - ), - pytest.param( - 25, - 0, - 0, - id="d25", - ), - pytest.param( - 26, - 0, - 0, - id="d26", - ), - pytest.param( - 27, - 0, - 0, - id="d27", - ), - pytest.param( - 28, - 0, - 0, - id="d28", - ), - pytest.param( - 29, - 0, - 0, - id="d29", - ), - pytest.param( - 30, - 0, - 0, - id="d30", - ), - pytest.param( - 31, - 0, - 0, - id="d31", - ), - pytest.param( - 32, - 0, - 0, - id="d32", - ), - pytest.param( - 33, - 0, - 0, - id="d33", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_base_fee_diff_places( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x000000000000000000000000000000000000C0DE) - contract_1 = Address(0x000000000000000000000000000000000020C0DE) - contract_2 = Address(0x00000000000000000000000000000000C0DEC0DE) - contract_3 = Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC) - contract_4 = Address(0x000000000000000000000000000000000000CA11) - contract_5 = Address(0x00000000000000000000000000000000CA1100F1) - contract_6 = Address(0x00000000000000000000000000000000CA1100F2) - contract_7 = Address(0x00000000000000000000000000000000CA1100F4) - contract_8 = Address(0x00000000000000000000000000000000CA1100FA) - contract_9 = Address(0x0000000000000000000000000000000000060006) - contract_10 = Address(0x000000000000000000000000000000000060BACC) - contract_11 = Address(0x00000000000000000000000000000000DEADDEAD) - contract_12 = Address(0x00000000000000000000000000000060BACCFA57) - sender = pre.fund_eoa(amount=0x3635C9ADC5DEA00000, nonce=1) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # - # // Here the result is is mload(0). We want to run it, but - # // prefix it with a zero so we'll be safe from being considered - # // an invalid program. - # // - # // If we use this as a constructor the result will be - # // the code of the created contract, but we can live - # // with that. We won't call it. - # mstore(0x40, mload(0x00)) - # return(0x3F, 0x21) - # } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.MSTORE(offset=0x40, value=Op.MLOAD(offset=0x0)) - + Op.RETURN(offset=0x3F, size=0x21), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # - # // Here the result is is mload(0). - # return(0x00, 0x20) - # } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000020C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # return(0, 0x20) // return the result as our return value - # } - contract_4 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000CA11), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # sstore(0,mload(0)) - # invalid() - # } - contract_9 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.INVALID, - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x0000000000000000000000000000000000060006), # noqa: E501 - ) - # Source: yul - # berlin { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # sstore(0,mload(0)) - # revert(0,0x20) - # } - contract_10 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.REVERT(offset=0x0, size=0x20), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000060BACC), # noqa: E501 - ) - # Source: yul - # berlin { - # selfdestruct(0) - # } - contract_11 = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT(address=0x0), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000DEADDEAD), # noqa: E501 - ) - # Source: yul - # berlin { - # let addr := 0x20C0DE - # let length := extcodesize(addr) - # - # // Read the code from 0x20C0DE - # extcodecopy(addr, 0, 0, length) - # - # // Return this memory as the code for the contract - # return(0, length) - # } - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.PUSH1[0x0] - + Op.PUSH3[0x20C0DE] - + Op.DUP2 - + Op.EXTCODESIZE(address=Op.DUP2) - + Op.SWAP3 - + Op.DUP4 - + Op.SWAP3 - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.RETURN, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000C0DEC0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_6 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F2), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(call(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_5 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F1), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(staticcall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_8 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100FA), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(delegatecall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_7 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F4), # noqa: E501 - ) - # Source: yul - # berlin { - # let action := calldataload(4) - # let res := 1 // If the result of a call is revert, revert here too - # let addr := 1 // If the result of CREATE[2] is zero, it reverted - # - # // For when we need code in our memory - # let codeBuffer := 0x20 - # // When running the template in the constructor - # let codeLength := extcodesize(0xC0DE) - # // When running the template in the created code - # let codeLength2 := extcodesize(0xC0DEC0DE) - # - # // Goat should be overwritten - # mstore(0, 0x60A7) - # - # switch action - # case 0 { // run the code snippet as normal code - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # } - # - # // One level of call stack - # case 0xF1 { // call a contract to run this code - # res := call(gas(), 0xca11, 0, 0, 0, 0, 0x20) // call template code - # } - # case 0xF2 { // callcode a contract to run this code - # ... (290 more lines) - contract_3 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=0x60A7) - + Op.PUSH1[0x1] - + Op.DUP1 - + Op.CALLDATALOAD(offset=0x4) - + Op.EXTCODESIZE(address=0xC0DEC0DE) - + Op.PUSH1[0x20] - + Op.EXTCODESIZE(address=0xC0DE) - + Op.JUMPI(pc=0x58A, condition=Op.ISZERO(Op.DUP4)) - + Op.JUMPI(pc=0x574, condition=Op.EQ(0xF1, Op.DUP4)) - + Op.JUMPI(pc=0x55E, condition=Op.EQ(0xF2, Op.DUP4)) - + Op.JUMPI(pc=0x549, condition=Op.EQ(0xF4, Op.DUP4)) - + Op.JUMPI(pc=0x534, condition=Op.EQ(0xFA, Op.DUP4)) - + Op.JUMPI(pc=0x51C, condition=Op.EQ(0xF1F1, Op.DUP4)) - + Op.JUMPI(pc=0x504, condition=Op.EQ(0xF2F1, Op.DUP4)) - + Op.JUMPI(pc=0x4ED, condition=Op.EQ(0xF4F1, Op.DUP4)) - + Op.JUMPI(pc=0x4D6, condition=Op.EQ(0xFAF1, Op.DUP4)) - + Op.JUMPI(pc=0x4BE, condition=Op.EQ(0xF1F2, Op.DUP4)) - + Op.JUMPI(pc=0x4A6, condition=Op.EQ(0xF2F2, Op.DUP4)) - + Op.JUMPI(pc=0x48F, condition=Op.EQ(0xF4F2, Op.DUP4)) - + Op.JUMPI(pc=0x478, condition=Op.EQ(0xFAF2, Op.DUP4)) - + Op.JUMPI(pc=0x460, condition=Op.EQ(0xF1F4, Op.DUP4)) - + Op.JUMPI(pc=0x448, condition=Op.EQ(0xF2F4, Op.DUP4)) - + Op.JUMPI(pc=0x431, condition=Op.EQ(0xF4F4, Op.DUP4)) - + Op.JUMPI(pc=0x41A, condition=Op.EQ(0xFAF4, Op.DUP4)) - + Op.JUMPI(pc=0x402, condition=Op.EQ(0xF1FA, Op.DUP4)) - + Op.JUMPI(pc=0x3EA, condition=Op.EQ(0xF2FA, Op.DUP4)) - + Op.JUMPI(pc=0x3D3, condition=Op.EQ(0xF4FA, Op.DUP4)) - + Op.JUMPI(pc=0x3BC, condition=Op.EQ(0xFAFA, Op.DUP4)) - + Op.JUMPI(pc=0x384, condition=Op.EQ(0xFD, Op.DUP4)) - + Op.JUMPI(pc=0x34A, condition=Op.EQ(0xFE, Op.DUP4)) - + Op.JUMPI(pc=0x311, condition=Op.EQ(0xFF, Op.DUP4)) - + Op.JUMPI(pc=0x2EB, condition=Op.EQ(0xF0, Op.DUP4)) - + Op.JUMPI(pc=0x2C1, condition=Op.EQ(0xF5, Op.DUP4)) - + Op.POP - + Op.JUMPI(pc=0x297, condition=Op.EQ(0xF0F1, Op.DUP3)) - + Op.JUMPI(pc=0x26B, condition=Op.EQ(0xF5F1, Op.DUP3)) - + Op.JUMPI(pc=0x248, condition=Op.EQ(0xF0F2, Op.DUP3)) - + Op.JUMPI(pc=0x223, condition=Op.EQ(0xF5F2, Op.DUP3)) - + Op.JUMPI(pc=0x201, condition=Op.EQ(0xF0F4, Op.DUP3)) - + Op.JUMPI(pc=0x1DD, condition=Op.EQ(0xF5F4, Op.DUP3)) - + Op.JUMPI(pc=0x1B4, condition=Op.EQ(0xF0FA, Op.DUP3)) - + Op.JUMPI(pc=0x189, condition=Op.EQ(0xF5FA, Op.DUP3)) - + Op.POP * 2 - + Op.PUSH5[0x60BACCFA57] - + Op.JUMPI(pc=0x16E, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBAD0BAD0BAD0) - + Op.JUMPDEST - + Op.JUMPI(pc=0x168, condition=Op.ISZERO) * 2 - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.STOP - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.POP - + Op.MSTORE(offset=0x0, value=0x3FF) - + Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP3 - + Op.POP - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP3 - + Op.SWAP4 - + Op.POP - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP4 - + Op.SWAP5 - + Op.POP - + Op.SWAP2 - + Op.POP * 2 - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0xDEADDEAD, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=0x61A8, - address=0x60006, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0x60BACC, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMPI( - pc=0x156, condition=Op.EQ(Op.SLOAD(key=0x0), Op.MLOAD(offset=0x0)) - ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.JUMP(pc=0x156), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 - ) - # Source: yul - # berlin { - # let depth := calldataload(0) - # - # if eq(depth,0) { - # // basefee is still not supported in Yul 0.8.5 - # - # - # mstore(0, verbatim_0i_1o(hex"48")) - # - # - # return(0, 0x20) - # } - # - # // Dig deeper - # mstore(0, sub(depth,1)) - # - # // Call yourself with depth-1 - # if iszero(call(gas(), 0x60BACCFA57, 0, 0, 0x20, 0, 0x20)) { - # // Propagate failure if we failed - # revert(0, 0x20) - # } - # - # // Propagate success - # return (0, 0x20) - # } - contract_12 = pre.deploy_contract( # noqa: F841 - code=Op.CALLDATALOAD(offset=0x0) - + Op.JUMPI(pc=0x2D, condition=Op.ISZERO(Op.DUP1)) - + Op.PUSH1[0x1] - + Op.SWAP1 - + Op.MSTORE(offset=0x0, value=Op.SUB) - + Op.JUMPI( - pc=0x27, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.MSTORE(offset=0x0, value=Op.BASEFEE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000060BACCFA57), # noqa: E501 - ) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0xF1), - Bytes("693c6139") + Hash(0xF2), - Bytes("693c6139") + Hash(0xF4), - Bytes("693c6139") + Hash(0xFA), - Bytes("693c6139") + Hash(0xF1F1), - Bytes("693c6139") + Hash(0xF2F1), - Bytes("693c6139") + Hash(0xF4F1), - Bytes("693c6139") + Hash(0xFAF1), - Bytes("693c6139") + Hash(0xF1F2), - Bytes("693c6139") + Hash(0xF2F2), - Bytes("693c6139") + Hash(0xF4F2), - Bytes("693c6139") + Hash(0xFAF2), - Bytes("693c6139") + Hash(0xF1F4), - Bytes("693c6139") + Hash(0xF2F4), - Bytes("693c6139") + Hash(0xF4F4), - Bytes("693c6139") + Hash(0xFAF4), - Bytes("693c6139") + Hash(0xF1FA), - Bytes("693c6139") + Hash(0xF2FA), - Bytes("693c6139") + Hash(0xF4FA), - Bytes("693c6139") + Hash(0xFAFA), - Bytes("693c6139") + Hash(0xFD), - Bytes("693c6139") + Hash(0xFE), - Bytes("693c6139") + Hash(0xFF), - Bytes("693c6139") + Hash(0xF0), - Bytes("693c6139") + Hash(0xF5), - Bytes("693c6139") + Hash(0xF0F1), - Bytes("693c6139") + Hash(0xF5F1), - Bytes("693c6139") + Hash(0xF0F2), - Bytes("693c6139") + Hash(0xF5F2), - Bytes("693c6139") + Hash(0xF0F4), - Bytes("693c6139") + Hash(0xF5F4), - Bytes("693c6139") + Hash(0xF0FA), - Bytes("693c6139") + Hash(0xF5FA), - ] - tx_gas = [1000000] - - tx = Transaction( - sender=sender, - to=contract_3, - data=tx_data[d], - gas_limit=tx_gas[g], - nonce=1, - gas_price=2000, - ) - - post = { - contract_3: Account(storage={0: 10}), - contract_10: Account(storage={0: 24743}), - contract_9: Account(storage={0: 24743}), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_diff_places.py b/tests/ported_static/stEIP1559/test_diff_places.py new file mode 100644 index 00000000000..41d5d303b76 --- /dev/null +++ b/tests/ported_static/stEIP1559/test_diff_places.py @@ -0,0 +1,253 @@ +""" +Read BASEFEE and GASPRICE from different execution contexts. + +Ported from: +state_tests/stEIP1559/baseFeeDiffPlacesFiller.yml +state_tests/stEIP1559/baseFeeDiffPlacesOsakaFiller.yml +state_tests/stEIP1559/gasPriceDiffPlacesFiller.yml +state_tests/stEIP1559/gasPriceDiffPlacesOsakaFiller.yml + +@manually-enhanced: Do not overwrite. Merged into one parametrized test. +""" + +from typing import Dict + +import pytest +from execution_testing import ( + Account, + Address, + Alloc, + Bytecode, + Conditional, + Environment, + Initcode, + StateTestFiller, + Transaction, +) +from execution_testing.forks import Fork +from execution_testing.vm import Op + +from tests.ported_static.constants import HIGH_GAS_LIMIT + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +PORTED_FROM = [ + "state_tests/stEIP1559/baseFeeDiffPlacesFiller.yml", + "state_tests/stEIP1559/baseFeeDiffPlacesOsakaFiller.yml", + "state_tests/stEIP1559/gasPriceDiffPlacesFiller.yml", + "state_tests/stEIP1559/gasPriceDiffPlacesOsakaFiller.yml", +] + +GAS_PRICE = 2000 +GOAT = 0x60A7 +RECURSION_DEPTH = 1023 +RECURSION_GAS_LIMIT = 0x10000000000000 +CREATE2_SALT = 0x5A17 +FAILING_CALL_GAS = 25_000 + +CALL_OPS = { + "call": Op.CALL, + "callcode": Op.CALLCODE, + "delegatecall": Op.DELEGATECALL, + "staticcall": Op.STATICCALL, +} +CREATE_OPS = {"create": Op.CREATE, "create2": Op.CREATE2} + +ACTIONS = ( + ["direct"] + + list(CALL_OPS) + + [f"{outer}_{inner}" for inner in CALL_OPS for outer in CALL_OPS] + + ["after_revert", "after_oog", "after_selfdestruct"] + + list(CREATE_OPS) + + [f"{create}_{call}" for create in CREATE_OPS for call in CALL_OPS] +) + +OPCODES = pytest.mark.parametrize( + "opcode", [Op.BASEFEE, Op.GASPRICE], ids=["base_fee", "gas_price"] +) + + +def expected_value(opcode: Op, fork: Fork) -> int: + """Return the value the opcode is expected to push.""" + if opcode == Op.BASEFEE: + base_fee = Environment().set_fork_requirements(fork).base_fee_per_gas + assert base_fee is not None + return int(base_fee) + return GAS_PRICE + + +def call_into(op: Op, address: Address | Bytecode) -> Bytecode: + """Call `address` with `op`, copying 32 bytes of output to memory 0.""" + return op(address=address, ret_offset=0, ret_size=0x20) + + +def run_and_create( + create: str, initcode_holder: Address, create_value: int = 0 +) -> Bytecode: + """Create a contract with the initcode held by `initcode_holder`.""" + size = Op.EXTCODESIZE(initcode_holder) + code = Op.EXTCODECOPY( + address=initcode_holder, dest_offset=0x20, offset=0, size=size + ) + if create == "create": + return code + Op.CREATE(value=create_value, offset=0x20, size=size) + return code + Op.CREATE2( + value=create_value, offset=0x20, size=size, salt=CREATE2_SALT + ) + + +@pytest.mark.ported_from(PORTED_FROM) +@pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip(reason="Expects the base fee of the test env") +) +@OPCODES +@pytest.mark.parametrize("action", ACTIONS) +def test_diff_places( + state_test: StateTestFiller, + pre: Alloc, + fork: Fork, + opcode: Op, + action: str, +) -> None: + """Read the opcode directly, through calls, and in created code.""" + template = Op.MSTORE(offset=0, value=opcode) + expected = expected_value(opcode, fork) + sender = pre.fund_eoa() + post: Dict[Address, Account] = {} + + runner = pre.deploy_contract(code=template + Op.RETURN(0, 0x20)) + relays = { + name: pre.deploy_contract( + code=Op.POP(call_into(op, runner)) + Op.RETURN(0, 0x20) + ) + for name, op in CALL_OPS.items() + } + reverter = pre.deploy_contract( + code=template + + Op.SSTORE(0, Op.MLOAD(0)) + + Op.REVERT(offset=0, size=0x20), + storage={0: GOAT}, + ) + out_of_gas = pre.deploy_contract( + code=template + Op.SSTORE(0, Op.MLOAD(0)) + Op.INVALID, + storage={0: GOAT}, + ) + self_destructor = pre.deploy_contract(code=Op.SELFDESTRUCT(0)) + constructor_holder = pre.deploy_contract( + code=template + + Op.MSTORE(0x40, Op.MLOAD(0)) + + Op.RETURN(offset=0x3F, size=0x21), + ) + runtime_holder = pre.deploy_contract( + code=Initcode(deploy_code=template + Op.RETURN(0, 0x20)), + ) + + body: Bytecode + if action == "direct": + body = template + elif action in CALL_OPS: + body = Op.POP(call_into(CALL_OPS[action], runner)) + elif action in ("after_revert", "after_oog", "after_selfdestruct"): + failing = { + "after_revert": reverter, + "after_oog": out_of_gas, + "after_selfdestruct": self_destructor, + }[action] + body = ( + template + + Op.SSTORE(1, Op.MLOAD(0)) + + Op.MSTORE(0, GOAT) + + Op.POP(Op.CALL(gas=FAILING_CALL_GAS, address=failing)) + + template + ) + post[reverter] = Account(storage={0: GOAT}) + post[out_of_gas] = Account(storage={0: GOAT}) + elif action in CREATE_OPS: + body = Op.EXTCODECOPY( + address=run_and_create(action, constructor_holder), + dest_offset=0, + offset=1, + size=0x20, + ) + else: + first, second = action.split("_") + if first in CREATE_OPS: + body = Op.POP( + call_into( + CALL_OPS[second], run_and_create(first, runtime_holder) + ) + ) + else: + body = Op.POP(call_into(CALL_OPS[first], relays[second])) + + checker = pre.deploy_contract( + code=Op.MSTORE(0, GOAT) + body + Op.SSTORE(0, Op.MLOAD(0)), + ) + storage = {0: expected} + if action.startswith("after_"): + storage[1] = expected + post[checker] = Account(storage=storage) + + tx = Transaction(sender=sender, to=checker, gas_price=GAS_PRICE) + state_test(pre=pre, post=post, tx=tx) + + +@pytest.mark.ported_from(PORTED_FROM) +@pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip(reason="Expects the base fee of the test env") +) +@pytest.mark.valid_until("Prague") +@OPCODES +def test_diff_places_deep_recursion( + state_test: StateTestFiller, + pre: Alloc, + fork: Fork, + opcode: Op, +) -> None: + """Read the opcode at the bottom of a deep recursion.""" + template = Op.MSTORE(offset=0, value=opcode) + sender = pre.fund_eoa(amount=RECURSION_GAS_LIMIT * GAS_PRICE) + recursor = pre.deploy_contract( + code=Conditional( + condition=Op.ISZERO(Op.CALLDATALOAD(0)), + if_true=template, + if_false=Op.MSTORE(0, Op.SUB(Op.CALLDATALOAD(0), 1)) + + Op.POP( + Op.CALL( + address=Op.ADDRESS, + args_offset=0, + args_size=0x20, + ret_offset=0, + ret_size=0x20, + ) + ), + ) + + Op.RETURN(0, 0x20), + ) + checker = pre.deploy_contract( + code=Op.MSTORE(0, RECURSION_DEPTH) + + Op.POP( + Op.CALL( + address=recursor, + args_offset=0, + args_size=0x20, + ret_offset=0, + ret_size=0x20, + ) + ) + + Op.SSTORE(0, Op.MLOAD(0)), + ) + + tx = Transaction( + sender=sender, + to=checker, + gas_limit=RECURSION_GAS_LIMIT, + gas_price=GAS_PRICE, + ) + post = {checker: Account(storage={0: expected_value(opcode, fork)})} + state_test( + env=Environment(gas_limit=HIGH_GAS_LIMIT), pre=pre, post=post, tx=tx + ) diff --git a/tests/ported_static/stEIP1559/test_gas_price_diff_places.py b/tests/ported_static/stEIP1559/test_gas_price_diff_places.py deleted file mode 100644 index 5017a3dcd29..00000000000 --- a/tests/ported_static/stEIP1559/test_gas_price_diff_places.py +++ /dev/null @@ -1,1244 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/gasPriceDiffPlacesFiller.yml -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.constants import HIGH_GAS_LIMIT - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/gasPriceDiffPlacesFiller.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.valid_until("Prague") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="normal", - ), - pytest.param( - 1, - 0, - 0, - id="normal", - ), - pytest.param( - 2, - 0, - 0, - id="normal", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - pytest.param( - 5, - 0, - 0, - id="d5", - ), - pytest.param( - 6, - 0, - 0, - id="d6", - ), - pytest.param( - 7, - 0, - 0, - id="d7", - ), - pytest.param( - 8, - 0, - 0, - id="d8", - ), - pytest.param( - 9, - 0, - 0, - id="d9", - ), - pytest.param( - 10, - 0, - 0, - id="d10", - ), - pytest.param( - 11, - 0, - 0, - id="d11", - ), - pytest.param( - 12, - 0, - 0, - id="d12", - ), - pytest.param( - 13, - 0, - 0, - id="d13", - ), - pytest.param( - 14, - 0, - 0, - id="d14", - ), - pytest.param( - 15, - 0, - 0, - id="d15", - ), - pytest.param( - 16, - 0, - 0, - id="d16", - ), - pytest.param( - 17, - 0, - 0, - id="d17", - ), - pytest.param( - 18, - 0, - 0, - id="d18", - ), - pytest.param( - 19, - 0, - 0, - id="d19", - ), - pytest.param( - 20, - 0, - 0, - id="d20", - ), - pytest.param( - 21, - 0, - 0, - id="d21", - ), - pytest.param( - 22, - 0, - 0, - id="d22", - ), - pytest.param( - 23, - 0, - 0, - id="d23", - ), - pytest.param( - 24, - 0, - 0, - id="d24", - ), - pytest.param( - 25, - 0, - 0, - id="d25", - ), - pytest.param( - 26, - 0, - 0, - id="d26", - ), - pytest.param( - 27, - 0, - 0, - id="d27", - ), - pytest.param( - 28, - 0, - 0, - id="d28", - ), - pytest.param( - 29, - 0, - 0, - id="d29", - ), - pytest.param( - 30, - 0, - 0, - id="d30", - ), - pytest.param( - 31, - 0, - 0, - id="d31", - ), - pytest.param( - 32, - 0, - 0, - id="d32", - ), - pytest.param( - 33, - 0, - 0, - id="d33", - ), - pytest.param( - 34, - 0, - 0, - id="d34", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_gas_price_diff_places( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0x3635C9ADC5DEA00000, nonce=1) - - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # - # // Here the result is is mload(0). We want to run it, but - # // prefix it with a zero so we'll be safe from being considered - # // an invalid program. - # // - # // If we use this as a constructor the result will be - # // the code of the created contract, but we can live - # // with that. We won't call it. - # mstore(0x40, mload(0x00)) - # return(0x3F, 0x21) - # } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.MSTORE(offset=0x40, value=Op.MLOAD(offset=0x0)) - + Op.RETURN(offset=0x3F, size=0x21), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # - # // Here the result is is mload(0). - # return(0x00, 0x20) - # } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000020C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # return(0, 0x20) // return the result as our return value - # } - contract_4 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000CA11), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # sstore(0,mload(0)) - # invalid() - # } - contract_9 = pre.deploy_contract( - code=Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SSTORE - + Op.INVALID, - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x0000000000000000000000000000000000060006), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # sstore(0,mload(0)) - # revert(0,0x20) - # } - contract_10 = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.REVERT(offset=0x0, size=0x20), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000060BACC), # noqa: E501 - ) - # Source: yul - # berlin { - # selfdestruct(0) - # } - contract_11 = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT(address=0x0), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000DEADDEAD), # noqa: E501 - ) - # Source: yul - # berlin { - # let addr := 0x20C0DE - # let length := extcodesize(addr) - # - # // Read the code from 0x20C0DE - # extcodecopy(addr, 0, 0, length) - # - # // Return this memory as the code for the contract - # return(0, length) - # } - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.PUSH1[0x0] - + Op.PUSH3[0x20C0DE] - + Op.DUP2 - + Op.EXTCODESIZE(address=Op.DUP2) - + Op.SWAP3 - + Op.DUP4 - + Op.SWAP3 - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.RETURN, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000C0DEC0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_6 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F2), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(call(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_5 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F1), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(staticcall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_8 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100FA), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(delegatecall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_7 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F4), # noqa: E501 - ) - # Source: yul - # berlin { - # let action := calldataload(4) - # let res := 1 // If the result of a call is revert, revert here too - # let addr := 1 // If the result of CREATE[2] is zero, it reverted - # - # // For when we need code in our memory - # let codeBuffer := 0x20 - # // When running the template in the constructor - # let codeLength := extcodesize(0xC0DE) - # // When running the template in the created code - # let codeLength2 := extcodesize(0xC0DEC0DE) - # - # // Goat should be overwritten - # mstore(0, 0x60A7) - # - # switch action - # case 0 { // run the code snippet as normal code - # mstore(0, gasprice()) - # - # - # } - # - # // One level of call stack - # case 0xF1 { // call a contract to run this code - # res := call(gas(), 0xca11, 0, 0, 0, 0, 0x20) // call template code - # } - # case 0xF2 { // callcode a contract to run this code - # res := callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20) - # } - # case 0xF4 { // delegate call a contract to run this code - # ... (269 more lines) - contract_3 = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=0x60A7) - + Op.PUSH1[0x1] - + Op.DUP1 - + Op.CALLDATALOAD(offset=0x4) - + Op.EXTCODESIZE(address=0xC0DEC0DE) - + Op.PUSH1[0x20] - + Op.EXTCODESIZE(address=0xC0DE) - + Op.JUMPI(pc=0x581, condition=Op.ISZERO(Op.DUP4)) - + Op.JUMPI(pc=0x56B, condition=Op.EQ(0xF1, Op.DUP4)) - + Op.JUMPI(pc=0x555, condition=Op.EQ(0xF2, Op.DUP4)) - + Op.JUMPI(pc=0x540, condition=Op.EQ(0xF4, Op.DUP4)) - + Op.JUMPI(pc=0x52B, condition=Op.EQ(0xFA, Op.DUP4)) - + Op.JUMPI(pc=0x513, condition=Op.EQ(0xF1F1, Op.DUP4)) - + Op.JUMPI(pc=0x4FB, condition=Op.EQ(0xF2F1, Op.DUP4)) - + Op.JUMPI(pc=0x4E4, condition=Op.EQ(0xF4F1, Op.DUP4)) - + Op.JUMPI(pc=0x4CD, condition=Op.EQ(0xFAF1, Op.DUP4)) - + Op.JUMPI(pc=0x4B5, condition=Op.EQ(0xF1F2, Op.DUP4)) - + Op.JUMPI(pc=0x49D, condition=Op.EQ(0xF2F2, Op.DUP4)) - + Op.JUMPI(pc=0x486, condition=Op.EQ(0xF4F2, Op.DUP4)) - + Op.JUMPI(pc=0x46F, condition=Op.EQ(0xFAF2, Op.DUP4)) - + Op.JUMPI(pc=0x457, condition=Op.EQ(0xF1F4, Op.DUP4)) - + Op.JUMPI(pc=0x43F, condition=Op.EQ(0xF2F4, Op.DUP4)) - + Op.JUMPI(pc=0x428, condition=Op.EQ(0xF4F4, Op.DUP4)) - + Op.JUMPI(pc=0x411, condition=Op.EQ(0xFAF4, Op.DUP4)) - + Op.JUMPI(pc=0x3F9, condition=Op.EQ(0xF1FA, Op.DUP4)) - + Op.JUMPI(pc=0x3E1, condition=Op.EQ(0xF2FA, Op.DUP4)) - + Op.JUMPI(pc=0x3CA, condition=Op.EQ(0xF4FA, Op.DUP4)) - + Op.JUMPI(pc=0x3B3, condition=Op.EQ(0xFAFA, Op.DUP4)) - + Op.JUMPI(pc=0x37E, condition=Op.EQ(0xFD, Op.DUP4)) - + Op.JUMPI(pc=0x347, condition=Op.EQ(0xFE, Op.DUP4)) - + Op.JUMPI(pc=0x311, condition=Op.EQ(0xFF, Op.DUP4)) - + Op.JUMPI(pc=0x2EB, condition=Op.EQ(0xF0, Op.DUP4)) - + Op.JUMPI(pc=0x2C1, condition=Op.EQ(0xF5, Op.DUP4)) - + Op.POP - + Op.JUMPI(pc=0x297, condition=Op.EQ(0xF0F1, Op.DUP3)) - + Op.JUMPI(pc=0x26B, condition=Op.EQ(0xF5F1, Op.DUP3)) - + Op.JUMPI(pc=0x248, condition=Op.EQ(0xF0F2, Op.DUP3)) - + Op.JUMPI(pc=0x223, condition=Op.EQ(0xF5F2, Op.DUP3)) - + Op.JUMPI(pc=0x201, condition=Op.EQ(0xF0F4, Op.DUP3)) - + Op.JUMPI(pc=0x1DD, condition=Op.EQ(0xF5F4, Op.DUP3)) - + Op.JUMPI(pc=0x1B4, condition=Op.EQ(0xF0FA, Op.DUP3)) - + Op.JUMPI(pc=0x189, condition=Op.EQ(0xF5FA, Op.DUP3)) - + Op.POP * 2 - + Op.PUSH5[0x60BACCFA57] - + Op.JUMPI(pc=0x16E, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBAD0BAD0BAD0) - + Op.JUMPDEST - + Op.JUMPI(pc=0x168, condition=Op.ISZERO) * 2 - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.STOP - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.POP - + Op.MSTORE(offset=0x0, value=0x3FF) - + Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP3 - + Op.POP - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP3 - + Op.SWAP4 - + Op.POP - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP4 - + Op.SWAP5 - + Op.POP - + Op.SWAP2 - + Op.POP * 2 - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0xDEADDEAD, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=0x61A8, - address=0x60006, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0x60BACC, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.JUMP(pc=0x156), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 - ) - # Source: yul - # berlin { - # let depth := calldataload(0) - # - # if eq(depth,0) { - # mstore(0, gasprice()) - # - # - # return(0, 0x20) - # } - # - # // Dig deeper - # mstore(0, sub(depth,1)) - # - # // Call yourself with depth-1 - # if iszero(call(gas(), 0x60BACCFA57, 0, 0, 0x20, 0, 0x20)) { - # // Propagate failure if we failed - # revert(0, 0x20) - # } - # - # // Propagate success - # return (0, 0x20) - # } - contract_12 = pre.deploy_contract( - code=Op.CALLDATALOAD(offset=0x0) - + Op.JUMPI(pc=0x2D, condition=Op.ISZERO(Op.DUP1)) - + Op.PUSH1[0x1] - + Op.SWAP1 - + Op.MSTORE(offset=0x0, value=Op.SUB) - + Op.JUMPI( - pc=0x27, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000060BACCFA57), # noqa: E501 - ) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0xF1), - Bytes("693c6139") + Hash(0xF2), - Bytes("693c6139") + Hash(0xF4), - Bytes("693c6139") + Hash(0xFA), - Bytes("693c6139") + Hash(0xF1F1), - Bytes("693c6139") + Hash(0xF2F1), - Bytes("693c6139") + Hash(0xF4F1), - Bytes("693c6139") + Hash(0xFAF1), - Bytes("693c6139") + Hash(0xF1F2), - Bytes("693c6139") + Hash(0xF2F2), - Bytes("693c6139") + Hash(0xF4F2), - Bytes("693c6139") + Hash(0xFAF2), - Bytes("693c6139") + Hash(0xF1F4), - Bytes("693c6139") + Hash(0xF2F4), - Bytes("693c6139") + Hash(0xF4F4), - Bytes("693c6139") + Hash(0xFAF4), - Bytes("693c6139") + Hash(0xF1FA), - Bytes("693c6139") + Hash(0xF2FA), - Bytes("693c6139") + Hash(0xF4FA), - Bytes("693c6139") + Hash(0xFAFA), - Bytes("693c6139") + Hash(0xFD), - Bytes("693c6139") + Hash(0xFE), - Bytes("693c6139") + Hash(0xFF), - Bytes("693c6139") + Hash(0xF0), - Bytes("693c6139") + Hash(0xF5), - Bytes("693c6139") + Hash(0xF0F1), - Bytes("693c6139") + Hash(0xF5F1), - Bytes("693c6139") + Hash(0xF0F2), - Bytes("693c6139") + Hash(0xF5F2), - Bytes("693c6139") + Hash(0xF0F4), - Bytes("693c6139") + Hash(0xF5F4), - Bytes("693c6139") + Hash(0xF0FA), - Bytes("693c6139") + Hash(0xF5FA), - Bytes("693c6139") + Hash(contract_12, left_padding=True), - ] - tx_gas = [4503599627370496] - - env = Environment(base_fee_per_gas=10, gas_limit=HIGH_GAS_LIMIT) - - tx = Transaction( - sender=sender, - to=contract_3, - data=tx_data[d], - gas_limit=tx_gas[g], - nonce=1, - gas_price=2000, - ) - - post = { - contract_3: Account(storage={0: 2000}), - contract_10: Account(storage={0: 24743}), - contract_9: Account(storage={0: 24743}), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_gas_price_diff_places_osaka.py b/tests/ported_static/stEIP1559/test_gas_price_diff_places_osaka.py deleted file mode 100644 index 3d91acb3dba..00000000000 --- a/tests/ported_static/stEIP1559/test_gas_price_diff_places_osaka.py +++ /dev/null @@ -1,1234 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/gasPriceDiffPlacesOsakaFiller.yml -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/gasPriceDiffPlacesOsakaFiller.yml"], -) -@pytest.mark.valid_from("Osaka") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="normal", - ), - pytest.param( - 1, - 0, - 0, - id="normal", - ), - pytest.param( - 2, - 0, - 0, - id="normal", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - pytest.param( - 5, - 0, - 0, - id="d5", - ), - pytest.param( - 6, - 0, - 0, - id="d6", - ), - pytest.param( - 7, - 0, - 0, - id="d7", - ), - pytest.param( - 8, - 0, - 0, - id="d8", - ), - pytest.param( - 9, - 0, - 0, - id="d9", - ), - pytest.param( - 10, - 0, - 0, - id="d10", - ), - pytest.param( - 11, - 0, - 0, - id="d11", - ), - pytest.param( - 12, - 0, - 0, - id="d12", - ), - pytest.param( - 13, - 0, - 0, - id="d13", - ), - pytest.param( - 14, - 0, - 0, - id="d14", - ), - pytest.param( - 15, - 0, - 0, - id="d15", - ), - pytest.param( - 16, - 0, - 0, - id="d16", - ), - pytest.param( - 17, - 0, - 0, - id="d17", - ), - pytest.param( - 18, - 0, - 0, - id="d18", - ), - pytest.param( - 19, - 0, - 0, - id="d19", - ), - pytest.param( - 20, - 0, - 0, - id="d20", - ), - pytest.param( - 21, - 0, - 0, - id="d21", - ), - pytest.param( - 22, - 0, - 0, - id="d22", - ), - pytest.param( - 23, - 0, - 0, - id="d23", - ), - pytest.param( - 24, - 0, - 0, - id="d24", - ), - pytest.param( - 25, - 0, - 0, - id="d25", - ), - pytest.param( - 26, - 0, - 0, - id="d26", - ), - pytest.param( - 27, - 0, - 0, - id="d27", - ), - pytest.param( - 28, - 0, - 0, - id="d28", - ), - pytest.param( - 29, - 0, - 0, - id="d29", - ), - pytest.param( - 30, - 0, - 0, - id="d30", - ), - pytest.param( - 31, - 0, - 0, - id="d31", - ), - pytest.param( - 32, - 0, - 0, - id="d32", - ), - pytest.param( - 33, - 0, - 0, - id="d33", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_gas_price_diff_places( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0x3635C9ADC5DEA00000, nonce=1) - - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # - # // Here the result is is mload(0). We want to run it, but - # // prefix it with a zero so we'll be safe from being considered - # // an invalid program. - # // - # // If we use this as a constructor the result will be - # // the code of the created contract, but we can live - # // with that. We won't call it. - # mstore(0x40, mload(0x00)) - # return(0x3F, 0x21) - # } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.MSTORE(offset=0x40, value=Op.MLOAD(offset=0x0)) - + Op.RETURN(offset=0x3F, size=0x21), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # - # // Here the result is is mload(0). - # return(0x00, 0x20) - # } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000020C0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # return(0, 0x20) // return the result as our return value - # } - contract_4 = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000000CA11), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # sstore(0,mload(0)) - # invalid() - # } - contract_9 = pre.deploy_contract( - code=Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SSTORE - + Op.INVALID, - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x0000000000000000000000000000000000060006), # noqa: E501 - ) - # Source: yul - # berlin { - # mstore(0, gasprice()) - # - # - # sstore(0,mload(0)) - # revert(0,0x20) - # } - contract_10 = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.REVERT(offset=0x0, size=0x20), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x000000000000000000000000000000000060BACC), # noqa: E501 - ) - # Source: yul - # berlin { - # selfdestruct(0) - # } - contract_11 = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT(address=0x0), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000DEADDEAD), # noqa: E501 - ) - # Source: yul - # berlin { - # let addr := 0x20C0DE - # let length := extcodesize(addr) - # - # // Read the code from 0x20C0DE - # extcodecopy(addr, 0, 0, length) - # - # // Return this memory as the code for the contract - # return(0, length) - # } - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.PUSH1[0x0] - + Op.PUSH3[0x20C0DE] - + Op.DUP2 - + Op.EXTCODESIZE(address=Op.DUP2) - + Op.SWAP3 - + Op.DUP4 - + Op.SWAP3 - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.RETURN, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000C0DEC0DE), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_6 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F2), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(call(gas(), 0xca11, 0, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_5 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x15, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F1), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(staticcall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_8 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100FA), # noqa: E501 - ) - # Source: yul - # berlin { - # if iszero(delegatecall(gas(), 0xca11, 0, 0, 0, 0x20)) - # { revert(0,0x20) } - # - # return(0, 0x20) // return the result as our return value - # } - contract_7 = pre.deploy_contract( # noqa: F841 - code=Op.JUMPI( - pc=0x14, - condition=Op.ISZERO( - Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000000CA1100F4), # noqa: E501 - ) - # Source: yul - # berlin { - # let action := calldataload(4) - # let res := 1 // If the result of a call is revert, revert here too - # let addr := 1 // If the result of CREATE[2] is zero, it reverted - # - # // For when we need code in our memory - # let codeBuffer := 0x20 - # // When running the template in the constructor - # let codeLength := extcodesize(0xC0DE) - # // When running the template in the created code - # let codeLength2 := extcodesize(0xC0DEC0DE) - # - # // Goat should be overwritten - # mstore(0, 0x60A7) - # - # switch action - # case 0 { // run the code snippet as normal code - # mstore(0, gasprice()) - # - # - # } - # - # // One level of call stack - # case 0xF1 { // call a contract to run this code - # res := call(gas(), 0xca11, 0, 0, 0, 0, 0x20) // call template code - # } - # case 0xF2 { // callcode a contract to run this code - # res := callcode(gas(), 0xca11, 0, 0, 0, 0, 0x20) - # } - # case 0xF4 { // delegate call a contract to run this code - # ... (269 more lines) - contract_3 = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=0x60A7) - + Op.PUSH1[0x1] - + Op.DUP1 - + Op.CALLDATALOAD(offset=0x4) - + Op.EXTCODESIZE(address=0xC0DEC0DE) - + Op.PUSH1[0x20] - + Op.EXTCODESIZE(address=0xC0DE) - + Op.JUMPI(pc=0x581, condition=Op.ISZERO(Op.DUP4)) - + Op.JUMPI(pc=0x56B, condition=Op.EQ(0xF1, Op.DUP4)) - + Op.JUMPI(pc=0x555, condition=Op.EQ(0xF2, Op.DUP4)) - + Op.JUMPI(pc=0x540, condition=Op.EQ(0xF4, Op.DUP4)) - + Op.JUMPI(pc=0x52B, condition=Op.EQ(0xFA, Op.DUP4)) - + Op.JUMPI(pc=0x513, condition=Op.EQ(0xF1F1, Op.DUP4)) - + Op.JUMPI(pc=0x4FB, condition=Op.EQ(0xF2F1, Op.DUP4)) - + Op.JUMPI(pc=0x4E4, condition=Op.EQ(0xF4F1, Op.DUP4)) - + Op.JUMPI(pc=0x4CD, condition=Op.EQ(0xFAF1, Op.DUP4)) - + Op.JUMPI(pc=0x4B5, condition=Op.EQ(0xF1F2, Op.DUP4)) - + Op.JUMPI(pc=0x49D, condition=Op.EQ(0xF2F2, Op.DUP4)) - + Op.JUMPI(pc=0x486, condition=Op.EQ(0xF4F2, Op.DUP4)) - + Op.JUMPI(pc=0x46F, condition=Op.EQ(0xFAF2, Op.DUP4)) - + Op.JUMPI(pc=0x457, condition=Op.EQ(0xF1F4, Op.DUP4)) - + Op.JUMPI(pc=0x43F, condition=Op.EQ(0xF2F4, Op.DUP4)) - + Op.JUMPI(pc=0x428, condition=Op.EQ(0xF4F4, Op.DUP4)) - + Op.JUMPI(pc=0x411, condition=Op.EQ(0xFAF4, Op.DUP4)) - + Op.JUMPI(pc=0x3F9, condition=Op.EQ(0xF1FA, Op.DUP4)) - + Op.JUMPI(pc=0x3E1, condition=Op.EQ(0xF2FA, Op.DUP4)) - + Op.JUMPI(pc=0x3CA, condition=Op.EQ(0xF4FA, Op.DUP4)) - + Op.JUMPI(pc=0x3B3, condition=Op.EQ(0xFAFA, Op.DUP4)) - + Op.JUMPI(pc=0x37E, condition=Op.EQ(0xFD, Op.DUP4)) - + Op.JUMPI(pc=0x347, condition=Op.EQ(0xFE, Op.DUP4)) - + Op.JUMPI(pc=0x311, condition=Op.EQ(0xFF, Op.DUP4)) - + Op.JUMPI(pc=0x2EB, condition=Op.EQ(0xF0, Op.DUP4)) - + Op.JUMPI(pc=0x2C1, condition=Op.EQ(0xF5, Op.DUP4)) - + Op.POP - + Op.JUMPI(pc=0x297, condition=Op.EQ(0xF0F1, Op.DUP3)) - + Op.JUMPI(pc=0x26B, condition=Op.EQ(0xF5F1, Op.DUP3)) - + Op.JUMPI(pc=0x248, condition=Op.EQ(0xF0F2, Op.DUP3)) - + Op.JUMPI(pc=0x223, condition=Op.EQ(0xF5F2, Op.DUP3)) - + Op.JUMPI(pc=0x201, condition=Op.EQ(0xF0F4, Op.DUP3)) - + Op.JUMPI(pc=0x1DD, condition=Op.EQ(0xF5F4, Op.DUP3)) - + Op.JUMPI(pc=0x1B4, condition=Op.EQ(0xF0FA, Op.DUP3)) - + Op.JUMPI(pc=0x189, condition=Op.EQ(0xF5FA, Op.DUP3)) - + Op.POP * 2 - + Op.PUSH5[0x60BACCFA57] - + Op.JUMPI(pc=0x16E, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBAD0BAD0BAD0) - + Op.JUMPDEST - + Op.JUMPI(pc=0x168, condition=Op.ISZERO) * 2 - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.STOP - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.POP - + Op.MSTORE(offset=0x0, value=0x3FF) - + Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.STATICCALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.DELEGATECALL( - gas=Op.GAS, - address=Op.DUP5, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE2 - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH1[0x0] - + Op.CREATE - + Op.CALLCODE( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP2 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP4 - + Op.POP - + Op.DUP1 - + Op.SWAP3 - + Op.POP - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.DUP2 - + Op.SWAP5 - + Op.POP - + Op.DUP1 - + Op.SWAP4 - + Op.POP - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.SWAP3 - + Op.POP - + Op.PUSH4[0xC0DEC0DE] - + Op.EXTCODECOPY - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.CALL( - gas=Op.GAS, - address=Op.DUP6, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP3 - + Op.POP - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x5A17] - + Op.SWAP3 - + Op.SWAP4 - + Op.POP - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE2 - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.SWAP4 - + Op.SWAP5 - + Op.POP - + Op.SWAP2 - + Op.POP * 2 - + Op.EXTCODECOPY( - address=0xC0DE, dest_offset=Op.DUP3, offset=0x0, size=Op.DUP2 - ) - + Op.PUSH8[0xDE0B6B3A7640000] - + Op.CREATE - + Op.SWAP1 - + Op.EXTCODECOPY( - address=Op.DUP5, dest_offset=0x0, offset=0x1, size=0x20 - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0xDEADDEAD, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=0x61A8, - address=0x60006, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=0x60BACC, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.GASPRICE - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.SLOAD - + Op.JUMPI(pc=0x156, condition=Op.EQ) - + Op.MSTORE(offset=0x0, value=0xBADBADBAD) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100FA, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100FA, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F4, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F4, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F2, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA1100F1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA1100F1, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.STATICCALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.DELEGATECALL( - gas=Op.GAS, - address=0xCA11, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALLCODE( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 5 - + Op.CALL( - gas=Op.GAS, - address=0xCA11, - value=Op.DUP1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=0x0, - ret_size=0x20, - ) - + Op.JUMP(pc=0x156) - + Op.JUMPDEST - + Op.POP * 4 - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.JUMP(pc=0x156), - storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 - ) - # Source: yul - # berlin { - # let depth := calldataload(0) - # - # if eq(depth,0) { - # mstore(0, gasprice()) - # - # - # return(0, 0x20) - # } - # - # // Dig deeper - # mstore(0, sub(depth,1)) - # - # // Call yourself with depth-1 - # if iszero(call(gas(), 0x60BACCFA57, 0, 0, 0x20, 0, 0x20)) { - # // Propagate failure if we failed - # revert(0, 0x20) - # } - # - # // Propagate success - # return (0, 0x20) - # } - contract_12 = pre.deploy_contract( # noqa: F841 - code=Op.CALLDATALOAD(offset=0x0) - + Op.JUMPI(pc=0x2D, condition=Op.ISZERO(Op.DUP1)) - + Op.PUSH1[0x1] - + Op.SWAP1 - + Op.MSTORE(offset=0x0, value=Op.SUB) - + Op.JUMPI( - pc=0x27, - condition=Op.ISZERO( - Op.CALL( - gas=Op.GAS, - address=0x60BACCFA57, - value=Op.DUP1, - args_offset=Op.DUP2, - args_size=Op.DUP2, - ret_offset=0x0, - ret_size=0x20, - ) - ), - ) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.REVERT(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.MSTORE(offset=0x0, value=Op.GASPRICE) - + Op.RETURN(offset=0x0, size=0x20), - balance=0xDE0B6B3A7640000, - nonce=1, - address=Address(0x00000000000000000000000000000060BACCFA57), # noqa: E501 - ) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0xF1), - Bytes("693c6139") + Hash(0xF2), - Bytes("693c6139") + Hash(0xF4), - Bytes("693c6139") + Hash(0xFA), - Bytes("693c6139") + Hash(0xF1F1), - Bytes("693c6139") + Hash(0xF2F1), - Bytes("693c6139") + Hash(0xF4F1), - Bytes("693c6139") + Hash(0xFAF1), - Bytes("693c6139") + Hash(0xF1F2), - Bytes("693c6139") + Hash(0xF2F2), - Bytes("693c6139") + Hash(0xF4F2), - Bytes("693c6139") + Hash(0xFAF2), - Bytes("693c6139") + Hash(0xF1F4), - Bytes("693c6139") + Hash(0xF2F4), - Bytes("693c6139") + Hash(0xF4F4), - Bytes("693c6139") + Hash(0xFAF4), - Bytes("693c6139") + Hash(0xF1FA), - Bytes("693c6139") + Hash(0xF2FA), - Bytes("693c6139") + Hash(0xF4FA), - Bytes("693c6139") + Hash(0xFAFA), - Bytes("693c6139") + Hash(0xFD), - Bytes("693c6139") + Hash(0xFE), - Bytes("693c6139") + Hash(0xFF), - Bytes("693c6139") + Hash(0xF0), - Bytes("693c6139") + Hash(0xF5), - Bytes("693c6139") + Hash(0xF0F1), - Bytes("693c6139") + Hash(0xF5F1), - Bytes("693c6139") + Hash(0xF0F2), - Bytes("693c6139") + Hash(0xF5F2), - Bytes("693c6139") + Hash(0xF0F4), - Bytes("693c6139") + Hash(0xF5F4), - Bytes("693c6139") + Hash(0xF0FA), - Bytes("693c6139") + Hash(0xF5FA), - ] - tx_gas = [1000000] - - env = Environment(base_fee_per_gas=10) - - tx = Transaction( - sender=sender, - to=contract_3, - data=tx_data[d], - gas_limit=tx_gas[g], - nonce=1, - gas_price=2000, - ) - - post = { - contract_3: Account(storage={0: 2000}), - contract_10: Account(storage={0: 24743}), - contract_9: Account(storage={0: 24743}), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_low_fee_cap.py b/tests/ported_static/stEIP1559/test_low_fee_cap.py index 82deed00eff..5c67873186d 100644 --- a/tests/ported_static/stEIP1559/test_low_fee_cap.py +++ b/tests/ported_static/stEIP1559/test_low_fee_cap.py @@ -1,20 +1,22 @@ """ -Ori Pomerantz qbzzt1@gmail.com. +Reject a transaction whose fee cap is below the base fee. Ported from: state_tests/stEIP1559/lowFeeCapFiller.yml +state_tests/stEIP1559/lowGasPriceOldTypesFiller.yml + +@manually-enhanced: Do not overwrite. Merged over the transaction type. """ import pytest from execution_testing import ( - Address, Alloc, - Bytes, Environment, StateTestFiller, Transaction, TransactionException, ) +from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" @@ -22,51 +24,42 @@ @pytest.mark.ported_from( - ["state_tests/stEIP1559/lowFeeCapFiller.yml"], + [ + "state_tests/stEIP1559/lowFeeCapFiller.yml", + "state_tests/stEIP1559/lowGasPriceOldTypesFiller.yml", + ], ) @pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip(reason="Expects the base fee of the test env") +) @pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable +@pytest.mark.parametrize("tx_type", [0, 1, 2]) def test_low_fee_cap( state_test: StateTestFiller, pre: Alloc, + fork: Fork, + tx_type: int, ) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=1000, - gas_limit=71794957647893862, - ) + """Send a transaction whose gas price or fee cap is one below the fee.""" + base_fee = Environment().set_fork_requirements(fork).base_fee_per_gas + assert base_fee is not None + sender = pre.fund_eoa() + target = pre.deploy_contract(code=Op.SSTORE(0, 2) + Op.STOP) - # Source: yul - # berlin { - # sstore(0, add(1,1)) - # } - target = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, - balance=0xDE0B6B3A7640000, - nonce=0, + fee = int(base_fee) - 1 + fees = ( + {"max_fee_per_gas": fee, "max_priority_fee_per_gas": 0} + if tx_type == 2 + else {"gas_price": fee} ) - tx = Transaction( + ty=tx_type, sender=sender, to=target, - data=Bytes("00"), - gas_limit=400000, - value=0x186A0, - max_fee_per_gas=999, - max_priority_fee_per_gas=100, - nonce=1, - access_list=[], + value=100_000, error=TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS, + **fees, ) - post: dict = {} - - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post={}, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_low_gas_limit.py b/tests/ported_static/stEIP1559/test_low_gas_limit.py index 3a7a36ebf35..60530cb1dd9 100644 --- a/tests/ported_static/stEIP1559/test_low_gas_limit.py +++ b/tests/ported_static/stEIP1559/test_low_gas_limit.py @@ -17,7 +17,6 @@ import pytest from execution_testing import ( Account, - Address, Alloc, Bytes, Environment, @@ -71,7 +70,6 @@ ), ], ) -@pytest.mark.pre_alloc_mutable def test_low_gas_limit( state_test: StateTestFiller, pre: Alloc, @@ -81,28 +79,11 @@ def test_low_gas_limit( v: int, ) -> None: """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) + sender = pre.fund_eoa() - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=1000, - gas_limit=80000, - ) - - # Source: yul - # berlin - # { - # sstore(0, add(1,1)) - # } - target = pre.deploy_contract( # noqa: F841 + target = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, storage={0: 24743}, - balance=0xDE0B6B3A7640000, - nonce=0, ) intrinsic_cost_calculator = fork.transaction_intrinsic_cost_calculator() @@ -154,9 +135,8 @@ def test_low_gas_limit( Bytes("00"), ] tx_gas = [90000, 50000, 25000, intrinsic - 1] - tx_access_lists: dict[int, list] = { - 0: [], - } + + env = Environment(gas_limit=80000) tx = Transaction( sender=sender, @@ -165,8 +145,6 @@ def test_low_gas_limit( gas_limit=tx_gas[g], max_fee_per_gas=1000, max_priority_fee_per_gas=1000, - nonce=1, - access_list=tx_access_lists.get(d), error=_exc, ) diff --git a/tests/ported_static/stEIP1559/test_low_gas_price_old_types.py b/tests/ported_static/stEIP1559/test_low_gas_price_old_types.py deleted file mode 100644 index 543101b5d94..00000000000 --- a/tests/ported_static/stEIP1559/test_low_gas_price_old_types.py +++ /dev/null @@ -1,119 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/lowGasPriceOldTypesFiller.yml -""" - -import pytest -from execution_testing import ( - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/lowGasPriceOldTypesFiller.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0", - marks=pytest.mark.exception_test, - ), - pytest.param( - 1, - 0, - 0, - id="d1", - marks=pytest.mark.exception_test, - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_low_gas_price_old_types( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=1000, - gas_limit=71794957647893862, - ) - - # Source: yul - # berlin { - # sstore(0, add(1,1)) - # } - target = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, - balance=0xDE0B6B3A7640000, - nonce=0, - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": -1, "value": -1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Cancun": TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes("00"), - Bytes("01"), - ] - tx_gas = [400000] - tx_value = [100000] - tx_access_lists: dict[int, list] = { - 1: [], - } - - tx = Transaction( - sender=sender, - to=target, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - nonce=1, - gas_price=999, - access_list=tx_access_lists.get(d), - error=TransactionException.INSUFFICIENT_MAX_FEE_PER_GAS, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_out_of_funds.py b/tests/ported_static/stEIP1559/test_out_of_funds.py index 620fcc06005..a79e4e338c6 100644 --- a/tests/ported_static/stEIP1559/test_out_of_funds.py +++ b/tests/ported_static/stEIP1559/test_out_of_funds.py @@ -1,135 +1,91 @@ """ -Ori Pomerantz qbzzt1@gmail.com. +Reject a transaction the sender cannot pay for. Ported from: state_tests/stEIP1559/outOfFundsFiller.yml +state_tests/stEIP1559/outOfFundsOldTypesFiller.yml + +@manually-enhanced: Do not overwrite. Merged over the transaction type. """ import pytest from execution_testing import ( + Account, Alloc, - Bytes, - Environment, StateTestFiller, Transaction, TransactionException, ) -from execution_testing.forks import Fork from execution_testing.vm import Op -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" +SENDER_BALANCE = 10**18 +GAS_PRICE = 10**11 +HIGH_GAS_LIMIT = 2**24 +LOW_GAS_LIMIT = 40_000 + @pytest.mark.ported_from( - ["state_tests/stEIP1559/outOfFundsFiller.yml"], + [ + "state_tests/stEIP1559/outOfFundsFiller.yml", + "state_tests/stEIP1559/outOfFundsOldTypesFiller.yml", + ], ) @pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize("tx_type", [0, 1, 2]) @pytest.mark.parametrize( - "d, g, v", + "gas_limit, value", [ pytest.param( - 0, - 0, - 0, - id="declaredKeyWrite-g0-v0", - marks=pytest.mark.exception_test, + HIGH_GAS_LIMIT, 0, id="high_gas", marks=pytest.mark.exception_test ), pytest.param( - 0, - 0, - 1, - id="declaredKeyWrite-g0-v1", + HIGH_GAS_LIMIT, + SENDER_BALANCE, + id="high_gas_with_value", marks=pytest.mark.exception_test, ), + pytest.param(LOW_GAS_LIMIT, 0, id="low_gas"), pytest.param( - 0, - 1, - 0, - id="declaredKeyWrite-g1-v0", - ), - pytest.param( - 0, - 1, - 1, - id="declaredKeyWrite-g1-v1", + LOW_GAS_LIMIT, + SENDER_BALANCE, + id="low_gas_with_value", marks=pytest.mark.exception_test, ), ], ) -@pytest.mark.pre_alloc_mutable def test_out_of_funds( state_test: StateTestFiller, pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, + tx_type: int, + gas_limit: int, + value: int, ) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) + """Send a transaction whose gas and value may exceed the balance.""" + sender = pre.fund_eoa(amount=SENDER_BALANCE) + target = pre.deploy_contract(code=Op.SSTORE(0, 2) + Op.STOP) - # Source: yul - # berlin { - # sstore(0, add(1,1)) - # } - target = pre.deploy_contract( - code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, - balance=0xDE0B6B3A7640000, + affordable = gas_limit * GAS_PRICE + value <= SENDER_BALANCE + fees = ( + {"max_fee_per_gas": GAS_PRICE, "max_priority_fee_per_gas": GAS_PRICE} + if tx_type == 2 + else {"gas_price": GAS_PRICE} ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Cancun": TransactionException.INSUFFICIENT_ACCOUNT_FUNDS - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": 0}, - "network": [">=Cancun"], - "result": {}, - }, - { - "indexes": {"data": -1, "gas": 1, "value": 1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Cancun": TransactionException.INSUFFICIENT_ACCOUNT_FUNDS - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes("00"), - ] - tx_gas = [16777216, 40000] - tx_value = [0, 1000000000000000000] - tx_access_lists: dict[int, list] = { - 0: [], - } - - env = Environment(base_fee_per_gas=1000) - tx = Transaction( + ty=tx_type, sender=sender, to=target, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - max_fee_per_gas=100000000000, - max_priority_fee_per_gas=100000000000, - nonce=1, - access_list=tx_access_lists.get(d), - error=_exc, + gas_limit=gas_limit, + value=value, + error=( + None + if affordable + else TransactionException.INSUFFICIENT_ACCOUNT_FUNDS + ), + **fees, ) - state_test(env=env, pre=pre, post=post, tx=tx) + post = {sender: Account(nonce=1 if affordable else 0)} + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_out_of_funds_old_types.py b/tests/ported_static/stEIP1559/test_out_of_funds_old_types.py deleted file mode 100644 index ef4330bea05..00000000000 --- a/tests/ported_static/stEIP1559/test_out_of_funds_old_types.py +++ /dev/null @@ -1,162 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP1559/outOfFundsOldTypesFiller.yml -""" - -import pytest -from execution_testing import ( - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP1559/outOfFundsOldTypesFiller.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0-v0", - marks=pytest.mark.exception_test, - ), - pytest.param( - 0, - 0, - 1, - id="d0-g0-v1", - marks=pytest.mark.exception_test, - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1-v0", - ), - pytest.param( - 0, - 1, - 1, - id="d0-g1-v1", - marks=pytest.mark.exception_test, - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0-v0", - marks=pytest.mark.exception_test, - ), - pytest.param( - 1, - 0, - 1, - id="d1-g0-v1", - marks=pytest.mark.exception_test, - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1-v0", - ), - pytest.param( - 1, - 1, - 1, - id="d1-g1-v1", - marks=pytest.mark.exception_test, - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_out_of_funds_old_types( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) - - # Source: yul - # berlin { - # sstore(0, add(1,1)) - # } - target = pre.deploy_contract( - code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, - balance=0xDE0B6B3A7640000, - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Cancun": TransactionException.INSUFFICIENT_ACCOUNT_FUNDS - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": 0}, - "network": [">=Cancun"], - "result": {}, - }, - { - "indexes": {"data": -1, "gas": 1, "value": 1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Cancun": TransactionException.INSUFFICIENT_ACCOUNT_FUNDS - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes("00"), - Bytes("01"), - ] - tx_gas = [16777216, 40000] - tx_value = [0, 1000000000000000000] - tx_access_lists: dict[int, list] = { - 1: [], - } - - env = Environment(base_fee_per_gas=1000) - - tx = Transaction( - sender=sender, - to=target, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - nonce=1, - gas_price=100000000000, - access_list=tx_access_lists.get(d), - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_sender_balance.py b/tests/ported_static/stEIP1559/test_sender_balance.py index 7ea2c909564..5f74cca55dc 100644 --- a/tests/ported_static/stEIP1559/test_sender_balance.py +++ b/tests/ported_static/stEIP1559/test_sender_balance.py @@ -34,7 +34,8 @@ def test_sender_balance( fork: Fork, ) -> None: """Origin balance during execution reflects the effective gas price.""" - base_fee = 11 + base_fee = Environment().set_fork_requirements(fork).base_fee_per_gas + assert base_fee is not None priority_fee = 100 max_fee = 1000 sender_balance = 0xDE0B6B3A7640000 @@ -43,10 +44,8 @@ def test_sender_balance( # validity check would reserve more — the point of the test). effective_gas_price = base_fee + priority_fee - env = Environment(base_fee_per_gas=base_fee) sender = pre.fund_eoa(amount=sender_balance) - # Source: yul: { sstore(0, balance(caller())) } target_code = ( Op.SSTORE( key=0x0, @@ -81,4 +80,4 @@ def test_sender_balance( ) } - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_tip_too_high.py b/tests/ported_static/stEIP1559/test_tip_too_high.py index 16571aca0bd..08e9b837060 100644 --- a/tests/ported_static/stEIP1559/test_tip_too_high.py +++ b/tests/ported_static/stEIP1559/test_tip_too_high.py @@ -9,7 +9,6 @@ from execution_testing import ( Alloc, Bytes, - Environment, StateTestFiller, Transaction, TransactionException, @@ -25,26 +24,17 @@ ) @pytest.mark.valid_from("Cancun") @pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable def test_tip_too_high( state_test: StateTestFiller, pre: Alloc, ) -> None: """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) + sender = pre.fund_eoa() - # Source: yul - # london - # { - # sstore(0, add(1,1)) - # } target = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0x2) + Op.STOP, - balance=0xDE0B6B3A7640000, ) - env = Environment(base_fee_per_gas=1000) - tx = Transaction( sender=sender, to=target, @@ -53,11 +43,9 @@ def test_tip_too_high( value=0x186A0, max_fee_per_gas=1000, max_priority_fee_per_gas=1001, - nonce=1, - access_list=[], error=TransactionException.PRIORITY_GREATER_THAN_MAX_FEE_PER_GAS, ) post: dict = {} - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_transaction_intinsic_bug_paris.py b/tests/ported_static/stEIP1559/test_transaction_intinsic_bug_paris.py index fd2208ab31a..2951d46e410 100644 --- a/tests/ported_static/stEIP1559/test_transaction_intinsic_bug_paris.py +++ b/tests/ported_static/stEIP1559/test_transaction_intinsic_bug_paris.py @@ -15,6 +15,7 @@ Transaction, TransactionException, ) +from execution_testing.forks import Fork REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" @@ -25,31 +26,31 @@ ) @pytest.mark.valid_from("Cancun") @pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable def test_transaction_intinsic_bug_paris( state_test: StateTestFiller, pre: Alloc, + fork: Fork, ) -> None: - """Bug discovered on ropsten https://github.""" - sender = pre.fund_eoa(amount=0x2FAF094, nonce=1) - - addr = pre.fund_eoa(amount=10) - - env = Environment(base_fee_per_gas=20) + """Reject a sender funded for the effective price but not the max fee.""" + gas_limit = 50_000 + priority_fee = 20 + value = 0x2DC6C14 + base_fee = Environment().set_fork_requirements(fork).base_fee_per_gas + assert base_fee is not None + sender_balance = gas_limit * (base_fee + priority_fee) + value + sender = pre.fund_eoa(amount=sender_balance) tx = Transaction( sender=sender, - to=addr, + to=pre.fund_eoa(), data=Bytes("00"), - gas_limit=50000, - value=0x2DC6C14, + gas_limit=gas_limit, + value=value, max_fee_per_gas=1000, - max_priority_fee_per_gas=20, - nonce=1, - access_list=[], + max_priority_fee_per_gas=priority_fee, error=TransactionException.INSUFFICIENT_ACCOUNT_FUNDS, ) - post = {sender: Account(balance=0x2FAF094)} + post = {sender: Account(balance=sender_balance)} - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP1559/test_val_causes_oof.py b/tests/ported_static/stEIP1559/test_val_causes_oof.py index 8b1f63387c3..000820643e5 100644 --- a/tests/ported_static/stEIP1559/test_val_causes_oof.py +++ b/tests/ported_static/stEIP1559/test_val_causes_oof.py @@ -9,7 +9,6 @@ from execution_testing import ( Alloc, Bytes, - Environment, Hash, StateTestFiller, Transaction, @@ -113,7 +112,6 @@ ), ], ) -@pytest.mark.pre_alloc_mutable def test_val_causes_oof( state_test: StateTestFiller, pre: Alloc, @@ -123,17 +121,8 @@ def test_val_causes_oof( v: int, ) -> None: """Ori Pomerantz qbzzt1@gmail.""" - sender = pre.fund_eoa(amount=0x5F5E100, nonce=1) + sender = pre.fund_eoa(amount=0x5F5E100) - # Source: yul - # london - # { - # // This loop runs a number of times specified in the data, - # // so the gas cost depends on the data - # for { let i := calldataload(4) } gt(i,0) { i := sub(i,1) } { - # sstore(i, 0x60A7) - # } // for loop - # } target = pre.deploy_contract( code=Op.CALLDATALOAD(offset=0x4) + Op.JUMPDEST @@ -144,7 +133,6 @@ def test_val_causes_oof( + Op.NOT(0x0) + Op.ADD + Op.JUMP(pc=0x3), - balance=0x5AF3107A4000, ) expect_entries_: list[dict] = [ @@ -184,12 +172,6 @@ def test_val_causes_oof( ] tx_gas = [100000, 90000, 110000] tx_value = [0, 1] - tx_access_lists: dict[int, list] = { - 0: [], - 1: [], - } - - env = Environment(base_fee_per_gas=1000) tx = Transaction( sender=sender, @@ -199,9 +181,7 @@ def test_val_causes_oof( value=tx_value[v], max_fee_per_gas=1000, max_priority_fee_per_gas=0, - nonce=1, - access_list=tx_access_lists.get(d), error=_exc, ) - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide.py b/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide.py deleted file mode 100644 index 9d530bbb5fb..00000000000 --- a/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide.py +++ /dev/null @@ -1,111 +0,0 @@ -""" -Test_call_one_v_call_suicide. - -Ported from: -state_tests/stEIP158Specific/CALL_OneVCallSuicideFiller.json - -@manually-enhanced: Do not overwrite. The measured slot captures the -regular gas of a CALL with value to a not-yet-accessed contract that -SELFDESTRUCTs to the (alive) caller. EIP-8038 raises the cold account -access (`COLD_ACCOUNT_ACCESS`) and the CALL value transfer -(`CALL_VALUE`). The beneficiary stays alive so there is no new-account -write. The delta is each fork constant less Cancun's, exactly 0 before -EIP-8037 and tracks parameter changes. Do not hardcode the Amsterdam -value. -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Cancun, Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP158Specific/CALL_OneVCallSuicideFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_call_one_v_call_suicide( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, -) -> None: - """Test_call_one_v_call_suicide.""" - # EIP-8038 deltas, each 0 before EIP-8037. The CALL pays a cold - # account access plus a value transfer; the beneficiary stays alive. - gas_costs = fork.gas_costs() - cold_account_delta = ( - gas_costs.COLD_ACCOUNT_ACCESS - Cancun.gas_costs().COLD_ACCOUNT_ACCESS - ) - call_value_delta = gas_costs.CALL_VALUE - Cancun.gas_costs().CALL_VALUE - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xE8D4A51000) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - # Source: lll - # { [0](GAS) (CALL 60000 1 0 0 0 0) [[100]] (SUB @0 (GAS)) } # noqa: E501 - target = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GAS) - + Op.POP( - Op.CALL( - gas=0xEA60, - address=0x79968A94DBEDB20475585E9DD4DAE6333ADD4C01, - value=0x1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.SSTORE(key=0x64, value=Op.SUB(Op.MLOAD(offset=0x0), Op.GAS)) - + Op.STOP, - balance=100, - nonce=0, - address=Address(0xEA04224539257FBE043981AA6058FBC1D5E21B1A), # noqa: E501 - ) - # Source: lll - # { (SELFDESTRUCT ) } # noqa: E501 - addr = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT( - address=0xEA04224539257FBE043981AA6058FBC1D5E21B1A - ) - + Op.STOP, - nonce=0, - address=Address(0x79968A94DBEDB20475585E9DD4DAE6333ADD4C01), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=target, - data=Bytes(""), - gas_limit=600000, - ) - - post = { - addr: Account(storage={}, balance=0), - target: Account( - storage={100: 14337 + cold_account_delta + call_value_delta}, - balance=100, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide2.py b/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide2.py deleted file mode 100644 index 0829fbf7018..00000000000 --- a/tests/ported_static/stEIP158Specific/test_call_one_v_call_suicide2.py +++ /dev/null @@ -1,100 +0,0 @@ -""" -Test_call_one_v_call_suicide2. - -Ported from: -state_tests/stEIP158Specific/CALL_OneVCallSuicide2Filler.json - -@manually-enhanced: Do not overwrite. The measured slot captures the -regular gas of a value-1 CALL to a cold contract that then -SELFDESTRUCTs (with a zero balance) to a cold, alive beneficiary. -EIP-8038 reprices the CALL's cold account access and value transfer, -plus the SELFDESTRUCT beneficiary's cold access; the beneficiary is -alive so there is no new-account write. The delta is therefore twice -the `COLD_ACCOUNT_ACCESS` rise plus the `CALL_VALUE` rise, each the -fork's constant less Cancun's, exactly 0 before EIP-8038. -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Cancun, Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP158Specific/CALL_OneVCallSuicide2Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_call_one_v_call_suicide2( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, -) -> None: - """Test_call_one_v_call_suicide2.""" - # EIP-8038 deltas, each 0 before EIP-8038. The CALL pays the cold - # account reprice and the value-transfer reprice; the cold - # SELFDESTRUCT beneficiary pays a second cold account reprice. - gas_costs = fork.gas_costs() - cold_account_delta = ( - gas_costs.COLD_ACCOUNT_ACCESS - Cancun.gas_costs().COLD_ACCOUNT_ACCESS - ) - call_value_delta = gas_costs.CALL_VALUE - Cancun.gas_costs().CALL_VALUE - addr_2 = Address(0xEB201D2887816E041F6E807E804F64F3A7A226FE) - sender = pre.fund_eoa(amount=0xE8D4A51000) - - pre[addr_2] = Account(balance=0, nonce=1) - # Source: lll - # { (SELFDESTRUCT ) } - addr = pre.deploy_contract( - code=Op.SELFDESTRUCT( - address=0xEB201D2887816E041F6E807E804F64F3A7A226FE - ) - + Op.STOP, - ) - # Source: lll - # { [0](GAS) (CALL 60000 1 0 0 0 0) [[100]] (SUB @0 (GAS)) } # noqa: E501 - target = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=Op.GAS) - + Op.POP( - Op.CALL( - gas=0xEA60, - address=addr, - value=0x1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.SSTORE(key=0x64, value=Op.SUB(Op.MLOAD(offset=0x0), Op.GAS)) - + Op.STOP, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=target, - data=Bytes(""), - gas_limit=600000, - ) - - post = { - addr: Account(storage={}, balance=0), - target: Account( - storage={100: 16937 + 2 * cold_account_delta + call_value_delta}, - balance=99, - ), - addr_2: Account(balance=1), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP158Specific/test_call_v_call_suicide.py b/tests/ported_static/stEIP158Specific/test_call_v_call_suicide.py new file mode 100644 index 00000000000..2880c41cd62 --- /dev/null +++ b/tests/ported_static/stEIP158Specific/test_call_v_call_suicide.py @@ -0,0 +1,104 @@ +""" +Measure a CALL to a contract that SELFDESTRUCTs to an alive account. + +Ported from: +state_tests/stEIP158Specific/CALL_OneVCallSuicideFiller.json +state_tests/stEIP158Specific/CALL_OneVCallSuicide2Filler.json +state_tests/stEIP158Specific/CALL_ZeroVCallSuicideFiller.json + +@manually-enhanced: Do not overwrite. The measured slot captures the +regular gas of a CALL to a cold contract that SELFDESTRUCTs to either +its caller (warm) or a cold, alive beneficiary: a contract, or an account +alive only through its nonce (EIP-161). EIP-8038 reprices the +cold account accesses and the CALL value transfer; the beneficiary is +alive so there is no new-account write. Each delta is the fork's +constant less Cancun's, exactly 0 before EIP-8038. +""" + +import pytest +from execution_testing import ( + Account, + Address, + Alloc, + StateTestFiller, + Transaction, +) +from execution_testing.forks import Cancun, Fork +from execution_testing.vm import Op + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +INITIAL_BALANCE = 100 + + +@pytest.mark.ported_from( + [ + "state_tests/stEIP158Specific/CALL_OneVCallSuicideFiller.json", + "state_tests/stEIP158Specific/CALL_OneVCallSuicide2Filler.json", + "state_tests/stEIP158Specific/CALL_ZeroVCallSuicideFiller.json", + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize( + "call_value, beneficiary_kind, cancun_gas", + [ + pytest.param(1, "caller", 14336, id="one_v_call_suicide"), + pytest.param( + 1, + "nonce_only", + 16937, + id="one_v_call_suicide2", + marks=pytest.mark.pre_alloc_mutable, + ), + pytest.param(1, "contract", 16937, id="one_v_call_suicide2_contract"), + pytest.param(0, "caller", 7636, id="zero_v_call_suicide"), + ], +) +def test_call_v_call_suicide( + state_test: StateTestFiller, + pre: Alloc, + fork: Fork, + call_value: int, + beneficiary_kind: str, + cancun_gas: int, +) -> None: + """Store the gas spent around the CALL in slot 100.""" + gas_costs = fork.gas_costs() + cold_account_delta = ( + gas_costs.COLD_ACCOUNT_ACCESS - Cancun.gas_costs().COLD_ACCOUNT_ACCESS + ) + call_value_delta = gas_costs.CALL_VALUE - Cancun.gas_costs().CALL_VALUE + sender = pre.fund_eoa() + + post: dict[Address, Account] = {} + if beneficiary_kind == "caller": + destructor = pre.deploy_contract(code=Op.SELFDESTRUCT(Op.CALLER)) + cold_accounts = 1 + caller_balance = INITIAL_BALANCE + else: + beneficiary: Address + if beneficiary_kind == "nonce_only": + beneficiary = pre.fund_eoa(amount=0, nonce=1) + else: + beneficiary = pre.deploy_contract(code=Op.STOP) + destructor = pre.deploy_contract(code=Op.SELFDESTRUCT(beneficiary)) + cold_accounts = 2 + caller_balance = INITIAL_BALANCE - call_value + post[beneficiary] = Account(balance=call_value) + + caller = pre.deploy_contract( + code=Op.MSTORE(0, Op.GAS) + + Op.POP(Op.CALL(gas=60_000, address=destructor, value=call_value)) + + Op.SSTORE(100, Op.SUB(Op.MLOAD(0), Op.GAS)), + balance=INITIAL_BALANCE, + ) + + measured = cancun_gas + cold_accounts * cold_account_delta + if call_value: + measured += call_value_delta + post[destructor] = Account(storage={}, balance=0) + post[caller] = Account(storage={100: measured}, balance=caller_balance) + + tx = Transaction(sender=sender, to=caller) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP158Specific/test_call_zero_v_call_suicide.py b/tests/ported_static/stEIP158Specific/test_call_zero_v_call_suicide.py deleted file mode 100644 index 50b67f8c9fc..00000000000 --- a/tests/ported_static/stEIP158Specific/test_call_zero_v_call_suicide.py +++ /dev/null @@ -1,103 +0,0 @@ -""" -Test_call_zero_v_call_suicide. - -Ported from: -state_tests/stEIP158Specific/CALL_ZeroVCallSuicideFiller.json - -@manually-enhanced: Do not overwrite. The measured slot captures the -regular gas of a value-0 CALL to a cold contract that then -SELFDESTRUCTs back to its (warm, alive) caller. EIP-8038 reprices the -cold account access of that CALL; the beneficiary is warm so the -SELFDESTRUCT is unchanged. The delta is therefore the fork's -`COLD_ACCOUNT_ACCESS` less Cancun's, exactly 0 before EIP-8038. -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Cancun, Fork -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP158Specific/CALL_ZeroVCallSuicideFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_call_zero_v_call_suicide( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, -) -> None: - """Test_call_zero_v_call_suicide.""" - # EIP-8038 cold account access reprice; 0 before EIP-8038. - cold_account_delta = ( - fork.gas_costs().COLD_ACCOUNT_ACCESS - - Cancun.gas_costs().COLD_ACCOUNT_ACCESS - ) - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xE8D4A51000) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - # Source: lll - # { [0](GAS) (CALL 60000 0 0 0 0 0) [[100]] (SUB @0 (GAS)) } # noqa: E501 - target = pre.deploy_contract( # noqa: F841 - code=Op.MSTORE(offset=0x0, value=Op.GAS) - + Op.POP( - Op.CALL( - gas=0xEA60, - address=0x79968A94DBEDB20475585E9DD4DAE6333ADD4C01, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.SSTORE(key=0x64, value=Op.SUB(Op.MLOAD(offset=0x0), Op.GAS)) - + Op.STOP, - nonce=0, - address=Address(0x61385ED1C4E08AA26BE16DA3851DF1CC90ED2777), # noqa: E501 - ) - # Source: lll - # { (SELFDESTRUCT ) } # noqa: E501 - addr = pre.deploy_contract( # noqa: F841 - code=Op.SELFDESTRUCT( - address=0x61385ED1C4E08AA26BE16DA3851DF1CC90ED2777 - ) - + Op.STOP, - nonce=0, - address=Address(0x79968A94DBEDB20475585E9DD4DAE6333ADD4C01), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=target, - data=Bytes(""), - gas_limit=600000, - ) - - post = { - addr: Account(balance=0), - target: Account(storage={100: 7637 + cold_account_delta}), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP2930/test_coinbase_access_list.py b/tests/ported_static/stEIP2930/test_coinbase_access_list.py new file mode 100644 index 00000000000..d9ef87b66ff --- /dev/null +++ b/tests/ported_static/stEIP2930/test_coinbase_access_list.py @@ -0,0 +1,100 @@ +""" +Measure a value CALL to the coinbase with and without an access list. + +Ported from: +state_tests/stEIP2930/coinbaseT01Filler.yml +state_tests/stEIP2930/coinbaseT2Filler.yml + +@manually-enhanced: Do not overwrite. The target contract measures, via +`Op.GAS`, the regular gas of a `CALL` that transfers value to the warm, +already-existing coinbase. EIP-8038 raises the value-transfer +component `CALL_VALUE`, so the measurement grows by the `CALL_VALUE` +delta versus Cancun. That delta is derived from the fork's own gas +model, so it is exactly 0 before EIP-8038 and tracks future parameter +changes; do not hardcode the Amsterdam number. +""" + +import pytest +from execution_testing import ( + AccessList, + Account, + Alloc, + Environment, + StateTestFiller, + Transaction, +) +from execution_testing.forks import Cancun, Fork +from execution_testing.vm import Op + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +CALL_VALUE = 1_000_000 +WARM_VALUE_CALL_GAS = 6800 +MEASUREMENT_OVERHEAD = 0x21 + + +@pytest.mark.ported_from( + [ + "state_tests/stEIP2930/coinbaseT01Filler.yml", + "state_tests/stEIP2930/coinbaseT2Filler.yml", + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip(reason="Expects the coinbase of the test env") +) +@pytest.mark.parametrize( + "tx_type, access_list", + [ + pytest.param(0, None, id="T0"), + pytest.param(1, "coinbase", id="T1baseInList"), + pytest.param(1, "other", id="T1baseNotInList"), + pytest.param(2, "coinbase", id="T2baseInList"), + pytest.param(2, "other", id="T2baseNotInList"), + ], +) +def test_coinbase_access_list( + state_test: StateTestFiller, + pre: Alloc, + fork: Fork, + tx_type: int, + access_list: str | None, +) -> None: + """Check the coinbase is warm whether or not the access list has it.""" + sender = pre.fund_eoa() + coinbase = pre.fund_eoa(amount=1) + target = pre.deploy_contract( + code=Op.MSTORE(0, Op.GAS) + + Op.POP(Op.CALL(address=coinbase, value=CALL_VALUE)) + + Op.MSTORE(0x20, Op.GAS) + + Op.SSTORE( + 0, + Op.SUB(Op.SUB(Op.MLOAD(0), Op.MLOAD(0x20)), MEASUREMENT_OVERHEAD), + ), + balance=CALL_VALUE, + ) + + access_lists = { + None: None, + "coinbase": [AccessList(address=coinbase, storage_keys=[])], + "other": [ + AccessList(address=pre.nonexistent_account(), storage_keys=[]) + ], + } + call_value_delta = ( + fork.gas_costs().CALL_VALUE - Cancun.gas_costs().CALL_VALUE + ) + post = { + target: Account(storage={0: WARM_VALUE_CALL_GAS + call_value_delta}) + } + + tx = Transaction( + ty=tx_type, + sender=sender, + to=target, + access_list=access_lists[access_list], + ) + state_test( + env=Environment(fee_recipient=coinbase), pre=pre, post=post, tx=tx + ) diff --git a/tests/ported_static/stEIP2930/test_coinbase_t01.py b/tests/ported_static/stEIP2930/test_coinbase_t01.py deleted file mode 100644 index 220d314e16a..00000000000 --- a/tests/ported_static/stEIP2930/test_coinbase_t01.py +++ /dev/null @@ -1,172 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP2930/coinbaseT01Filler.yml - -@manually-enhanced: Do not overwrite. The target contract measures, via -`Op.GAS`, the regular gas of a `CALL` that transfers value to the warm, -already-existing coinbase. EIP-8038 raises the value-transfer -component `CALL_VALUE`, so the measurement grows by the `CALL_VALUE` -delta versus Cancun. That delta is derived from the fork's own gas -model, so it is exactly 0 before EIP-8038 and tracks future parameter -changes; do not hardcode the Amsterdam number. -""" - -import pytest -from execution_testing import ( - AccessList, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Cancun, Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP2930/coinbaseT01Filler.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="T0", - ), - pytest.param( - 1, - 0, - 0, - id="T1baseInList", - ), - pytest.param( - 2, - 0, - 0, - id="T1baseNotInList", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_coinbase_t01( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x7704D8A022A1BA8F3539FC82C7D7FB065ABC0DF3) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) - - pre[coinbase] = Account(balance=0, nonce=1) - # Source: yul - # berlin - # { - # mstore(0, gas()) - # pop(call(gas(), , 1000000, 0, 0, 0, 0)) # noqa: E501 - # mstore(0x20, gas()) - # - # // The 24 is the cost of twi gas(), seven pushes(), a pop(), and an mstore() # noqa: E501 - # sstore(0, sub(sub(mload(0), mload(0x20)),33)) - # } - target = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=Op.GAS) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=coinbase, - value=0xF4240, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x20, value=Op.GAS) - + Op.SSTORE( - key=0x0, - value=Op.SUB( - Op.SUB(Op.MLOAD(offset=0x0), Op.MLOAD(offset=0x20)), 0x21 - ), - ) - + Op.STOP, - balance=0xDE0B6B3A7640000, - nonce=1, - ) - - # EIP-8038 reprices the value-transfer component of `CALL`; with the - # coinbase warm and already in state, the measured gas grows by the - # `CALL_VALUE` reprice alone. Derived from the fork gas model so it - # is 0 before EIP-8038. - call_value_delta = ( - fork.gas_costs().CALL_VALUE - Cancun.gas_costs().CALL_VALUE - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [1], "gas": -1, "value": -1}, - "network": [">=Cancun"], - "result": {target: Account(storage={0: 6800 + call_value_delta})}, - }, - { - "indexes": {"data": [0, 2], "gas": -1, "value": -1}, - "network": [">=Cancun"], - "result": {target: Account(storage={0: 6800 + call_value_delta})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x0), - ] - tx_gas = [16777216] - tx_access_lists: dict[int, list] = { - 1: [ - AccessList( - address=coinbase, - storage_keys=[], - ), - ], - 2: [ - AccessList( - address=Address(0x000000000000000000000000000000000000BA5A), - storage_keys=[], - ), - ], - } - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=target, - data=tx_data[d], - gas_limit=tx_gas[g], - nonce=1, - gas_price=1000, - access_list=tx_access_lists.get(d), - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP2930/test_coinbase_t2.py b/tests/ported_static/stEIP2930/test_coinbase_t2.py deleted file mode 100644 index 78f67fe6fbf..00000000000 --- a/tests/ported_static/stEIP2930/test_coinbase_t2.py +++ /dev/null @@ -1,166 +0,0 @@ -""" -Ori Pomerantz qbzzt1@gmail.com. - -Ported from: -state_tests/stEIP2930/coinbaseT2Filler.yml - -@manually-enhanced: Do not overwrite. The target contract measures, via -`Op.GAS`, the regular gas of a `CALL` that transfers value to the warm, -already-existing coinbase. EIP-8038 raises the value-transfer -component `CALL_VALUE`, so the measurement grows by the `CALL_VALUE` -delta versus Cancun. That delta is derived from the fork's own gas -model, so it is exactly 0 before EIP-8038 and tracks future parameter -changes; do not hardcode the Amsterdam number. -""" - -import pytest -from execution_testing import ( - AccessList, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.forks import Cancun, Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stEIP2930/coinbaseT2Filler.yml"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="T2baseInList", - ), - pytest.param( - 1, - 0, - 0, - id="T2baseNotInList", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_coinbase_t2( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x7704D8A022A1BA8F3539FC82C7D7FB065ABC0DF3) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000, nonce=1) - - pre[coinbase] = Account(balance=0, nonce=1) - # Source: yul - # berlin - # { - # mstore(0, gas()) - # pop(call(gas(), , 1000000, 0, 0, 0, 0)) # noqa: E501 - # mstore(0x20, gas()) - # - # // The 24 is the cost of twi gas(), seven pushes(), a pop(), and an mstore() # noqa: E501 - # sstore(0, sub(sub(mload(0), mload(0x20)),33)) - # } - target = pre.deploy_contract( - code=Op.MSTORE(offset=0x0, value=Op.GAS) - + Op.POP( - Op.CALL( - gas=Op.GAS, - address=coinbase, - value=0xF4240, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - ) - + Op.MSTORE(offset=0x20, value=Op.GAS) - + Op.SSTORE( - key=0x0, - value=Op.SUB( - Op.SUB(Op.MLOAD(offset=0x0), Op.MLOAD(offset=0x20)), 0x21 - ), - ) - + Op.STOP, - balance=0xDE0B6B3A7640000, - nonce=1, - ) - - # EIP-8038 reprices the value-transfer component of `CALL`; with the - # coinbase warm and already in state, the measured gas grows by the - # `CALL_VALUE` reprice alone. Derived from the fork gas model so it - # is 0 before EIP-8038. - call_value_delta = ( - fork.gas_costs().CALL_VALUE - Cancun.gas_costs().CALL_VALUE - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": -1, "value": -1}, - "network": [">=Cancun"], - "result": {target: Account(storage={0: 6800 + call_value_delta})}, - }, - { - "indexes": {"data": [1], "gas": -1, "value": -1}, - "network": [">=Cancun"], - "result": {target: Account(storage={0: 6800 + call_value_delta})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x0), - ] - tx_gas = [16777216] - tx_access_lists: dict[int, list] = { - 0: [ - AccessList( - address=coinbase, - storage_keys=[], - ), - ], - 1: [ - AccessList( - address=Address(0x000000000000000000000000000000000000BA5A), - storage_keys=[], - ), - ], - } - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=target, - data=tx_data[d], - gas_limit=tx_gas[g], - max_fee_per_gas=10000, - max_priority_fee_per_gas=100, - nonce=1, - access_list=tx_access_lists.get(d), - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP2930/test_storage_costs.py b/tests/ported_static/stEIP2930/test_storage_costs.py index 03f31a6352c..0ee7d98f613 100644 --- a/tests/ported_static/stEIP2930/test_storage_costs.py +++ b/tests/ported_static/stEIP2930/test_storage_costs.py @@ -26,7 +26,6 @@ Address, Alloc, Bytes, - Environment, Hash, StateTestFiller, Transaction, @@ -89,109 +88,109 @@ 6, 0, 0, - id="undeclaredKeyWrite", + id="undeclaredKeyWrite_otherKey", ), pytest.param( 7, 0, 0, - id="undeclaredKeyRead", + id="undeclaredKeyRead_otherKey", ), pytest.param( 8, 0, 0, - id="undeclaredKeyDel", + id="undeclaredKeyDel_otherKey", ), pytest.param( 9, 0, 0, - id="undeclaredKeyUpdate", + id="undeclaredKeyUpdate_otherKey", ), pytest.param( 10, 0, 0, - id="undeclaredKeyNOP", + id="undeclaredKeyNOP_otherKey", ), pytest.param( 11, 0, 0, - id="undeclaredKeyNOP0", + id="undeclaredKeyNOP0_otherKey", ), pytest.param( 12, 0, 0, - id="undeclaredKeyWrite", + id="undeclaredKeyWrite_otherAddress", ), pytest.param( 13, 0, 0, - id="undeclaredKeyRead", + id="undeclaredKeyRead_otherAddress", ), pytest.param( 14, 0, 0, - id="undeclaredKeyDel", + id="undeclaredKeyDel_otherAddress", ), pytest.param( 15, 0, 0, - id="undeclaredKeyUpdate", + id="undeclaredKeyUpdate_otherAddress", ), pytest.param( 16, 0, 0, - id="undeclaredKeyNOP", + id="undeclaredKeyNOP_otherAddress", ), pytest.param( 17, 0, 0, - id="undeclaredKeyNOP0", + id="undeclaredKeyNOP0_otherAddress", ), pytest.param( 18, 0, 0, - id="undeclaredKeyWrite", + id="undeclaredKeyWrite_noAccessList", ), pytest.param( 19, 0, 0, - id="undeclaredKeyRead", + id="undeclaredKeyRead_noAccessList", ), pytest.param( 20, 0, 0, - id="undeclaredKeyDel", + id="undeclaredKeyDel_noAccessList", ), pytest.param( 21, 0, 0, - id="undeclaredKeyUpdate", + id="undeclaredKeyUpdate_noAccessList", ), pytest.param( 22, 0, 0, - id="undeclaredKeyNOP", + id="undeclaredKeyNOP_noAccessList", ), pytest.param( 23, 0, 0, - id="undeclaredKeyNOP0", + id="undeclaredKeyNOP0_noAccessList", ), pytest.param( 24, @@ -251,23 +250,22 @@ 33, 0, 0, - id="undeclaredTo", + id="undeclaredTo_otherAddress", ), pytest.param( 34, 0, 0, - id="undeclaredTo", + id="undeclaredTo_otherKeys", ), pytest.param( 35, 0, 0, - id="declaredKeyWrite", + id="declaredKeyWrite_manyEntries", ), ], ) -@pytest.mark.pre_alloc_mutable def test_storage_costs( state_test: StateTestFiller, pre: Alloc, @@ -277,46 +275,9 @@ def test_storage_costs( v: int, ) -> None: """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x0000000000000000000000000000000000001000) - contract_1 = Address(0x0000000000000000000000000000000000001001) - contract_2 = Address(0x0000000000000000000000000000000000001002) - contract_3 = Address(0x0000000000000000000000000000000000001003) - contract_4 = Address(0x0000000000000000000000000000000000001004) - contract_5 = Address(0x0000000000000000000000000000000000001005) - contract_6 = Address(0x0000000000000000000000000000000000001010) - contract_7 = Address(0x0000000000000000000000000000000000001011) - contract_8 = Address(0x0000000000000000000000000000000000001020) - contract_9 = Address(0x0000000000000000000000000000000000001021) - contract_10 = Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC) sender = pre.fund_eoa(amount=0xDE0B6B3A7640000) - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - # Source: lll - # { - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; If the storage cell is declared the cost in @@1 should be 20003 - # ; If the storage cell is not declared the cost should be 22103 - # } - contract_0 = pre.deploy_contract( # noqa: F841 + contract_0 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x2) + Op.MSTORE( @@ -326,22 +287,8 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001000), # noqa: E501 ) - # Source: lll - # { - # ; Read @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # @@0 - # [0] (- @0 (gas) 19) - # [[1]] @0 - # - # ; If the storage cell is declared the cost in @@1 should be 100 - # ; If the storage cell is not declared the cost should be 2100 - # } - contract_1 = pre.deploy_contract( # noqa: F841 + contract_1 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.POP(Op.SLOAD(key=0x0)) + Op.MSTORE( @@ -351,30 +298,8 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001001), # noqa: E501 ) - # Source: lll - # { - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x00 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; If the storage cell is declared the cost in @@1 should be 2903 - # ; If the storage cell is not declared the cost should be 5003 - # ; - # ; The refund for freeing memory happens at the end of the transaction, - # ; so we don't see it - # } - contract_2 = pre.deploy_contract( # noqa: F841 + contract_2 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x0) + Op.MSTORE( @@ -385,27 +310,8 @@ def test_storage_costs( + Op.STOP, storage={0: 24743}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001002), # noqa: E501 ) - # Source: lll - # { - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0xBEEF - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; If the storage cell is declared the cost in @@1 should be 103 - # ; If the storage cell is not declared the cost should be 2203 - # } - contract_3 = pre.deploy_contract( # noqa: F841 + contract_3 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0xBEEF) + Op.MSTORE( @@ -416,26 +322,8 @@ def test_storage_costs( + Op.STOP, storage={0: 24743}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001003), # noqa: E501 ) - # Source: lll - # { - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x60A7 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; This costs 103, regadless of whether it is declared or not - # } - contract_4 = pre.deploy_contract( # noqa: F841 + contract_4 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x60A7) + Op.MSTORE( @@ -446,26 +334,8 @@ def test_storage_costs( + Op.STOP, storage={0: 24743}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001004), # noqa: E501 ) - # Source: lll - # { - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x00 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; This costs 103, regadless of whether it is declared or not - # } - contract_5 = pre.deploy_contract( # noqa: F841 + contract_5 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x0) + Op.MSTORE( @@ -476,31 +346,8 @@ def test_storage_costs( + Op.STOP, storage={0: 0}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001005), # noqa: E501 ) - # Source: lll - # { - # - # [[0]] 0x60A7 - # - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; Since this is second access, it will cost 103 - # ; regardless of whether it was declared or not - # - # } - contract_6 = pre.deploy_contract( # noqa: F841 + contract_6 = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0x60A7) + Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x2) @@ -511,24 +358,8 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001010), # noqa: E501 ) - # Source: lll - # { - # [[0]] 0x60A7 - # - # ; Read @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # @@0 - # [0] (- @0 (gas) 19) - # [[1]] @0 - # - # ; Since this is second access, it will cost 100 - # ; regardless of whether it was declared or not - # } - contract_7 = pre.deploy_contract( # noqa: F841 + contract_7 = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0x60A7) + Op.MSTORE(offset=0x0, value=Op.GAS) + Op.POP(Op.SLOAD(key=0x0)) @@ -539,30 +370,8 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001011), # noqa: E501 ) - # Source: lll - # { - # [0x20] @@0 - # - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; Since this is second access, it will cost 20k - # ; regardless of whether it was declared or not - # - # } - contract_8 = pre.deploy_contract( # noqa: F841 + contract_8 = pre.deploy_contract( code=Op.MSTORE(offset=0x20, value=Op.SLOAD(key=0x0)) + Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x2) @@ -573,23 +382,8 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001020), # noqa: E501 ) - # Source: lll - # { - # [0x20] @@0 - # - # ; Read @@0, and see how much gas that cost. - # [0] (gas) - # @@0 - # [0] (- @0 (gas) 19) - # [[1]] @0 - # - # ; Since this is second access, it will cost 97 - # ; regardless of whether it was declared or not - # } - contract_9 = pre.deploy_contract( # noqa: F841 + contract_9 = pre.deploy_contract( code=Op.MSTORE(offset=0x20, value=Op.SLOAD(key=0x0)) + Op.MSTORE(offset=0x0, value=Op.GAS) + Op.POP(Op.SLOAD(key=0x0)) @@ -600,40 +394,12 @@ def test_storage_costs( + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001021), # noqa: E501 ) - # Source: lll - # { ; TO_ADDR_VALID TO_ADDR_INVALID_ADDR TO_ADDR_INVALID_CELL - # ; Call a different contract - # (call (gas) (+ 0x1000 $4) 0 0 0 0 0) - # - # ; Read @@0, and see how much gas that cost. - # [0] (gas) - # @@0x60A7 - # [0] (- @0 (gas) 19) - # [[1]] @0 - # - # - # ; Write to @@0, and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # [[2]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # - # } - contract_10 = pre.deploy_contract( # noqa: F841 + contract_10 = pre.deploy_contract( code=Op.POP( Op.CALL( gas=Op.GAS, - address=Op.ADD(0x1000, Op.CALLDATALOAD(offset=0x4)), + address=Op.CALLDATALOAD(offset=0x4), value=0x0, args_offset=0x0, args_size=0x0, @@ -658,8 +424,6 @@ def test_storage_costs( + Op.STOP, storage={24743: 57005}, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 ) # EIP-8037 moves the bulk of storage-write cost into a per-storage @@ -842,53 +606,46 @@ def _sstore_delta(**metadata: int) -> int: post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) + no_target = pre.nonexistent_account() + other_address = pre.nonexistent_account() tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x4), - Bytes("693c6139") + Hash(0x5), - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x4), - Bytes("693c6139") + Hash(0x5), - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x4), - Bytes("693c6139") + Hash(0x5), - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x4), - Bytes("693c6139") + Hash(0x5), - Bytes("693c6139") + Hash(0x10), - Bytes("693c6139") + Hash(0x10), - Bytes("693c6139") + Hash(0x11), - Bytes("693c6139") + Hash(0x11), - Bytes("693c6139") + Hash(0x20), - Bytes("693c6139") + Hash(0x20), - Bytes("693c6139") + Hash(0x21), - Bytes("693c6139") + Hash(0x21), - Bytes("693c6139") + Hash(0xFFF), - Bytes("693c6139") + Hash(0xFFF), - Bytes("693c6139") + Hash(0xFFF), - Bytes("693c6139") + Hash(0x0), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_3, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_5, left_padding=True), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_3, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_5, left_padding=True), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_3, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_5, left_padding=True), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_3, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_5, left_padding=True), + Bytes("693c6139") + Hash(contract_6, left_padding=True), + Bytes("693c6139") + Hash(contract_6, left_padding=True), + Bytes("693c6139") + Hash(contract_7, left_padding=True), + Bytes("693c6139") + Hash(contract_7, left_padding=True), + Bytes("693c6139") + Hash(contract_8, left_padding=True), + Bytes("693c6139") + Hash(contract_8, left_padding=True), + Bytes("693c6139") + Hash(contract_9, left_padding=True), + Bytes("693c6139") + Hash(contract_9, left_padding=True), + Bytes("693c6139") + Hash(no_target, left_padding=True), + Bytes("693c6139") + Hash(no_target, left_padding=True), + Bytes("693c6139") + Hash(no_target, left_padding=True), + Bytes("693c6139") + Hash(contract_0, left_padding=True), ] - # The test's CALL chain does two SSTORE-sets in each measured - # contract; EIP-8037 spills both state-gas charges into regular gas - # when the reservoir is empty, pushing total consumption over the - # original 400 000 budget. Bump on EIP-8037; pre-EIP-8037 keeps the - # original value. - outer_tx_gas = 400_000 - if fork.is_eip_enabled(8037): - outer_tx_gas = 1_000_000 - tx_gas = [outer_tx_gas] tx_value = [100000] tx_access_lists: dict[int, list] = { 0: [ @@ -1013,7 +770,7 @@ def _sstore_delta(**metadata: int) -> int: ], 12: [ AccessList( - address=Address(0xF000000000000000000000000000000000000100), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1023,7 +780,7 @@ def _sstore_delta(**metadata: int) -> int: ], 13: [ AccessList( - address=Address(0xF000000000000000000000000000000000000101), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1033,7 +790,7 @@ def _sstore_delta(**metadata: int) -> int: ], 14: [ AccessList( - address=Address(0xF000000000000000000000000000000000000101), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1043,7 +800,7 @@ def _sstore_delta(**metadata: int) -> int: ], 15: [ AccessList( - address=Address(0xF000000000000000000000000000000000000101), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1053,7 +810,7 @@ def _sstore_delta(**metadata: int) -> int: ], 16: [ AccessList( - address=Address(0xF000000000000000000000000000000000000101), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1063,7 +820,7 @@ def _sstore_delta(**metadata: int) -> int: ], 17: [ AccessList( - address=Address(0xF000000000000000000000000000000000000101), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1172,7 +929,7 @@ def _sstore_delta(**metadata: int) -> int: ], 33: [ AccessList( - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC000000), + address=other_address, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -1293,10 +1050,10 @@ def _sstore_delta(**metadata: int) -> int: sender=sender, to=contract_10, data=tx_data[d], - gas_limit=tx_gas[g], value=tx_value[v], access_list=tx_access_lists.get(d), + state_gas_reservoir=0, error=_exc, ) - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP2930/test_varied_context.py b/tests/ported_static/stEIP2930/test_varied_context.py index f76eec4c469..5eb4232703a 100644 --- a/tests/ported_static/stEIP2930/test_varied_context.py +++ b/tests/ported_static/stEIP2930/test_varied_context.py @@ -23,16 +23,16 @@ import pytest from execution_testing import ( - EOA, AccessList, Account, Address, Alloc, Bytes, - Environment, + Conditional, Hash, StateTestFiller, Transaction, + compute_create2_address, compute_create_address, ) from execution_testing.forks import Cancun, Fork @@ -45,11 +45,16 @@ REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" +CREATE2_SALT = 0x5A17 + @pytest.mark.ported_from( ["state_tests/stEIP2930/variedContextFiller.yml"], ) @pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip(reason="Expects address zero to be empty") +) @pytest.mark.parametrize( "d, g, v", [ @@ -271,7 +276,6 @@ ), ], ) -@pytest.mark.pre_alloc_mutable def test_varied_context( state_test: StateTestFiller, pre: Alloc, @@ -281,76 +285,9 @@ def test_varied_context( v: int, ) -> None: """Ori Pomerantz qbzzt1@gmail.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x0000000000000000000000000000000000001000) - contract_1 = Address(0x0000000000000000000000000000000000001001) - contract_2 = Address(0x0000000000000000000000000000000000001002) - contract_3 = Address(0x000000000000000000000000000000000000C057) - contract_4 = Address(0x0000000000000000000000000000000000001003) - contract_5 = Address(0x00000000000000000000000000000000EAD0C057) - contract_6 = Address(0x0000000000000000000000000000000000001010) - contract_7 = Address(0x0000000000000000000000000000000000001011) - contract_8 = Address(0x00000000000000000000000000000000DEAD0111) - contract_9 = Address(0x0000000000000000000000000000000000001012) - contract_10 = Address(0x00000000000000000000000000000000DEAD0112) - contract_11 = Address(0x0000000000000000000000000000000000001013) - contract_12 = Address(0x000000000000000000000000000000000000F113) - contract_13 = Address(0x0000000000000000000000000000000000001014) - contract_14 = Address(0x000000000000000000000000000000000000F114) - contract_15 = Address(0x0000000000000000000000000000000000001015) - contract_16 = Address(0x000000000000000000000000000000000000F115) - contract_17 = Address(0x0000000000000000000000000000000000001016) - contract_18 = Address(0x0000000000000000000000000000000000001020) - contract_19 = Address(0x0000000000000000000000000000000000001021) - contract_20 = Address(0x0000000000000000000000000000000000001022) - contract_21 = Address(0x0000000000000000000000000000000000001023) - contract_22 = Address(0x0000000000000000000000000000000000001024) - contract_23 = Address(0x0000000000000000000000000000000000001025) - contract_24 = Address(0x0000000000000000000000000000000000001026) - contract_25 = Address(0x000000000000000000000000000000000000F126) - contract_26 = Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) + sender = pre.fund_eoa(amount=0xDE0B6B3A7640000) - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xDE0B6B3A7640000) - # Source: lll - # { - # ; 0xC057: DELEGATE_VALID DELEGATE_INVALID - # ; CALL_INVALID CALL_VALID - # ; CALLCODE_VALID CALLCODE_INVALID - # - # - # ; Write to [[0]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # [[1]] @0 - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; Read [[0x60A7]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [0x20] @@0x60A7 - # [0] (- @0 (gas) 16) - # [[2]] @0 - # - # ; The 16 is the cost of the extra opcodes - # } - contract_3 = pre.deploy_contract( # noqa: F841 + contract_3 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x2) + Op.MSTORE( @@ -368,24 +305,8 @@ def test_varied_context( + Op.STOP, storage={24743: 57005}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x000000000000000000000000000000000000C057), # noqa: E501 ) - # Source: lll - # { - # ; STATICCALL_VALID STATICCALL_INVALID - # - # - # ; Read [[0x60A7]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [0x20] @@0x60A7 - # [0] (- @0 (gas) 19) - # ; The 19 is the cost of the extra opcodes - # - # (return 0x00 0x20) ; a.k.a. @0 - # } - contract_5 = pre.deploy_contract( # noqa: F841 + contract_5 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.MSTORE(offset=0x20, value=Op.SLOAD(key=0x60A7)) + Op.MSTORE( @@ -396,37 +317,8 @@ def test_varied_context( + Op.STOP, storage={24743: 57005}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x00000000000000000000000000000000EAD0C057), # noqa: E501 ) - # Source: lll - # { - # ; CALL_REVERT_VALID CALL_REVERT_INVALID - # - # ; Write to [[0]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0]] 0x02 - # [0] (- @0 (gas) 17) - # - # ; The 17 is the cost of the extra opcodes: - # ; PUSH1 0x00, MSTORE - # ; PUSH1 0x02, PUSH1 0x00, (and then comes the SSTORE we are measuring) - # ; GAS - # - # ; Read [[0x60A7]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0x20] (gas) - # [0x40] @@0x60A7 - # [0x20] (- @0x20 (gas) 26) - # - # ; The 29 is the cost of the extra opcodes - # - # ; Send the results the only way we can - # - # (revert 0 0x40) - # } - contract_6 = pre.deploy_contract( # noqa: F841 + contract_6 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x2) + Op.MSTORE( @@ -443,116 +335,40 @@ def test_varied_context( + Op.STOP, storage={24743: 48879}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001010), # noqa: E501 ) - # Source: lll - # { - # ; CALL_WRITE_SUICIDE_VALID CALL_WRITE_SUICIDE_INVALID - # [[0]] 0xDEAD - # - # (selfdestruct 0) - # } - contract_8 = pre.deploy_contract( # noqa: F841 + contract_8 = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0xDEAD) + Op.SELFDESTRUCT(address=0x0) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x00000000000000000000000000000000DEAD0111), # noqa: E501 ) - # Source: lll - # { - # ; CALL_READ_SUICIDE_VALID CALL_READ_SUICIDE_INVALID - # @@0 - # - # (selfdestruct 0) - # } - contract_10 = pre.deploy_contract( # noqa: F841 + contract_10 = pre.deploy_contract( code=Op.POP(Op.SLOAD(key=0x0)) + Op.SELFDESTRUCT(address=0x0) + Op.STOP, storage={0: 0xDEAD0060A7}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x00000000000000000000000000000000DEAD0112), # noqa: E501 ) - # Source: lll - # { ; STATIC_WRITE_VALID STATIC_WRITE_INVALID - # [[0]] 0xDEAD60A7 - # - # ; If we get here, GOOD - # [0] 0x600D - # (return 0 0x20) - # } - contract_12 = pre.deploy_contract( # noqa: F841 + contract_12 = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0xDEAD60A7) + Op.MSTORE(offset=0x0, value=0x600D) + Op.RETURN(offset=0x0, size=0x20) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x000000000000000000000000000000000000F113), # noqa: E501 ) - # Source: lll - # { ; WRITE_INVALID_OOG WRITE_VALID_NO_OOG - # - # [[0]] 0x600D - # } - contract_14 = pre.deploy_contract( # noqa: F841 + contract_14 = pre.deploy_contract( code=Op.SSTORE(key=0x0, value=0x600D) + Op.STOP, storage={0: 2989}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x000000000000000000000000000000000000F114), # noqa: E501 ) - # Source: lll - # { ; READ_INVALID_OOG READ_VALID_NO_OOG - # [0] @@0x60A7 - # [[0]] 0x600D - # } - contract_16 = pre.deploy_contract( # noqa: F841 + contract_16 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.SLOAD(key=0x60A7)) + Op.SSTORE(key=0x0, value=0x600D) + Op.STOP, storage={0: 2989, 24743: 57005}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x000000000000000000000000000000000000F115), # noqa: E501 ) - # Source: lll - # { - # ; CREATE_VALID CREATE_INVALID - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # [[0]] 0xFF - # } contractCode - # ) ; contract lll - # - # ; Create the constructor code, which runs with the contract address - # ; of the newly created contract. If we declare that address in the - # ; transaction's access list we get the discount - # [constructorLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # ... (14 more lines) - contract_18 = pre.deploy_contract( # noqa: F841 + contract_18 = pre.deploy_contract( code=Op.PUSH1[0x6] + Op.CODECOPY(dest_offset=0x100, offset=0x33, size=Op.DUP1) + Op.PUSH2[0x200] @@ -581,42 +397,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x10) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001020), # noqa: E501 ) - # Source: lll - # { - # ; CREATE2_VALID CREATE2_INVALID - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # [[0]] 0xFF - # } contractCode - # ) ; contract lll - # - # ; Create the constructor code, which runs with the contract address - # ; of the newly created contract. If we declare that address in the - # ; transaction's access list we get the discount - # [constructorLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # ... (14 more lines) - contract_19 = pre.deploy_contract( # noqa: F841 + contract_19 = pre.deploy_contract( code=Op.PUSH1[0x6] + Op.CODECOPY(dest_offset=0x100, offset=0x36, size=Op.DUP1) + Op.PUSH2[0x200] @@ -631,7 +413,7 @@ def test_varied_context( value=0x0, offset=0x0, size=Op.ADD(0x100, Op.MLOAD(offset=0x200)), - salt=0x5A17, + salt=CREATE2_SALT, ), ) + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x240)) @@ -646,42 +428,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x10) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001021), # noqa: E501 ) - # Source: lll - # { - # ; CALL_CREATED_VALID CALL_CREATED_INVALID - # - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # [[1]] (- @0 (gas)) - # } contractCode - # ) ; contract lll - # - # - # ; Create the constructor code - # [constructorLength] - # (lll - # { - # ... (13 more lines) - contract_20 = pre.deploy_contract( # noqa: F841 + contract_20 = pre.deploy_contract( code=Op.PUSH1[0x13] + Op.CODECOPY(dest_offset=0x100, offset=0x44, size=Op.DUP1) + Op.PUSH2[0x200] @@ -720,42 +468,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x80) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001022), # noqa: E501 ) - # Source: lll - # { - # ; CALL_CREATE2_ED_VALID CALL_CREATE2_ED_INVALID - # - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # [[1]] (- @0 (gas)) - # } contractCode - # ) ; contract lll - # - # - # ; Create the constructor code - # [constructorLength] - # (lll - # { - # ... (13 more lines) - contract_21 = pre.deploy_contract( # noqa: F841 + contract_21 = pre.deploy_contract( code=Op.PUSH1[0x13] + Op.CODECOPY(dest_offset=0x100, offset=0x47, size=Op.DUP1) + Op.PUSH2[0x200] @@ -770,7 +484,7 @@ def test_varied_context( value=0x0, offset=0x0, size=Op.ADD(0x100, Op.MLOAD(offset=0x200)), - salt=0x5A17, + salt=CREATE2_SALT, ), ) + Op.POP( @@ -795,42 +509,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x80) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001023), # noqa: E501 ) - # Source: lll - # { - # ; CREATE_&_CALL_VALID CREATE_&_CALL_INVALID - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # [[2]] (- @0 (gas)) - # } contractCode - # ) ; contract lll - # - # - # ; Create the constructor code - # [constructorLength] - # (lll - # { - # ; write to storage - # ... (18 more lines) - contract_22 = pre.deploy_contract( # noqa: F841 + contract_22 = pre.deploy_contract( code=Op.PUSH1[0x13] + Op.CODECOPY(dest_offset=0x100, offset=0x44, size=Op.DUP1) + Op.PUSH2[0x200] @@ -872,42 +552,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x80) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001024), # noqa: E501 ) - # Source: lll - # { - # ; CREATE2_&_CALL_VALID CREATE2_&_CALL_INVALID - # - # ; Variables are 0x20 bytes (= 256 bits) apart, except for - # ; code buffers that get 0x100 (256 bytes) - # (def 'constructorCode 0x000) - # (def 'contractCode 0x100) - # (def 'contractLength 0x200) - # (def 'constructorLength 0x220) - # (def 'addr 0x240) - # - # (def 'bufLength 0x100) - # - # ; Create the contract code - # [contractLength] - # (lll - # { - # ; write to storage - # [0] (gas) - # [[0]] 0xFFFF - # [[2]] (- @0 (gas)) - # } contractCode - # ) ; contract lll - # - # - # ; Create the constructor code - # [constructorLength] - # (lll - # { - # ; write to storage - # ... (18 more lines) - contract_23 = pre.deploy_contract( # noqa: F841 + contract_23 = pre.deploy_contract( code=Op.PUSH1[0x13] + Op.CODECOPY(dest_offset=0x100, offset=0x47, size=Op.DUP1) + Op.PUSH2[0x200] @@ -922,7 +568,7 @@ def test_varied_context( value=0x0, offset=0x0, size=Op.ADD(0x100, Op.MLOAD(offset=0x200)), - salt=0x5A17, + salt=CREATE2_SALT, ), ) + Op.POP( @@ -950,21 +596,8 @@ def test_varied_context( + Op.RETURN(offset=0x0, size=0x80) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001025), # noqa: E501 ) - # Source: lll - # { - # ; CALL_TWICE_VALID CALL_TWICE_INVALID - # [0] (gas) - # [[0x00]] 0x60A7 - # [0] (- @0 (gas)) - # - # ; If @@1 is empty, write to it. Otherwise, write to @@2 - # (if (= @@1 0) {[[1]] @0} {[[2]] @0}) - # - # } - contract_25 = pre.deploy_contract( # noqa: F841 + contract_25 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0x0, value=0x60A7) + Op.MSTORE(offset=0x0, value=Op.SUB(Op.MLOAD(offset=0x0), Op.GAS)) @@ -976,19 +609,11 @@ def test_varied_context( + Op.JUMPDEST + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x000000000000000000000000000000000000F126), # noqa: E501 ) - # Source: lll - # { - # ; DELEGATE_VALID DELEGATE_INVALID - # - # (delegatecall (gas) 0xC057 0 0 0 0) - # } - contract_0 = pre.deploy_contract( # noqa: F841 + contract_0 = pre.deploy_contract( code=Op.DELEGATECALL( gas=Op.GAS, - address=0xC057, + address=contract_3, args_offset=0x0, args_size=0x0, ret_offset=0x0, @@ -996,18 +621,11 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001000), # noqa: E501 ) - # Source: lll - # { - # ; CALLCODE_VALID CALLCODE_INVALID - # (callcode (gas) 0xC057 0 0 0 0 0) - # } - contract_2 = pre.deploy_contract( # noqa: F841 + contract_2 = pre.deploy_contract( code=Op.CALLCODE( gas=Op.GAS, - address=0xC057, + address=contract_3, value=0x0, args_offset=0x0, args_size=0x0, @@ -1016,18 +634,11 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001002), # noqa: E501 ) - # Source: lll - # { - # ; CALL_VALID CALL_INVALID - # (call (gas) 0xC057 0 0 0 0 0) - # } - contract_1 = pre.deploy_contract( # noqa: F841 + contract_1 = pre.deploy_contract( code=Op.CALL( gas=Op.GAS, - address=0xC057, + address=contract_3, value=0x0, args_offset=0x0, args_size=0x0, @@ -1036,22 +647,12 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001001), # noqa: E501 ) - # Source: lll - # { - # ; STATICCALL_VALID STATICCALL_INVALID - # - # ; Need to store the result here, because static call is, well, static - # (staticcall (gas) 0xEAD0C057 0 0 0 0x20) - # [[0]] @0 - # } - contract_4 = pre.deploy_contract( # noqa: F841 + contract_4 = pre.deploy_contract( code=Op.POP( Op.STATICCALL( gas=Op.GAS, - address=0xEAD0C057, + address=contract_5, args_offset=0x0, args_size=0x0, ret_offset=0x0, @@ -1061,22 +662,13 @@ def test_varied_context( + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001003), # noqa: E501 ) - # Source: lll - # { - # ; CALL_WRITE_SUICIDE_VALID CALL_WRITE_SUICIDE_INVALID - # [0] (gas) - # (call (gas) 0xDEAD0111 0 0 0 0 0) - # [[0]] (- @0 (gas) 0x7fe8) - # } - contract_7 = pre.deploy_contract( # noqa: F841 + contract_7 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.POP( Op.CALL( gas=Op.GAS, - address=0xDEAD0111, + address=contract_8, value=0x0, args_offset=0x0, args_size=0x0, @@ -1089,22 +681,13 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001011), # noqa: E501 ) - # Source: lll - # { - # ; CALL_READ_SUICIDE_VALID CALL_READ_SUICIDE_INVALID - # [0] (gas) - # (call (gas) 0xDEAD0112 0 0 0 0 0) - # [[0]] (- @0 (gas) 0x7fe8) - # } - contract_9 = pre.deploy_contract( # noqa: F841 + contract_9 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=Op.GAS) + Op.POP( Op.CALL( gas=Op.GAS, - address=0xDEAD0112, + address=contract_10, value=0x0, args_offset=0x0, args_size=0x0, @@ -1117,25 +700,13 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001012), # noqa: E501 ) - # Source: lll - # { ; STATIC_WRITE_VALID STATIC_WRITE_INVALID - # - # [0x00] 0x0BAD - # - # ; If the call is successful @0 becomes 0x600D - # (staticcall (gas) 0xF113 0 0 0 0x20) - # - # [[0]] @0x00 - # } - contract_11 = pre.deploy_contract( # noqa: F841 + contract_11 = pre.deploy_contract( code=Op.MSTORE(offset=0x0, value=0xBAD) + Op.POP( Op.STATICCALL( gas=Op.GAS, - address=0xF113, + address=contract_12, args_offset=0x0, args_size=0x0, ret_offset=0x0, @@ -1146,13 +717,7 @@ def test_varied_context( + Op.STOP, storage={0: 24743}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001013), # noqa: E501 ) - # Source: lll - # { ; WRITE_INVALID_OOG WRITE_VALID_NO_OOG - # (call 0x0B65 0xF114 0 0 0 0 0x20) - # } # EIP-8038 raises the inner SSTORE-write cost. Bump the "valid" gas # these callers forward by exactly that increase so their success # path stays funded at Amsterdam (preserving the original Cancun @@ -1172,10 +737,10 @@ def test_varied_context( _cold_reset.gas_cost(fork) - _cold_reset.gas_cost(Cancun) ) - contract_13 = pre.deploy_contract( # noqa: F841 + contract_13 = pre.deploy_contract( code=Op.CALL( gas=valid_write_gas, - address=0xF114, + address=contract_14, value=0x0, args_offset=0x0, args_size=0x0, @@ -1184,17 +749,11 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001014), # noqa: E501 ) - # Source: lll - # { ; READ_INVALID_OOG READ_VALID_NO_OOG - # (call 0x1800 0xF115 0 0 0 0 0x20) - # } - contract_15 = pre.deploy_contract( # noqa: F841 + contract_15 = pre.deploy_contract( code=Op.CALL( gas=valid_read_gas, - address=0xF115, + address=contract_16, value=0x0, args_offset=0x0, args_size=0x0, @@ -1203,20 +762,12 @@ def test_varied_context( ) + Op.STOP, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001015), # noqa: E501 ) - # Source: lll - # { - # ; CALL_TWICE_VALID CALL_TWICE_INVALID - # (call (gas) 0xF126 0 0 0 0 0) - # (call (gas) 0xF126 0 0 0 0 0) - # } - contract_24 = pre.deploy_contract( # noqa: F841 + contract_24 = pre.deploy_contract( code=Op.POP( Op.CALL( gas=Op.GAS, - address=0xF126, + address=contract_25, value=0x0, args_offset=0x0, args_size=0x0, @@ -1226,7 +777,7 @@ def test_varied_context( ) + Op.CALL( gas=Op.GAS, - address=0xF126, + address=contract_25, value=0x0, args_offset=0x0, args_size=0x0, @@ -1235,23 +786,12 @@ def test_varied_context( ) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=0, - address=Address(0x0000000000000000000000000000000000001026), # noqa: E501 ) - # Source: lll - # { - # ; ccc...ccc revert and suicide contract - # (call (gas) (+ 0x1000 $4) 0 0 0 0 0x40) - # - # ; Write the returned results, if any - # [[0]] @0x00 - # [[1]] @0x20 - # } - contract_26 = pre.deploy_contract( # noqa: F841 + contract_26 = pre.deploy_contract( code=Op.POP( Op.CALL( gas=Op.GAS, - address=Op.ADD(0x1000, Op.CALLDATALOAD(offset=0x4)), + address=Op.CALLDATALOAD(offset=0x4), value=0x0, args_offset=0x0, args_size=0x0, @@ -1262,42 +802,8 @@ def test_varied_context( + Op.SSTORE(key=0x0, value=Op.MLOAD(offset=0x0)) + Op.SSTORE(key=0x1, value=Op.MLOAD(offset=0x20)) + Op.STOP, - nonce=0, - address=Address(0xCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC), # noqa: E501 ) - # Source: lll - # { ; RECURSE_VALID RECURSE_INVALID - # (def 'NOP 0) - # - # ; Read storage cell zero, so the first time we read it to won't - # ; be added to the cost - # @@0 - # - # ; Write to [[0xBEEF]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0] (gas) - # [[0xBEEF]] 0x02 - # [0] (- @0 (gas) 17) - # - # ; Read [[0x60A7]], and see how much gas that cost. It should - # ; cost more when it is not declared storage - # [0x20] (gas) - # [0xA0] @@0x60A7 - # [0x20] (- @0x20 (gas) 35) - # - # ; Write to a different cell each time - # [0x40] (gas) - # [[(+ 0xF000 @@0)]] 0xBEEF - # [0x40] (- @0x40 (gas) 0x78) - # - # ; Read from a different cell each time - # [0x60] (gas) - # @@(+ 0xF010 @@0) - # [0x60] (- @0x60 (gas) 0x7a) - # - # - # ... (13 more lines) - contract_17 = pre.deploy_contract( # noqa: F841 + contract_17 = pre.deploy_contract( code=Op.POP(Op.SLOAD(key=0x0)) + Op.MSTORE(offset=0x0, value=Op.GAS) + Op.SSTORE(key=0xBEEF, value=0x2) @@ -1335,26 +841,14 @@ def test_varied_context( + Op.SSTORE( key=Op.ADD(0x400, Op.SLOAD(key=0x0)), value=Op.MLOAD(offset=0x60) ) - + Op.JUMPI(pc=0x9B, condition=Op.GT(Op.SLOAD(key=0x0), 0x0)) - + Op.PUSH1[0x0] - + Op.JUMP(pc=0xB4) - + Op.JUMPDEST - + Op.SSTORE(key=0x0, value=Op.SUB(Op.SLOAD(key=0x0), 0x1)) - + Op.CALL( - gas=Op.GAS, - address=0x1016, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, + + Conditional( + condition=Op.GT(Op.SLOAD(key=0x0), 0x0), + if_true=Op.SSTORE(key=0x0, value=Op.SUB(Op.SLOAD(key=0x0), 0x1)) + + Op.POP(Op.CALL(address=Op.ADDRESS)), ) - + Op.JUMPDEST + Op.STOP, storage={0: 15, 24743: 57005}, balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x0000000000000000000000000000000000001016), # noqa: E501 ) # EIP-8037/8038 reprice several access components. With an empty @@ -1362,6 +856,41 @@ def test_varied_context( # regular gas, which `Op.GAS` observes. Derive each delta from the # fork's own gas model so it is exactly 0 pre-EIP-8037 and tracks # parameter changes. + def create_initcode( + creator: Address, head: tuple[int, int], tail: tuple[int, int] + ) -> bytes: + """ + Return the init code a creator assembles from its own code. + + `head` (offset, size) is copied to memory 0 and `tail` to 0x100. + """ + account = pre[creator] + assert account is not None + code = bytes(account.code) + return ( + code[head[0] : head[0] + head[1]].ljust(0x100, b"\0") + + code[tail[0] : tail[0] + tail[1]] + ) + + created_18 = compute_create_address(address=contract_18, nonce=1) + created_20 = compute_create_address(address=contract_20, nonce=1) + created_22 = compute_create_address(address=contract_22, nonce=1) + created_19 = compute_create2_address( + contract_19, + CREATE2_SALT, + create_initcode(contract_19, (0x3C, 0x21), (0x36, 0x6)), + ) + created_21 = compute_create2_address( + contract_21, + CREATE2_SALT, + create_initcode(contract_21, (0x5A, 0xF), (0x47, 0x13)), + ) + created_23 = compute_create2_address( + contract_23, + CREATE2_SALT, + create_initcode(contract_23, (0x5A, 0x21), (0x47, 0x13)), + ) + gas_costs = fork.gas_costs() def _sstore_delta(**metadata: int) -> int: @@ -1762,7 +1291,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [22], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_18, nonce=0): Account( + created_18: Account( storage={0: 65535, 1: (20017 + warm_set_delta)} ), }, @@ -1771,7 +1300,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [23], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_18, nonce=0): Account( + created_18: Account( storage={0: 65535, 1: (22117 + cold_set_delta)} ), }, @@ -1780,7 +1309,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [24], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0xD82F21135ED7D7D833A9F2A0F1CF6C3DA214B8E3): Account( + created_19: Account( storage={0: 65535, 1: (20017 + warm_set_delta)} ), }, @@ -1789,7 +1318,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [25], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0xD82F21135ED7D7D833A9F2A0F1CF6C3DA214B8E3): Account( + created_19: Account( storage={0: 65535, 1: (22117 + cold_set_delta)} ), }, @@ -1798,7 +1327,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [26], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_20, nonce=0): Account( + created_20: Account( storage={0: 65535, 1: (20017 + warm_set_delta)} ), }, @@ -1807,7 +1336,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [27], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_20, nonce=0): Account( + created_20: Account( storage={0: 65535, 1: (22117 + cold_set_delta)} ), }, @@ -1816,7 +1345,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [28], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0x530508498D2AA75D8E591612809FEC3D37A45615): Account( + created_21: Account( storage={0: 65535, 1: (20017 + warm_set_delta)} ), }, @@ -1825,7 +1354,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [29], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0x530508498D2AA75D8E591612809FEC3D37A45615): Account( + created_21: Account( storage={0: 65535, 1: (22117 + cold_set_delta)} ), }, @@ -1834,7 +1363,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [30], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_22, nonce=0): Account( + created_22: Account( storage={0: 65535, 1: (20017 + warm_set_delta), 2: 117} ), }, @@ -1843,7 +1372,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [31], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - compute_create_address(address=contract_22, nonce=0): Account( + created_22: Account( storage={0: 65535, 1: (22117 + cold_set_delta), 2: 117} ), }, @@ -1852,7 +1381,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [32], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0x83FBDAE70258AC0FA837B701CC63CEDF48D4B6BF): Account( + created_23: Account( storage={0: 65535, 1: (20017 + warm_set_delta), 2: 117} ), }, @@ -1861,7 +1390,7 @@ def _sstore_delta(**metadata: int) -> int: "indexes": {"data": [33], "gas": -1, "value": -1}, "network": [">=Cancun"], "result": { - Address(0x83FBDAE70258AC0FA837B701CC63CEDF48D4B6BF): Account( + created_23: Account( storage={0: 65535, 1: (22117 + cold_set_delta), 2: 117} ), }, @@ -1889,44 +1418,43 @@ def _sstore_delta(**metadata: int) -> int: post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) tx_data = [ - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x0), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x2), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x1), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x3), - Bytes("693c6139") + Hash(0x10), - Bytes("693c6139") + Hash(0x10), - Bytes("693c6139") + Hash(0x11), - Bytes("693c6139") + Hash(0x11), - Bytes("693c6139") + Hash(0x12), - Bytes("693c6139") + Hash(0x12), - Bytes("693c6139") + Hash(0x13), - Bytes("693c6139") + Hash(0x13), - Bytes("693c6139") + Hash(0x14), - Bytes("693c6139") + Hash(0x14), - Bytes("693c6139") + Hash(0x15), - Bytes("693c6139") + Hash(0x15), - Bytes("693c6139") + Hash(0x16), - Bytes("693c6139") + Hash(0x16), - Bytes("693c6139") + Hash(0x20), - Bytes("693c6139") + Hash(0x20), - Bytes("693c6139") + Hash(0x21), - Bytes("693c6139") + Hash(0x21), - Bytes("693c6139") + Hash(0x22), - Bytes("693c6139") + Hash(0x22), - Bytes("693c6139") + Hash(0x23), - Bytes("693c6139") + Hash(0x23), - Bytes("693c6139") + Hash(0x24), - Bytes("693c6139") + Hash(0x24), - Bytes("693c6139") + Hash(0x25), - Bytes("693c6139") + Hash(0x25), - Bytes("693c6139") + Hash(0x26), - Bytes("693c6139") + Hash(0x26), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_0, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_2, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_1, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_4, left_padding=True), + Bytes("693c6139") + Hash(contract_6, left_padding=True), + Bytes("693c6139") + Hash(contract_6, left_padding=True), + Bytes("693c6139") + Hash(contract_7, left_padding=True), + Bytes("693c6139") + Hash(contract_7, left_padding=True), + Bytes("693c6139") + Hash(contract_9, left_padding=True), + Bytes("693c6139") + Hash(contract_9, left_padding=True), + Bytes("693c6139") + Hash(contract_11, left_padding=True), + Bytes("693c6139") + Hash(contract_11, left_padding=True), + Bytes("693c6139") + Hash(contract_13, left_padding=True), + Bytes("693c6139") + Hash(contract_13, left_padding=True), + Bytes("693c6139") + Hash(contract_15, left_padding=True), + Bytes("693c6139") + Hash(contract_15, left_padding=True), + Bytes("693c6139") + Hash(contract_17, left_padding=True), + Bytes("693c6139") + Hash(contract_17, left_padding=True), + Bytes("693c6139") + Hash(contract_18, left_padding=True), + Bytes("693c6139") + Hash(contract_18, left_padding=True), + Bytes("693c6139") + Hash(contract_19, left_padding=True), + Bytes("693c6139") + Hash(contract_19, left_padding=True), + Bytes("693c6139") + Hash(contract_20, left_padding=True), + Bytes("693c6139") + Hash(contract_20, left_padding=True), + Bytes("693c6139") + Hash(contract_21, left_padding=True), + Bytes("693c6139") + Hash(contract_21, left_padding=True), + Bytes("693c6139") + Hash(contract_22, left_padding=True), + Bytes("693c6139") + Hash(contract_22, left_padding=True), + Bytes("693c6139") + Hash(contract_23, left_padding=True), + Bytes("693c6139") + Hash(contract_23, left_padding=True), + Bytes("693c6139") + Hash(contract_24, left_padding=True), + Bytes("693c6139") + Hash(contract_24, left_padding=True), ] - tx_gas = [16777216] tx_value = [100000] tx_access_lists: dict[int, list] = { 0: [ @@ -2283,7 +1811,7 @@ def _sstore_delta(**metadata: int) -> int: ], 22: [ AccessList( - address=Address(0xF342E57F24E0333F3AF34AF08FDBBE9C72CBD37C), + address=created_18, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2293,7 +1821,7 @@ def _sstore_delta(**metadata: int) -> int: ], 23: [ AccessList( - address=Address(0xF342E57F24E0333F3AF34AF08FDBBE9C72CBD37C), + address=created_18, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000001" # noqa: E501 @@ -2303,7 +1831,7 @@ def _sstore_delta(**metadata: int) -> int: ], 24: [ AccessList( - address=Address(0xD82F21135ED7D7D833A9F2A0F1CF6C3DA214B8E3), + address=created_19, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2313,7 +1841,7 @@ def _sstore_delta(**metadata: int) -> int: ], 25: [ AccessList( - address=Address(0xF342E57F24E0333F3AF34AF08FDBBE9C72CBD37C), + address=created_18, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2323,7 +1851,7 @@ def _sstore_delta(**metadata: int) -> int: ], 26: [ AccessList( - address=Address(0x58FD03A2D731B2FB751E4A0F593D373EE77D39E6), + address=created_20, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2333,7 +1861,7 @@ def _sstore_delta(**metadata: int) -> int: ], 27: [ AccessList( - address=Address(0x58FD03A2D731B2FB751E4A0F593D373EE77D39E6), + address=created_20, storage_keys=[ Hash( "0x000000000000000000000000000000000000000000000000000000000000ffff" # noqa: E501 @@ -2343,7 +1871,7 @@ def _sstore_delta(**metadata: int) -> int: ], 28: [ AccessList( - address=Address(0x530508498D2AA75D8E591612809FEC3D37A45615), + address=created_21, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2353,7 +1881,7 @@ def _sstore_delta(**metadata: int) -> int: ], 29: [ AccessList( - address=Address(0x58FD03A2D731B2FB751E4A0F593D373EE77D39E6), + address=created_20, storage_keys=[ Hash( "0x000000000000000000000000000000000000000000000000000000000000ffff" # noqa: E501 @@ -2363,7 +1891,7 @@ def _sstore_delta(**metadata: int) -> int: ], 30: [ AccessList( - address=Address(0xB76AB2D646C4DF221EDD345957D0A396A2AB1B6D), + address=created_22, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2373,7 +1901,7 @@ def _sstore_delta(**metadata: int) -> int: ], 31: [ AccessList( - address=Address(0x58FD03A2D731B2FB751E4A0F593D373EE77D39E6), + address=created_20, storage_keys=[ Hash( "0x000000000000000000000000000000000000000000000000000000000000ffff" # noqa: E501 @@ -2383,7 +1911,7 @@ def _sstore_delta(**metadata: int) -> int: ], 32: [ AccessList( - address=Address(0x83FBDAE70258AC0FA837B701CC63CEDF48D4B6BF), + address=created_23, storage_keys=[ Hash( "0x0000000000000000000000000000000000000000000000000000000000000000" # noqa: E501 @@ -2393,7 +1921,7 @@ def _sstore_delta(**metadata: int) -> int: ], 33: [ AccessList( - address=Address(0x58FD03A2D731B2FB751E4A0F593D373EE77D39E6), + address=created_20, storage_keys=[ Hash( "0x000000000000000000000000000000000000000000000000000000000000ffff" # noqa: E501 @@ -2427,10 +1955,10 @@ def _sstore_delta(**metadata: int) -> int: sender=sender, to=contract_26, data=tx_data[d], - gas_limit=tx_gas[g], + state_gas_reservoir=0, value=tx_value[v], access_list=tx_access_lists.get(d), error=_exc, ) - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3607/test_init_colliding_with_non_empty_account.py b/tests/ported_static/stEIP3607/test_init_colliding_with_non_empty_account.py index 74bc79ca971..888ab6d4455 100644 --- a/tests/ported_static/stEIP3607/test_init_colliding_with_non_empty_account.py +++ b/tests/ported_static/stEIP3607/test_init_colliding_with_non_empty_account.py @@ -1,175 +1,83 @@ """ -Account attempts to send tx to create a contract on a non-empty address. +Create a contract at an address that already holds code. Ported from: state_tests/stEIP3607/initCollidingWithNonEmptyAccountFiller.yml + +@manually-enhanced: Do not overwrite. Collapsed into one checked case. """ import pytest from execution_testing import ( - EOA, Account, - Address, Alloc, - Environment, Header, StateTestFiller, Transaction, + compute_create2_address, compute_create_address, ) -from execution_testing.forks import Fork from execution_testing.vm import Op REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" +GAS_LIMIT = 400_000 +CALL_VALUE = 10_000 + @pytest.mark.ported_from( ["state_tests/stEIP3607/initCollidingWithNonEmptyAccountFiller.yml"], ) @pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0", - ), - pytest.param( - 1, - 0, - 0, - id="d1", - ), - pytest.param( - 2, - 0, - 0, - id="d2", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - ], -) @pytest.mark.pre_alloc_mutable def test_init_colliding_with_non_empty_account( state_test: StateTestFiller, pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, ) -> None: - """Account attempts to send tx to create a contract on a non-empty...""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - contract_1 = Address(0xD0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) + """ + Fail a creation transaction that targets a nonce-0 account with code. - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[coinbase] = Account(balance=0, nonce=1) - pre[sender] = Account(balance=0xDE0B6B3A7640000) - # Source: raw - # 0x6000600155 - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0), - balance=0xDE0B6B3A7640000, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - # Source: raw - # 0x00 - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.STOP, + The collision consumes all the gas and none of the init code runs. + """ + sender = pre.fund_eoa() + callee = pre.deploy_contract(code=Op.STOP) + collider = compute_create_address(address=sender, nonce=0) + pre.deploy_contract( + code=Op.SSTORE(1, 0), + balance=10**18, nonce=0, - address=Address(0xD0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0D0), # noqa: E501 + address=collider, ) - tx_data = [ - Op.RETURN(offset=0x0, size=0x20), - Op.SSTORE(key=0x0, value=0x1) - + Op.CALL( - gas=Op.GAS, - address=contract_1, - value=0x2710, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - + Op.STOP, - Op.SSTORE(key=0x0, value=0x1) - + Op.CREATE2(value=0x2710, offset=Op.DUP2, size=0x20, salt=0x0) - + Op.STOP, - Op.SSTORE(key=0x0, value=0x1) - + Op.CREATE(value=0x2710, offset=0x0, size=0x20) - + Op.STOP, - Op.SSTORE(key=0x0, value=0x1) - + Op.DELEGATECALL( - gas=Op.GAS, - address=contract_1, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - + Op.STOP, - ] - tx_gas = [400000] - tx_value = [100000] - + initcode = ( + Op.SSTORE(0, 1) + + Op.POP(Op.CALL(address=callee, value=CALL_VALUE)) + + Op.POP(Op.DELEGATECALL(address=callee)) + + Op.POP(Op.CREATE2(value=CALL_VALUE, offset=0, size=0x20, salt=0)) + + Op.POP(Op.CREATE(value=CALL_VALUE, offset=0, size=0x20)) + + Op.RETURN(offset=0, size=0x20) + ) tx = Transaction( sender=sender, to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], + data=initcode, + gas_limit=GAS_LIMIT, + value=100_000, ) post = { - contract_0: Account( - storage={}, - code=bytes.fromhex("6000600155"), - balance=0xDE0B6B3A7640000, - nonce=0, + collider: Account( + storage={}, code=Op.SSTORE(1, 0), nonce=0, balance_change=0 ), - contract_1: Account(balance=0), - Address( - 0x05CD8493115C3299094A269E839E2F5F25691785 - ): Account.NONEXISTENT, - compute_create_address( - address=contract_0, nonce=0 - ): Account.NONEXISTENT, + callee: Account(balance=0), + compute_create2_address(collider, 0, bytes(0x20)): Account.NONEXISTENT, + compute_create_address(address=collider, nonce=0): Account.NONEXISTENT, sender: Account(nonce=1), } - state_test( - env=env, pre=pre, post=post, tx=tx, - blockchain_test_header_verify=Header( - gas_used=tx_gas[g], - ), + blockchain_test_header_verify=Header(gas_used=GAS_LIMIT), ) diff --git a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls.py b/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls.py deleted file mode 100644 index d93684d7411..00000000000 --- a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls.py +++ /dev/null @@ -1,67 +0,0 @@ -""" -Account with non-empty code attempts to send tx to call a contract. - -Ported from: -state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsFiller.yml -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsFiller.yml" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable -def test_transaction_colliding_with_non_empty_account_calls( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Account with non-empty code attempts to send tx to call a contract.""" - coinbase = Address(0xEB201D2887816E041F6E807E804F64F3A7A226FE) - sender = EOA( - key=0x402790500EA083A617EC567407D9EC3BBB3A5C8B812547D9F66E8D7878B8A75D - ) - - pre[coinbase] = Account(balance=0, nonce=1) - pre[sender] = Account( - balance=0xDE0B6B3A7640000, code=Op.SSTORE(key=0x1, value=0x0) - ) - # Source: raw - # 0x6000600155 - target = pre.deploy_contract( - code=Op.SSTORE(key=0x1, value=0x0), - ) - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=target, - data=Bytes(""), - gas_limit=400000, - value=0x186A0, - error=TransactionException.SENDER_NOT_EOA, - ) - - post: dict = {} - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls_itself.py b/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls_itself.py deleted file mode 100644 index 459b46b0d9e..00000000000 --- a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_calls_itself.py +++ /dev/null @@ -1,62 +0,0 @@ -""" -Account with non-empty code attempts to send tx to call itself. - -Ported from: -state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsItselfFiller.yml -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsItselfFiller.yml" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable -def test_transaction_colliding_with_non_empty_account_calls_itself( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Account with non-empty code attempts to send tx to call itself.""" - coinbase = Address(0xEB201D2887816E041F6E807E804F64F3A7A226FE) - sender = EOA( - key=0x402790500EA083A617EC567407D9EC3BBB3A5C8B812547D9F66E8D7878B8A75D - ) - - pre[coinbase] = Account(balance=0, nonce=1) - pre[sender] = Account( - balance=0xDE0B6B3A7640000, code=Op.SSTORE(key=0x1, value=0x0) - ) - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=sender, - data=Bytes(""), - gas_limit=400000, - value=0x186A0, - error=TransactionException.SENDER_NOT_EOA, - ) - - post: dict = {} - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_init_paris.py b/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_init_paris.py deleted file mode 100644 index deeceea91cd..00000000000 --- a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_init_paris.py +++ /dev/null @@ -1,145 +0,0 @@ -""" -Account with non-empty code attempts to send tx to create a contract. - -Ported from: -state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_init_ParisFiller.yml -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_init_ParisFiller.yml" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0", - marks=pytest.mark.exception_test, - ), - pytest.param( - 1, - 0, - 0, - id="d1", - marks=pytest.mark.exception_test, - ), - pytest.param( - 2, - 0, - 0, - id="d2", - marks=pytest.mark.exception_test, - ), - pytest.param( - 3, - 0, - 0, - id="d3", - marks=pytest.mark.exception_test, - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_transaction_colliding_with_non_empty_account_init_paris( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Account with non-empty code attempts to send tx to create a contract.""" - coinbase = Address(0xEB201D2887816E041F6E807E804F64F3A7A226FE) - addr = Address(0x76FAE819612A29489A1A43208613D8F8557B8898) - sender = EOA( - key=0x3696BFBDBC65B14F4DC76D7762E0567E1DD55F053314276E47969D22E70A554E - ) - - pre[coinbase] = Account(balance=0, nonce=1) - pre[sender] = Account(balance=0xDE0B6B3A7640000, code=Op.STOP) - pre[addr] = Account(balance=10) - # Source: raw - # 0x00 - addr_2 = pre.deploy_contract( - code=Op.STOP, - balance=10, - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {}, - "expect_exception": { - ">=Frontier": TransactionException.SENDER_NOT_EOA - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.STOP, - Op.RETURN(offset=0x0, size=0x20), - Op.CALL( - gas=Op.GAS, - address=addr_2, - value=0x2710, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - + Op.STOP, - Op.DELEGATECALL( - gas=Op.GAS, - address=addr_2, - args_offset=Op.DUP1, - args_size=Op.DUP1, - ret_offset=Op.DUP1, - ret_size=0x0, - ) - + Op.STOP, - ] - tx_gas = [400000] - tx_value = [100000] - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=TransactionException.SENDER_NOT_EOA, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_send_paris.py b/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_send_paris.py deleted file mode 100644 index 5f0455e4c71..00000000000 --- a/tests/ported_static/stEIP3607/test_transaction_colliding_with_non_empty_account_send_paris.py +++ /dev/null @@ -1,64 +0,0 @@ -""" -Account with non-empty code attempts to send tx to another account with... - -Ported from: -state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_send_ParisFiller.yml -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - TransactionException, -) -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_send_ParisFiller.yml" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.exception_test -@pytest.mark.pre_alloc_mutable -def test_transaction_colliding_with_non_empty_account_send_paris( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Account with non-empty code attempts to send tx to another account...""" - coinbase = Address(0xEB201D2887816E041F6E807E804F64F3A7A226FE) - addr = Address(0x76FAE819612A29489A1A43208613D8F8557B8898) - sender = EOA( - key=0x402790500EA083A617EC567407D9EC3BBB3A5C8B812547D9F66E8D7878B8A75D - ) - - pre[coinbase] = Account(balance=0, nonce=1) - pre[sender] = Account( - balance=0xDE0B6B3A7640000, code=Op.SSTORE(key=0x1, value=0x0) - ) - pre[addr] = Account(balance=10) - - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - - tx = Transaction( - sender=sender, - to=addr, - data=Bytes(""), - gas_limit=400000, - value=0x186A0, - error=TransactionException.SENDER_NOT_EOA, - ) - - post: dict = {} - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3607/test_transaction_from_account_with_code.py b/tests/ported_static/stEIP3607/test_transaction_from_account_with_code.py new file mode 100644 index 00000000000..b0f2dfffcaf --- /dev/null +++ b/tests/ported_static/stEIP3607/test_transaction_from_account_with_code.py @@ -0,0 +1,65 @@ +""" +Reject a transaction whose sender account has code. + +Ported from: +state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsFiller.yml +state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsItselfFiller.yml +state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_init_ParisFiller.yml +state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_send_ParisFiller.yml + +@manually-enhanced: Do not overwrite. Merged the sender-with-code cases. +""" + +import pytest +from execution_testing import ( + Address, + Alloc, + StateTestFiller, + Transaction, + TransactionException, +) +from execution_testing.vm import Op + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + + +@pytest.mark.ported_from( + [ + "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsFiller.yml", # noqa: E501 + "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_callsItselfFiller.yml", # noqa: E501 + "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_init_ParisFiller.yml", # noqa: E501 + "state_tests/stEIP3607/transactionCollidingWithNonEmptyAccount_send_ParisFiller.yml", # noqa: E501 + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.exception_test +@pytest.mark.pre_alloc_mutable +@pytest.mark.parametrize("to", ["contract", "self", "eoa", "create"]) +def test_transaction_from_account_with_code( + state_test: StateTestFiller, + pre: Alloc, + to: str, +) -> None: + """Send a call, self-call, transfer or creation from a sender with code.""" + sender = pre.fund_eoa(code=Op.SSTORE(1, 0)) + + destination: Address | None + if to == "contract": + destination = pre.deploy_contract(code=Op.SSTORE(1, 0)) + elif to == "self": + destination = sender + elif to == "eoa": + destination = pre.fund_eoa(amount=10) + elif to == "create": + destination = None + else: + raise ValueError(f"Unknown destination: {to}") + + tx = Transaction( + sender=sender, + to=destination, + value=100_000, + error=TransactionException.SENDER_NOT_EOA, + ) + state_test(pre=pre, post={}, tx=tx) diff --git a/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas.py b/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas.py index 2b3f7f7018d..fc10e7a23f7 100644 --- a/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas.py +++ b/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas.py @@ -10,10 +10,8 @@ import pytest from execution_testing import ( Account, - Address, Alloc, Bytes, - Environment, Hash, StateTestFiller, Transaction, @@ -84,7 +82,6 @@ ), ], ) -@pytest.mark.pre_alloc_mutable def test_coinbase_warm_account_call_gas( state_test: StateTestFiller, pre: Alloc, @@ -94,42 +91,8 @@ def test_coinbase_warm_account_call_gas( v: int, ) -> None: """Test_coinbase_warm_account_call_gas.""" - coinbase = Address(0x50228C44ED92561D94511E8518A75AA463BD444B) sender = pre.fund_eoa(amount=0xBA1A9CE0BA1A9CE) - pre[coinbase] = Account(balance=0xBA1A9CE0BA1A9CE, nonce=1) - # Source: yul - # berlin - # { - # // Save the coinbase value - # let cb := coinbase() - # - # // Minimum gas spent on the measurement, which changes depending on - # // the tested opcode - # // - # // Note that this value can change (mostly down) when Yul rolls out new # noqa: E501 - # // optimizations - # let measureGas - # - # let gas0, gas1 - # let retVal - # - # // We can only check the gas of one opcode per transaction, - # // because the first check adds the account to the - # // 'accessed_addresses' list. - # switch calldataload(4) - # case 0 { - # // EXTCODESIZE - # measureGas := 8 - # gas0 := gas() - # retVal := extcodesize(cb) - # gas1 := gas() - # } - # case 1 { - # // EXTCODECOPY - # measureGas := 5 - # gas0 := gas() - # ... (54 more lines) target = pre.deploy_contract( code=Op.COINBASE + Op.CALLDATALOAD(offset=0x4) @@ -245,7 +208,6 @@ def test_coinbase_warm_account_call_gas( + Op.SWAP1 + Op.JUMP(pc=0x51), balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) tx_data = [ @@ -259,8 +221,6 @@ def test_coinbase_warm_account_call_gas( Bytes("693c6139") + Hash(0x7), ] - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - tx = Transaction( sender=sender, to=target, @@ -274,4 +234,4 @@ def test_coinbase_warm_account_call_gas( expected_gas = warm_access + (warm_access if ext_code_read else 0) post = {target: Account(storage={0: expected_gas})} - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py b/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py index e1c68fa18ea..578768408a0 100644 --- a/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py +++ b/tests/ported_static/stEIP3651_warmcoinbase/test_coinbase_warm_account_call_gas_fail.py @@ -11,10 +11,8 @@ import pytest from execution_testing import ( Account, - Address, Alloc, Bytes, - Environment, Hash, StateTestFiller, Transaction, @@ -61,7 +59,6 @@ ), ], ) -@pytest.mark.pre_alloc_mutable def test_coinbase_warm_account_call_gas_fail( state_test: StateTestFiller, pre: Alloc, @@ -71,16 +68,8 @@ def test_coinbase_warm_account_call_gas_fail( v: int, ) -> None: """Test_coinbase_warm_account_call_gas_fail.""" - coinbase = Address(0x50228C44ED92561D94511E8518A75AA463BD444B) sender = pre.fund_eoa(amount=0xBA1A9CE0BA1A9CE) - pre[coinbase] = Account(balance=0xBA1A9CE0BA1A9CE, nonce=1) - # Source: yul - # berlin - # { - # let cb := coinbase() - # pop(call(0, cb, 0, 0, 0, 0, 0)) - # } addr = pre.deploy_contract( code=Op.CALL( gas=Op.DUP2, @@ -93,14 +82,7 @@ def test_coinbase_warm_account_call_gas_fail( ) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) - # Source: yul - # berlin - # { - # let cb := coinbase() - # pop(callcode(0, cb, 0, 0, 0, 0, 0)) - # } addr_2 = pre.deploy_contract( code=Op.CALLCODE( gas=Op.DUP2, @@ -113,14 +95,7 @@ def test_coinbase_warm_account_call_gas_fail( ) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) - # Source: yul - # berlin - # { - # let cb := coinbase() - # pop(delegatecall(0, cb, 0, 0, 0, 0)) - # } addr_3 = pre.deploy_contract( code=Op.DELEGATECALL( gas=Op.DUP2, @@ -132,14 +107,7 @@ def test_coinbase_warm_account_call_gas_fail( ) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) - # Source: yul - # berlin - # { - # let cb := coinbase() - # pop(staticcall(0, cb, 0, 0, 0, 0)) - # } addr_4 = pre.deploy_contract( code=Op.STATICCALL( gas=Op.DUP2, @@ -151,38 +119,7 @@ def test_coinbase_warm_account_call_gas_fail( ) + Op.STOP, balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) - # Source: yul - # berlin - # { - # // Depending on the called contract here, the subcall will perform - # // another call/delegatecall/staticcall/callcode that will only succeed # noqa: E501 - # // if coinbase is considered warm by default (post-Shanghai). - # let calladdr := calldataload(4) - # - # let callgas := 100 - # switch calladdr - # case { - # // Extra: COINBASE + 6xPUSH1 + DUP6 + 2xPOP - # callgas := add(callgas, 27) - # } - # case { - # // Extra: COINBASE + 6xPUSH1 + DUP6 + 2xPOP - # callgas := add(callgas, 27) - # } - # case { - # // Extra: COINBASE + 5xPUSH1 + DUP6 + 2xPOP - # callgas := add(callgas, 24) - # } - # case { - # // Extra: COINBASE + 5xPUSH1 + DUP6 + 2xPOP - # callgas := add(callgas, 24) - # } - # // Call and save result - # sstore(0, call(callgas, calladdr, 0, 0, 0, 0, 0)) - # - # } target = pre.deploy_contract( code=Op.PUSH1[0x0] + Op.DUP1 * 4 @@ -221,7 +158,6 @@ def test_coinbase_warm_account_call_gas_fail( + Op.ADD + Op.JUMP(pc=0x73), balance=0xBA1A9CE0BA1A9CE, - nonce=1, ) tx_data = [ @@ -236,8 +172,6 @@ def test_coinbase_warm_account_call_gas_fail( outer_tx_gas = 500_000 tx_gas = [outer_tx_gas] - env = Environment(fee_recipient=coinbase, prev_randao=0x20000) - tx = Transaction( sender=sender, to=target, @@ -247,4 +181,4 @@ def test_coinbase_warm_account_call_gas_fail( post = {target: Account(storage={0: 1})} - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to0.py b/tests/ported_static/stSStoreTest/test_sstore_0to0.py deleted file mode 100644 index bec0a45a0fd..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to0.py +++ /dev/null @@ -1,526 +0,0 @@ -""" -Change 0 -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_0to0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0to0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xCD47252107CE09AD27592121F5B5E3E30C4CE2DB): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0xB] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0xB] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to0to0.py b/tests/ported_static/stSStoreTest/test_sstore_0to0to0.py deleted file mode 100644 index 665a363bb26..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to0to0.py +++ /dev/null @@ -1,526 +0,0 @@ -""" -Change 0 -> 0 -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_0to0to0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0to0to0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to0to0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> 0 -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) * 2 + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) * 2 + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x0BDFB5BB25DE41DF5EF3E68904843C7A7B92D35F): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to0to_x.py b/tests/ported_static/stSStoreTest/test_sstore_0to0to_x.py deleted file mode 100644 index 954cd6141ab..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to0to_x.py +++ /dev/null @@ -1,532 +0,0 @@ -""" -Change 0 -> 0 -> X. - -Ported from: -state_tests/stSStoreTest/sstore_0to0toXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0to0toXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to0to_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> 0 -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x4B7E4A91B95B23146401605D2ADCE6AB6FFD64E1): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to_x.py b/tests/ported_static/stSStoreTest/test_sstore_0to_x.py deleted file mode 100644 index 2ba2d601af1..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to_x.py +++ /dev/null @@ -1,526 +0,0 @@ -""" -Change 0 -> X. - -Ported from: -state_tests/stSStoreTest/sstore_0toXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0toXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xCD47252107CE09AD27592121F5B5E3E30C4CE2DB): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0xB] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0xB] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to_xto0.py b/tests/ported_static/stSStoreTest/test_sstore_0to_xto0.py deleted file mode 100644 index 1e2fd6c528f..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to_xto0.py +++ /dev/null @@ -1,532 +0,0 @@ -""" -Change 0 -> X -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_0toXto0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0toXto0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to_xto0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> X -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x7564C2D690AB324D8FA20707F2BBDCFF4367BB92): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to_xto0to_x.py b/tests/ported_static/stSStoreTest/test_sstore_0to_xto0to_x.py deleted file mode 100644 index 43cbbf555ef..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to_xto0to_x.py +++ /dev/null @@ -1,538 +0,0 @@ -""" -Change 0 -> X -> 0 -> X. - -Ported from: -state_tests/stSStoreTest/sstore_0toXto0toXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0toXto0toXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to_xto0to_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> X -> 0 -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 0 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xCACDB18E817DCDF3677F6F905A75474AF3B8693C): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x1A] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x1A] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to_xto_x.py b/tests/ported_static/stSStoreTest/test_sstore_0to_xto_x.py deleted file mode 100644 index a316e3dc773..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to_xto_x.py +++ /dev/null @@ -1,526 +0,0 @@ -""" -Change 0 -> X -> X. - -Ported from: -state_tests/stSStoreTest/sstore_0toXtoXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0toXtoXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to_xto_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> X -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xF797D87EB948007FD777404EF459196B099D3EBE): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_0to_xto_y.py b/tests/ported_static/stSStoreTest/test_sstore_0to_xto_y.py deleted file mode 100644 index 48a17648c37..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_0to_xto_y.py +++ /dev/null @@ -1,532 +0,0 @@ -""" -Change 0 -> X -> Y. - -Ported from: -state_tests/stSStoreTest/sstore_0toXtoYFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_0toXtoYFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_0to_xto_y( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change 0 -> X -> Y.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xEF24BE216C6EAAADE3B2496281D7B66FC2669F03): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_change_from_external_call_in_init_code.py b/tests/ported_static/stSStoreTest/test_sstore_change_from_external_call_in_init_code.py index b20952d9a2b..817ba4f08dd 100644 --- a/tests/ported_static/stSStoreTest/test_sstore_change_from_external_call_in_init_code.py +++ b/tests/ported_static/stSStoreTest/test_sstore_change_from_external_call_in_init_code.py @@ -1,39 +1,48 @@ """ -Account already has storage X. create -> in init code change that... +Change a pre-existing slot X -> 0 -> X from a call made in init code. Ported from: state_tests/stSStoreTest/sstore_changeFromExternalCallInInitCodeFiller.json -@manually-enhanced: Do not overwrite. Gas budget refactored to be -fork-aware (`tx_gas = [intrinsic + tx_data[d].gas_cost(fork)]`), and -each `Op.CALL` annotated with `inner_call_cost=` metadata so -`Bytecode.gas_cost(fork)` covers the forwarded inner-frame gas. -Required for the test to fill correctly under EIP-8037's two- -dimensional gas model. Hex `gas=` literals also converted to -human-readable decimals. +@manually-enhanced: Do not overwrite. Parametrized over call and context. """ +from typing import Dict + import pytest from execution_testing import ( - EOA, Account, Address, Alloc, - Environment, + Bytecode, StateTestFiller, Transaction, + compute_create2_address, compute_create_address, ) -from execution_testing.forks import Fork from execution_testing.vm import Op -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" +CALL_OPS = { + "call": Op.CALL, + "callcode": Op.CALLCODE, + "delegatecall": Op.DELEGATECALL, + "staticcall": Op.STATICCALL, +} +REFUND_SLOTS = 16 +STATICCALL_GAS = 300_000 + + +def store_in_memory(data: bytes) -> Bytecode: + """Write `data` to memory starting at offset 0.""" + code = Bytecode() + for offset in range(0, len(data), 32): + chunk = data[offset : offset + 32].ljust(32, b"\0") + code += Op.MSTORE(offset, int.from_bytes(chunk, "big")) + return code + @pytest.mark.ported_from( [ @@ -41,533 +50,74 @@ ], ) @pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize("call_op", list(CALL_OPS)) @pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0", - ), - pytest.param( - 1, - 0, - 0, - id="d1", - ), - pytest.param( - 2, - 0, - 0, - id="d2", - ), - pytest.param( - 3, - 0, - 0, - id="d3", - ), - pytest.param( - 4, - 0, - 0, - id="d4", - ), - pytest.param( - 5, - 0, - 0, - id="d5", - ), - pytest.param( - 6, - 0, - 0, - id="d6", - ), - pytest.param( - 7, - 0, - 0, - id="d7", - ), - pytest.param( - 8, - 0, - 0, - id="d8", - ), - pytest.param( - 9, - 0, - 0, - id="d9", - ), - pytest.param( - 10, - 0, - 0, - id="d10", - ), - pytest.param( - 11, - 0, - 0, - id="d11", - ), - pytest.param( - 12, - 0, - 0, - id="d12", - ), - pytest.param( - 13, - 0, - 0, - id="d13", - ), - pytest.param( - 14, - 0, - 0, - id="d14", - ), - pytest.param( - 15, - 0, - 0, - id="d15", - ), - ], + "context", ["direct", "create2", "create2_revert", "create2_refund"] ) -@pytest.mark.pre_alloc_mutable def test_sstore_change_from_external_call_in_init_code( state_test: StateTestFiller, pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, + call_op: str, + context: str, ) -> None: - """Account already has storage X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xBEA0000000000000000000000000000000000000) - contract_1 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) + """ + Run X -> 0 -> X on slot 1 and 0 -> 1 on slot 0 through a call. - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { (SSTORE 1 0) (SSTORE 1 1) (SSTORE 0 1) } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x0, value=0x1) - + Op.STOP, + The call runs from the creation transaction or from CREATE2 init code + (optionally reverted afterwards, or followed by a refunder call). + """ + sender = pre.fund_eoa() + creator = compute_create_address(address=sender, nonce=0) + target = pre.deploy_contract( + code=Op.SSTORE(1, 0) + Op.SSTORE(1, 1) + Op.SSTORE(0, 1) + Op.STOP, storage={1: 1}, - nonce=0, - address=Address(0xBEA0000000000000000000000000000000000000), # noqa: E501 ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 + refunder = pre.deploy_contract( + code=sum( + ( + Op.SSTORE(slot, 1) + Op.SSTORE(slot, 0) + for slot in range(1, REFUND_SLOTS + 1) + ), + Bytecode(), + ) + + Op.SSTORE(1, 1) + + Op.STOP ) - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0, 1, 3], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_0: Account(storage={0: 1, 1: 1}, nonce=0)}, - }, - { - "indexes": { - "data": [2, 6, 8, 9, 10, 11, 12, 13, 14, 15, 16], - "gas": 0, - "value": -1, - }, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={0: 0, 1: 1}, nonce=0), - Address( - 0x6602CFC925BE62BF18470598A98F72812A1EBEF2 - ): Account.NONEXISTENT, - }, - }, - { - "indexes": {"data": [4], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={0: 0, 1: 1}, nonce=0), - compute_create_address(address=sender, nonce=0): Account( - storage={0: 1, 1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [5, 7], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={0: 0, 1: 1}, nonce=0), - Address(0x0F446E1BD7A5DA68B5E3A305C7030E3AA8EFC293): Account( - storage={0: 1, 1: 1}, nonce=1 - ), - }, - }, - ] + if call_op == "staticcall": + call = Op.POP(Op.STATICCALL(gas=STATICCALL_GAS, address=target)) + else: + call = Op.POP(CALL_OPS[call_op](address=target)) + changed = {0: 1, 1: 1} + post: Dict[Address, Account | None] = {} - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) + if context == "direct": + initcode = call + frame = creator + else: + create2_initcode = bytes(call + Op.STOP) + frame = compute_create2_address(creator, 0, create2_initcode) + initcode = store_in_memory(create2_initcode) + Op.POP( + Op.CREATE2(value=0, offset=0, size=len(create2_initcode), salt=0) + ) + if context == "create2_revert": + initcode += Op.REVERT(0, 0) + elif context == "create2_refund": + initcode += Op.POP(Op.CALL(address=refunder)) + post[refunder] = Account(storage={1: 1}) - tx_data = [ - Op.CALL( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x13, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.STOP * 2 - + Op.INVALID - + Op.CALL( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x18, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.REVERT(offset=0x0, size=0x0) - + Op.STOP * 2 - + Op.INVALID - + Op.CALL( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=200_000, - address=contract_1, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=200_000, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.CALL( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.CALLCODE( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x13, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.STOP * 2 - + Op.INVALID - + Op.CALLCODE( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x18, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.REVERT(offset=0x0, size=0x0) - + Op.STOP * 2 - + Op.INVALID - + Op.CALLCODE( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x25] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=200_000, - address=contract_1, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=200_000, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.CALLCODE( - gas=100_000, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=100_000, - ) - + Op.STOP, - Op.DELEGATECALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x13, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.STOP * 2 - + Op.INVALID - + Op.DELEGATECALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x18, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.REVERT(offset=0x0, size=0x0) - + Op.STOP * 2 - + Op.INVALID - + Op.DELEGATECALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=200_000, - address=contract_1, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=200_000, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.DELEGATECALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.STATICCALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x13, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.STOP * 2 - + Op.INVALID - + Op.STATICCALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x18, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.REVERT(offset=0x0, size=0x0) - + Op.STOP * 2 - + Op.INVALID - + Op.STATICCALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x23] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=200_000, - address=contract_1, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - inner_call_cost=200_000, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.STATICCALL( - gas=100_000, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - ] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - error=_exc, - ) + if context == "create2_revert": + post[target] = Account(storage={1: 1}) + post[frame] = Account.NONEXISTENT + elif call_op == "call": + post[target] = Account(storage=changed) + post[frame] = Account(storage={}, nonce=1) + elif call_op == "staticcall": + post[target] = Account(storage={1: 1}) + post[frame] = Account(storage={}, nonce=1) + else: + post[target] = Account(storage={1: 1}) + post[frame] = Account(storage=changed, nonce=1) - state_test(env=env, pre=pre, post=post, tx=tx) + tx = Transaction(sender=sender, to=None, data=initcode) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_transitions.py b/tests/ported_static/stSStoreTest/test_sstore_transitions.py new file mode 100644 index 00000000000..e0e70086924 --- /dev/null +++ b/tests/ported_static/stSStoreTest/test_sstore_transitions.py @@ -0,0 +1,207 @@ +""" +Change a storage slot through a sequence of SSTOREs from every context. + +Ported from: +state_tests/stSStoreTest/sstore_0to0Filler.json +state_tests/stSStoreTest/sstore_0to0to0Filler.json +state_tests/stSStoreTest/sstore_0to0toXFiller.json +state_tests/stSStoreTest/sstore_0toXFiller.json +state_tests/stSStoreTest/sstore_0toXto0Filler.json +state_tests/stSStoreTest/sstore_0toXto0toXFiller.json +state_tests/stSStoreTest/sstore_0toXtoXFiller.json +state_tests/stSStoreTest/sstore_0toXtoYFiller.json +state_tests/stSStoreTest/sstore_Xto0Filler.json +state_tests/stSStoreTest/sstore_Xto0to0Filler.json +state_tests/stSStoreTest/sstore_Xto0toXFiller.json +state_tests/stSStoreTest/sstore_Xto0toXto0Filler.json +state_tests/stSStoreTest/sstore_Xto0toYFiller.json +state_tests/stSStoreTest/sstore_XtoXFiller.json +state_tests/stSStoreTest/sstore_XtoXto0Filler.json +state_tests/stSStoreTest/sstore_XtoXtoXFiller.json +state_tests/stSStoreTest/sstore_XtoXtoYFiller.json +state_tests/stSStoreTest/sstore_XtoYFiller.json +state_tests/stSStoreTest/sstore_XtoYto0Filler.json +state_tests/stSStoreTest/sstore_XtoYtoXFiller.json +state_tests/stSStoreTest/sstore_XtoYtoYFiller.json +state_tests/stSStoreTest/sstore_XtoYtoZFiller.json + +@manually-enhanced: Do not overwrite. Merged; fixed the CREATE2 0toX case. +""" + +from typing import Dict + +import pytest +from execution_testing import ( + Account, + Address, + Alloc, + Bytecode, + StateTestFiller, + Transaction, + compute_create2_address, + compute_create_address, +) +from execution_testing.vm import Op + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +PATTERNS = { + "0to0": (0, [0]), + "0to0to0": (0, [0, 0]), + "0to0to_x": (0, [0, 1]), + "0to_x": (0, [1]), + "0to_xto0": (0, [1, 0]), + "0to_xto0to_x": (0, [1, 0, 1]), + "0to_xto_x": (0, [1, 1]), + "0to_xto_y": (0, [2, 1]), + "xto0": (1, [0]), + "xto0to0": (1, [0, 0]), + "xto0to_x": (1, [0, 1]), + "xto0to_xto0": (1, [0, 1, 0]), + "xto0to_y": (2, [0, 1]), + "xto_x": (1, [1]), + "xto_xto0": (1, [1, 0]), + "xto_xto_x": (1, [1, 1]), + "xto_xto_y": (2, [2, 1]), + "xto_y": (1, [2]), + "xto_yto0": (1, [2, 0]), + "xto_yto_x": (1, [2, 1]), + "xto_yto_y": (2, [1, 1]), + "xto_yto_z": (1, [2, 3]), +} +"""Original value and the values stored in sequence, per pattern.""" + +CALL_OPS = { + "call": Op.CALL, + "callcode": Op.CALLCODE, + "delegatecall": Op.DELEGATECALL, + "staticcall": Op.STATICCALL, +} +SLOT = 1 +CREATE2_SLOT = 0 +CREATE2_MARKER_SLOT = 1 +REFUND_SLOTS = 16 +STATICCALL_GAS = 300_000 +LOW_GAS_LIMIT = 400_000 + + +def stores(slot: int, values: list[int]) -> Bytecode: + """Store `values` into `slot` one after another.""" + return sum((Op.SSTORE(slot, value) for value in values), Bytecode()) + + +@pytest.mark.ported_from( + [ + "state_tests/stSStoreTest/sstore_0to0Filler.json", + "state_tests/stSStoreTest/sstore_0to0to0Filler.json", + "state_tests/stSStoreTest/sstore_0to0toXFiller.json", + "state_tests/stSStoreTest/sstore_0toXFiller.json", + "state_tests/stSStoreTest/sstore_0toXto0Filler.json", + "state_tests/stSStoreTest/sstore_0toXto0toXFiller.json", + "state_tests/stSStoreTest/sstore_0toXtoXFiller.json", + "state_tests/stSStoreTest/sstore_0toXtoYFiller.json", + "state_tests/stSStoreTest/sstore_Xto0Filler.json", + "state_tests/stSStoreTest/sstore_Xto0to0Filler.json", + "state_tests/stSStoreTest/sstore_Xto0toXFiller.json", + "state_tests/stSStoreTest/sstore_Xto0toXto0Filler.json", + "state_tests/stSStoreTest/sstore_Xto0toYFiller.json", + "state_tests/stSStoreTest/sstore_XtoXFiller.json", + "state_tests/stSStoreTest/sstore_XtoXto0Filler.json", + "state_tests/stSStoreTest/sstore_XtoXtoXFiller.json", + "state_tests/stSStoreTest/sstore_XtoXtoYFiller.json", + "state_tests/stSStoreTest/sstore_XtoYFiller.json", + "state_tests/stSStoreTest/sstore_XtoYto0Filler.json", + "state_tests/stSStoreTest/sstore_XtoYtoXFiller.json", + "state_tests/stSStoreTest/sstore_XtoYtoYFiller.json", + "state_tests/stSStoreTest/sstore_XtoYtoZFiller.json", + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize("pattern", list(PATTERNS)) +@pytest.mark.parametrize("context", [*CALL_OPS, "create2"]) +@pytest.mark.parametrize("revert", [False, True], ids=["", "revert"]) +@pytest.mark.parametrize("low_gas", [False, True], ids=["", "low_gas"]) +def test_sstore_transitions( + state_test: StateTestFiller, + pre: Alloc, + pattern: str, + context: str, + revert: bool, + low_gas: bool, +) -> None: + """ + Run an SSTORE sequence from a creation transaction, then a refunder. + + The sequence runs in a called contract, in the creating frame through + CALLCODE or DELEGATECALL, under STATICCALL (where it fails) or in + CREATE2 init code. A refunder then sets and clears 16 slots and marks + slot 1; the marker shows it ran without running out of gas. + """ + original, sequence = PATTERNS[pattern] + sender = pre.fund_eoa() + creator = compute_create_address(address=sender, nonce=0) + initial: dict = {SLOT: original} if original else {} + target = pre.deploy_contract( + code=stores(SLOT, sequence) + Op.STOP, storage=initial + ) + refunder = pre.deploy_contract( + code=sum( + ( + Op.SSTORE(slot, 1) + Op.SSTORE(slot, 0) + for slot in range(1, REFUND_SLOTS + 1) + ), + Bytecode(), + ) + + Op.SSTORE(1, 1) + + Op.STOP + ) + + post: Dict[Address, Account | None] = {} + final = sequence[-1] + if context == "create2": + prefix = [original] if original else [] + create2_initcode = bytes( + stores(CREATE2_SLOT, prefix + sequence) + + Op.SSTORE(CREATE2_MARKER_SLOT, 1) + + Op.STOP + ) + assert len(create2_initcode) <= 32 + action = Op.MSTORE( + 0, int.from_bytes(create2_initcode.ljust(32, b"\0"), "big") + ) + Op.POP( + Op.CREATE2(value=0, offset=0, size=len(create2_initcode), salt=0) + ) + created = compute_create2_address(creator, 0, create2_initcode) + if not revert: + post[created] = Account( + storage={CREATE2_SLOT: final, CREATE2_MARKER_SLOT: 1} + ) + elif context == "staticcall": + action = Op.POP(Op.STATICCALL(gas=STATICCALL_GAS, address=target)) + post[target] = Account(storage=initial) + else: + action = Op.POP(CALL_OPS[context](address=target)) + if revert: + post[target] = Account(storage=initial) + elif context == "call": + post[target] = Account(storage={SLOT: final}) + post[creator] = Account(storage={}, nonce=1) + else: + post[target] = Account(storage=initial) + post[creator] = Account(storage={SLOT: final}, nonce=1) + + if low_gas: + post = {} + post[refunder] = Account(storage={} if revert or low_gas else {1: 1}) + + initcode = action + Op.POP(Op.CALL(address=refunder)) + if revert: + initcode += Op.REVERT(offset=0, size=0x20) + tx = Transaction( + sender=sender, + to=None, + data=initcode, + gas_limit=LOW_GAS_LIMIT if low_gas else None, + ) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto0.py b/tests/ported_static/stSStoreTest/test_sstore_xto0.py deleted file mode 100644 index 80f7bd1d35b..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto0.py +++ /dev/null @@ -1,530 +0,0 @@ -""" -Change X -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_Xto0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_Xto0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 0}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 0}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x7564C2D690AB324D8FA20707F2BBDCFF4367BB92): Account( - storage={0: 0, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [3000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto0to0.py b/tests/ported_static/stSStoreTest/test_sstore_xto0to0.py deleted file mode 100644 index dfe4b8c9ce9..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto0to0.py +++ /dev/null @@ -1,530 +0,0 @@ -""" -Change X -> 0 -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_Xto0to0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_Xto0to0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto0to0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> 0 -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) * 2 + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) * 2 + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xA3FEBBC9C8C7E91BA2C2BC7CD8B426240C8D6D95): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto0to_x.py b/tests/ported_static/stSStoreTest/test_sstore_xto0to_x.py deleted file mode 100644 index 806243f8154..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto0to_x.py +++ /dev/null @@ -1,536 +0,0 @@ -""" -Change X -> 0 -> X. - -Ported from: -state_tests/stSStoreTest/sstore_Xto0toXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_Xto0toXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto0to_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> 0 -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xEEDFCF2CF4289FF428DE4801D7CB0554E27809F3): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto0to_xto0.py b/tests/ported_static/stSStoreTest/test_sstore_xto0to_xto0.py deleted file mode 100644 index 44a9c8dafbd..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto0to_xto0.py +++ /dev/null @@ -1,540 +0,0 @@ -""" -Change X -> 0 -> X -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_Xto0toXto0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_Xto0toXto0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto0to_xto0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> 0 -> X -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 1 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 1 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 0}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 0}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xA26B643C4BA8272D24F60806A37B20F255620586): Account( - storage={0: 0, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x1A] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x1A] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto0to_y.py b/tests/ported_static/stSStoreTest/test_sstore_xto0to_y.py deleted file mode 100644 index 58680f9945b..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto0to_y.py +++ /dev/null @@ -1,536 +0,0 @@ -""" -Change X -> 0 -> Y. - -Ported from: -state_tests/stSStoreTest/sstore_Xto0toYFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_Xto0toYFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto0to_y( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> 0 -> Y.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 0 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 2}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x7123AFCD1C327C946E05B4FB8AEA10AD0F85CB52): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_x.py b/tests/ported_static/stSStoreTest/test_sstore_xto_x.py deleted file mode 100644 index 165e323bc3f..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_x.py +++ /dev/null @@ -1,528 +0,0 @@ -""" -Change X -> X. - -Ported from: -state_tests/stSStoreTest/sstore_XtoXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xF797D87EB948007FD777404EF459196B099D3EBE): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [3000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_xto0.py b/tests/ported_static/stSStoreTest/test_sstore_xto_xto0.py deleted file mode 100644 index c28c49ed1da..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_xto0.py +++ /dev/null @@ -1,534 +0,0 @@ -""" -Change X -> X -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_XtoXto0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoXto0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_xto0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> X -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x01B59DB2B74B93797420B1A86A28FE35F1E7D0DD): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_xto_x.py b/tests/ported_static/stSStoreTest/test_sstore_xto_xto_x.py deleted file mode 100644 index 89c5ceb7d3d..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_xto_x.py +++ /dev/null @@ -1,528 +0,0 @@ -""" -Change X -> X -> X. - -Ported from: -state_tests/stSStoreTest/sstore_XtoXtoXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoXtoXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_xto_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> X -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xBA3394A0586B8419B4CF72C7D0F7E75A55A703F8): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 3 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) * 3 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_xto_y.py b/tests/ported_static/stSStoreTest/test_sstore_xto_xto_y.py deleted file mode 100644 index d99e9976466..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_xto_y.py +++ /dev/null @@ -1,534 +0,0 @@ -""" -Change X -> X -> Y. - -Ported from: -state_tests/stSStoreTest/sstore_XtoXtoYFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoXtoYFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_xto_y( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> X -> Y.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 2}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x6AB22377D181D9F2D8B5BFFC62AC497ABBD7CFC5): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) * 2 - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) * 2 - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_y.py b/tests/ported_static/stSStoreTest/test_sstore_xto_y.py deleted file mode 100644 index 1688317a76a..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_y.py +++ /dev/null @@ -1,530 +0,0 @@ -""" -Change X -> Y. - -Ported from: -state_tests/stSStoreTest/sstore_XtoYFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoYFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_y( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> Y.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 2}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 2}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x7E6EF1EFBE92AD9ADCFD8C92BA7932C904D03735): Account( - storage={0: 2, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x10] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [3000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_yto0.py b/tests/ported_static/stSStoreTest/test_sstore_xto_yto0.py deleted file mode 100644 index c517fee7d5a..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_yto0.py +++ /dev/null @@ -1,536 +0,0 @@ -""" -Change X -> Y -> 0. - -Ported from: -state_tests/stSStoreTest/sstore_XtoYto0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoYto0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_yto0( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> Y -> 0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 [[1]] 0 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 [[1]] 0 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x0) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x96606E69EE07F3BA565D1F25EDEA6C691A780E71): Account( - storage={1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_x.py b/tests/ported_static/stSStoreTest/test_sstore_xto_yto_x.py deleted file mode 100644 index 36588cdc59f..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_x.py +++ /dev/null @@ -1,536 +0,0 @@ -""" -Change X -> Y -> X. - -Ported from: -state_tests/stSStoreTest/sstore_XtoYtoXFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoYtoXFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_yto_x( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> Y -> X.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0x90B7D8D4BC39664E30BE0C2380E2B04AA15C6518): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_y.py b/tests/ported_static/stSStoreTest/test_sstore_xto_yto_y.py deleted file mode 100644 index 65c7a29e235..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_y.py +++ /dev/null @@ -1,530 +0,0 @@ -""" -Change X -> Y -> Y. - -Ported from: -state_tests/stSStoreTest/sstore_XtoYtoYFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoYtoYFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_yto_y( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> Y -> Y.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 1 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) * 2 + Op.STOP, - storage={1: 2}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 2}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 1}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xA84440891DDEC0F3A6FA2423D55E437383AD272B): Account( - storage={0: 1, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x1) * 2 - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_z.py b/tests/ported_static/stSStoreTest/test_sstore_xto_yto_z.py deleted file mode 100644 index df7dfa76259..00000000000 --- a/tests/ported_static/stSStoreTest/test_sstore_xto_yto_z.py +++ /dev/null @@ -1,536 +0,0 @@ -""" -Change X -> Y -> Z. - -Ported from: -state_tests/stSStoreTest/sstore_XtoYtoZFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork -from execution_testing.vm import Op - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stSStoreTest/sstore_XtoYtoZFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="d0-g0", - ), - pytest.param( - 0, - 1, - 0, - id="d0-g1", - ), - pytest.param( - 1, - 0, - 0, - id="d1-g0", - ), - pytest.param( - 1, - 1, - 0, - id="d1-g1", - ), - pytest.param( - 2, - 0, - 0, - id="d2-g0", - ), - pytest.param( - 2, - 1, - 0, - id="d2-g1", - ), - pytest.param( - 3, - 0, - 0, - id="d3-g0", - ), - pytest.param( - 3, - 1, - 0, - id="d3-g1", - ), - pytest.param( - 4, - 0, - 0, - id="d4-g0", - ), - pytest.param( - 4, - 1, - 0, - id="d4-g1", - ), - pytest.param( - 5, - 0, - 0, - id="d5-g0", - ), - pytest.param( - 5, - 1, - 0, - id="d5-g1", - ), - pytest.param( - 6, - 0, - 0, - id="d6-g0", - ), - pytest.param( - 6, - 1, - 0, - id="d6-g1", - ), - pytest.param( - 7, - 0, - 0, - id="d7-g0", - ), - pytest.param( - 7, - 1, - 0, - id="d7-g1", - ), - pytest.param( - 8, - 0, - 0, - id="d8-g0", - ), - pytest.param( - 8, - 1, - 0, - id="d8-g1", - ), - pytest.param( - 9, - 0, - 0, - id="d9-g0", - ), - pytest.param( - 9, - 1, - 0, - id="d9-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_sstore_xto_yto_z( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Change X -> Y -> Z.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xB000000000000000000000000000000000000000) - contract_1 = Address(0xC000000000000000000000000000000000000000) - contract_2 = Address(0xDEA0000000000000000000000000000000000000) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xE8D4A51000) - # Source: lll - # { [[1]] 2 [[1]] 3 } - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x3) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xB000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 2 [[1]] 3 } - contract_1 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x2) - + Op.SSTORE(key=0x1, value=0x3) - + Op.STOP, - storage={1: 1}, - nonce=0, - address=Address(0xC000000000000000000000000000000000000000), # noqa: E501 - ) - # Source: lll - # { [[1]] 1 [[1]] 0 [[2]] 1 [[2]] 0 [[3]] 1 [[3]] 0 [[4]] 1 [[4]] 0 [[5]] 1 [[5]] 0 [[6]] 1 [[6]] 0 [[7]] 1 [[7]] 0 [[8]] 1 [[8]] 0 [[9]] 1 [[9]] 0 [[10]] 1 [[10]] 0 [[11]] 1 [[11]] 0 [[12]] 1 [[12]] 0 [[13]] 1 [[13]] 0 [[14]] 1 [[14]] 0 [[15]] 1 [[15]] 0 [[16]] 1 [[16]] 0 [[1]] 1 } # noqa: E501 - contract_2 = pre.deploy_contract( # noqa: F841 - code=Op.SSTORE(key=0x1, value=0x1) - + Op.SSTORE(key=0x1, value=0x0) - + Op.SSTORE(key=0x2, value=0x1) - + Op.SSTORE(key=0x2, value=0x0) - + Op.SSTORE(key=0x3, value=0x1) - + Op.SSTORE(key=0x3, value=0x0) - + Op.SSTORE(key=0x4, value=0x1) - + Op.SSTORE(key=0x4, value=0x0) - + Op.SSTORE(key=0x5, value=0x1) - + Op.SSTORE(key=0x5, value=0x0) - + Op.SSTORE(key=0x6, value=0x1) - + Op.SSTORE(key=0x6, value=0x0) - + Op.SSTORE(key=0x7, value=0x1) - + Op.SSTORE(key=0x7, value=0x0) - + Op.SSTORE(key=0x8, value=0x1) - + Op.SSTORE(key=0x8, value=0x0) - + Op.SSTORE(key=0x9, value=0x1) - + Op.SSTORE(key=0x9, value=0x0) - + Op.SSTORE(key=0xA, value=0x1) - + Op.SSTORE(key=0xA, value=0x0) - + Op.SSTORE(key=0xB, value=0x1) - + Op.SSTORE(key=0xB, value=0x0) - + Op.SSTORE(key=0xC, value=0x1) - + Op.SSTORE(key=0xC, value=0x0) - + Op.SSTORE(key=0xD, value=0x1) - + Op.SSTORE(key=0xD, value=0x0) - + Op.SSTORE(key=0xE, value=0x1) - + Op.SSTORE(key=0xE, value=0x0) - + Op.SSTORE(key=0xF, value=0x1) - + Op.SSTORE(key=0xF, value=0x0) - + Op.SSTORE(key=0x10, value=0x1) - + Op.SSTORE(key=0x10, value=0x0) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - nonce=0, - address=Address(0xDEA0000000000000000000000000000000000000), # noqa: E501 - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": [0], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 3}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={}, nonce=1 - ), - }, - }, - { - "indexes": {"data": [1, 2], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - contract_0: Account(storage={1: 1}), - contract_2: Account(storage={1: 1}), - compute_create_address(address=sender, nonce=0): Account( - storage={1: 3}, nonce=1 - ), - }, - }, - { - "indexes": {"data": 3, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 1})}, - }, - { - "indexes": {"data": 4, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - Address(0xDE59CA290FA8B9E3DB697325D153C540AC08321D): Account( - storage={0: 3, 1: 1} - ), - contract_2: Account(storage={1: 1}), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - { - "indexes": {"data": [5, 6, 7, 8, 9], "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": {contract_2: Account(storage={1: 0})}, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x38, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x3) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - Op.POP( - Op.CALL( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.CALLCODE( - gas=0x493E0, - address=contract_0, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.DELEGATECALL( - gas=0x493E0, - address=contract_0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.POP( - Op.STATICCALL( - gas=0x493E0, - address=contract_1, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP, - Op.PUSH1[0x0] - + Op.PUSH1[0x15] - + Op.CODECOPY(dest_offset=0x0, offset=0x3D, size=Op.DUP1) - + Op.PUSH1[0x0] * 2 - + Op.POP(Op.CREATE2) - + Op.POP( - Op.CALL( - gas=0x927C0, - address=contract_2, - value=0x0, - args_offset=0x0, - args_size=0x0, - ret_offset=0x0, - ret_size=0x0, - ) - ) - + Op.REVERT(offset=0x0, size=0x20) - + Op.STOP * 2 - + Op.INVALID - + Op.SSTORE(key=0x0, value=0x1) - + Op.SSTORE(key=0x0, value=0x2) - + Op.SSTORE(key=0x0, value=0x3) - + Op.SSTORE(key=0x1, value=0x1) - + Op.STOP, - ] - tx_gas = [1000000, 400000] - tx_value = [1] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit.py b/tests/ported_static/stWalletTest/test_day_limit.py new file mode 100644 index 00000000000..8d1486f7993 --- /dev/null +++ b/tests/ported_static/stWalletTest/test_day_limit.py @@ -0,0 +1,80 @@ +""" +Call the daily limit functions of the `daylimit` contract. + +Ported from: +state_tests/stWalletTest/dayLimitResetSpentTodayFiller.json +state_tests/stWalletTest/dayLimitSetDailyLimitFiller.json +state_tests/stWalletTest/dayLimitSetDailyLimitNoDataFiller.json + +@manually-enhanced: Do not overwrite. Merged; derived storage slots. +""" + +import pytest +from execution_testing import ( + Account, + Alloc, + Bytes, + Hash, + StateTestFiller, + Transaction, +) + +from tests.ported_static.stWalletTest.wallet_contracts import ( + DAILY_LIMIT_SLOT, + DAY_LIMIT_CODE, + LAST_DAY_SLOT, + PENDING_INDEX_SLOT, + SPENT_TODAY_SLOT, + owners_storage, +) + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +RESET_SPENT_TODAY = Bytes("5c52c2f5") +SET_DAILY_LIMIT = Bytes("b20d30a9") +LAST_DAY = 0xC22E4 + + +@pytest.mark.ported_from( + [ + "state_tests/stWalletTest/dayLimitResetSpentTodayFiller.json", + "state_tests/stWalletTest/dayLimitSetDailyLimitFiller.json", + "state_tests/stWalletTest/dayLimitSetDailyLimitNoDataFiller.json", + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize( + "scenario", + ["reset_spent_today", "set_daily_limit", "set_daily_limit_no_data"], +) +def test_day_limit( + state_test: StateTestFiller, + pre: Alloc, + scenario: str, +) -> None: + """Call one `daylimit` function from the single owner.""" + sender = pre.fund_eoa() + storage = owners_storage(1, [sender]) | {LAST_DAY_SLOT: LAST_DAY} + + data: bytes + if scenario == "reset_spent_today": + storage |= { + PENDING_INDEX_SLOT: 1, + DAILY_LIMIT_SLOT: 2, + SPENT_TODAY_SLOT: 5, + } + data = RESET_SPENT_TODAY + post_storage = storage | {PENDING_INDEX_SLOT: 2, SPENT_TODAY_SLOT: 0} + elif scenario == "set_daily_limit": + data = SET_DAILY_LIMIT + Hash(2) + post_storage = storage | {PENDING_INDEX_SLOT: 1, DAILY_LIMIT_SLOT: 2} + elif scenario == "set_daily_limit_no_data": + data = SET_DAILY_LIMIT + post_storage = storage | {PENDING_INDEX_SLOT: 1} + else: + raise ValueError(f"Unknown scenario: {scenario}") + + wallet = pre.deploy_contract(code=DAY_LIMIT_CODE, storage=storage) + tx = Transaction(sender=sender, to=wallet, data=data) + state_test(pre=pre, post={wallet: Account(storage=post_storage)}, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_construction.py b/tests/ported_static/stWalletTest/test_day_limit_construction.py deleted file mode 100644 index f2795bb1d53..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_construction.py +++ /dev/null @@ -1,119 +0,0 @@ -""" -Test_day_limit_construction. - -Ported from: -state_tests/stWalletTest/dayLimitConstructionFiller.json - -@manually-enhanced: Do not overwrite. Both `tx_gas` values bumped for -EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (the test has the -same post-state for both g indexes — both are 'should succeed' paths). -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitConstructionFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="-g0", - ), - pytest.param( - 0, - 1, - 0, - id="-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_day_limit_construction( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Test_day_limit_construction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - - tx_data = [ - Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529190912055620151804204610107556109b4806100456000396000f300606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - ] - # The deployed wallet contract does ~14 fresh SSTOREs during - # construction; EIP-8037 per-storage state-gas spills into regular - # gas on Amsterdam, exceeding the original 817 083 / 1 217 083 - # budgets. Pre-EIP-8037 keeps the original values. - construction_tx_gas = [817_083, 1_217_083] - if fork.is_eip_enabled(8037): - construction_tx_gas = [5_000_000, 7_000_000] - tx_gas = construction_tx_gas - tx_value = [100] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - nonce=1, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=2), - compute_create_address(address=sender, nonce=1): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_construction_oog.py b/tests/ported_static/stWalletTest/test_day_limit_construction_oog.py deleted file mode 100644 index e64697dc217..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_construction_oog.py +++ /dev/null @@ -1,46 +0,0 @@ -""" -Test_day_limit_construction_oog. - -Ported from: -state_tests/stWalletTest/dayLimitConstructionOOGFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitConstructionOOGFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_day_limit_construction_oog( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_day_limit_construction_oog.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F, nonce=1) - - tx = Transaction( - sender=sender, - to=None, - data=Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529190912055620151804204610107556109b4806100456000396000f300606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - gas_limit=288282, - value=100, - nonce=1, - ) - - post = {sender: Account(storage={}, code=b"", nonce=2)} - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_construction_partial.py b/tests/ported_static/stWalletTest/test_day_limit_construction_partial.py deleted file mode 100644 index 3b761567555..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_construction_partial.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -Test_day_limit_construction_partial. - -Ported from: -state_tests/stWalletTest/dayLimitConstructionPartialFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitConstructionPartialFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_day_limit_construction_partial( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_day_limit_construction_partial.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - - tx = Transaction( - sender=sender, - to=None, - data=Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529190912055620151804204610107556109b4806100456000396000f300606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=2), - compute_create_address(address=sender, nonce=1): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_reset_spent_today.py b/tests/ported_static/stWalletTest/test_day_limit_reset_spent_today.py deleted file mode 100644 index 8ca44bb9093..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_reset_spent_today.py +++ /dev/null @@ -1,99 +0,0 @@ -""" -Test_day_limit_reset_spent_today. - -Ported from: -state_tests/stWalletTest/dayLimitResetSpentTodayFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitResetSpentTodayFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_day_limit_reset_spent_today( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_day_limit_reset_spent_today.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 261: 2, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("5c52c2f5"), - gas_limit=635701, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 2, - 261: 2, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit.py b/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit.py deleted file mode 100644 index 7001d5c4d51..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -Test_day_limit_set_daily_limit. - -Ported from: -state_tests/stWalletTest/dayLimitSetDailyLimitFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitSetDailyLimitFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_day_limit_set_daily_limit( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_day_limit_set_daily_limit.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b20d30a9") + Hash(0x2), - gas_limit=635701, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 261: 2, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit_no_data.py b/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit_no_data.py deleted file mode 100644 index 9f315b1ee78..00000000000 --- a/tests/ported_static/stWalletTest/test_day_limit_set_daily_limit_no_data.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -Test_day_limit_set_daily_limit_no_data. - -Ported from: -state_tests/stWalletTest/dayLimitSetDailyLimitNoDataFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/dayLimitSetDailyLimitNoDataFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_day_limit_set_daily_limit_no_data( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_day_limit_set_daily_limit_no_data.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b20d30a9"), - gas_limit=635701, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb4814610154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c5578063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1736d86146102a2575b005b6100986004356000600036436040518084848082843750505090910190815260405190819003602001902090506105b9815b600160a060020a0333166000908152610102602052604081205481808083811415610719576108b0565b6102ac6004355b600160a060020a0316600090815261010260205260408120541190565b6102ac60015481565b6100986000364360405180848480828437505050909101908152604051908190036020019020905061070b816100cc565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610531816100cc565b6102ac60005481565b610098600435600036436040518084848082843750505090910190815260405190819003602001902090506106ff816100cc565b610098600435600160a060020a03331660009081526101026020526040812054908080838114156102be57610340565b61009860043560003643604051808484808284375050509091019081526040519081900360200190209050610678816100cc565b6102ac600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156106d1576106f5565b6100986004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506103ca816100cc565b6102ac6101055481565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156103405781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156103c3576103d8836100fd565b156103e357506103c5565b600160a060020a03841660009081526101026020526040812054925082141561040c57506103c5565b6103475b6101045460005b8181101561085f576101048054829081101561000257600091825260008051602061099483398151915201541461048a5761010480546101039160009184908110156100025760008051602061099483398151915201548252506020919091526040812081815560018101829055600201555b600101610417565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa90106105675761056561057c565b505b60015460fa9010610492575061052e565b6106365b600060015b600154811015610899575b600154811080156105ac5750600281610100811015610002570154600014155b156108b95760010161058c565b156103c557600160a060020a0383166000908152610102602052604081205492508214156105e7575061052c565b6001600160005054036000600050541115610602575061052c565b600060028361010081101561000257508301819055600160a060020a03841681526101026020526040812055610578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561052c5760015482111561068d575061052e565b600082905561069a610410565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106f057600094506106f5565b600194505b5050505092915050565b1561052c575061010555565b1561052e5760006101065550565b60008681526101036020526040812080549094509092508214156107a2578154835560018381018390556101048054918201808255828015829011610771578183600052602060002091820191016107719190610885565b5050506002840181905561010480548892908110156100025760009190915260008051602061099483398151915201555b506001820154600284900a908116600014156108b05760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161089d57600086815261010360205260409020600201546101048054909190811015610002576040600090812060008051602061099483398151915292909201819055808255600180830182905560029092015595506108b09050565b61010480546000808355919091526103c590600080516020610994833981519152908101905b808211156108995760008155600101610885565b5090565b8254600019018355600183018054821790555b50505050919050565b5b600180541180156108dc57506001546002906101008110156100025701546000145b156108f057600180546000190190556108ba565b600154811080156109135750600154600290610100811015610002570154600014155b801561092d57506002816101008110156100025701546000145b1561098e57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned.py b/tests/ported_static/stWalletTest/test_multi_owned.py new file mode 100644 index 00000000000..78bf1828cd6 --- /dev/null +++ b/tests/ported_static/stWalletTest/test_multi_owned.py @@ -0,0 +1,207 @@ +""" +Call the owner management functions of the `multiOwned` contract. + +Ported from: +state_tests/stWalletTest/multiOwnedAddOwnerFiller.json +state_tests/stWalletTest/multiOwnedAddOwnerAddMyselfFiller.json +state_tests/stWalletTest/multiOwnedChangeOwnerFiller.json +state_tests/stWalletTest/multiOwnedChangeOwner_fromNotOwnerFiller.json +state_tests/stWalletTest/multiOwnedChangeOwnerNoArgumentFiller.json +state_tests/stWalletTest/multiOwnedChangeOwner_toIsOwnerFiller.json +state_tests/stWalletTest/multiOwnedChangeRequirementTo0Filler.json +state_tests/stWalletTest/multiOwnedChangeRequirementTo1Filler.json +state_tests/stWalletTest/multiOwnedChangeRequirementTo2Filler.json +state_tests/stWalletTest/multiOwnedIsOwnerFalseFiller.json +state_tests/stWalletTest/multiOwnedIsOwnerTrueFiller.json +state_tests/stWalletTest/multiOwnedRemoveOwnerFiller.json +state_tests/stWalletTest/multiOwnedRemoveOwnerByNonOwnerFiller.json +state_tests/stWalletTest/multiOwnedRemoveOwner_mySelfFiller.json +state_tests/stWalletTest/multiOwnedRemoveOwner_ownerIsNotOwnerFiller.json +state_tests/stWalletTest/multiOwnedRevokeNothingFiller.json + +@manually-enhanced: Do not overwrite. Merged; checks the isOwner result. +""" + +import pytest +from execution_testing import ( + Account, + Address, + Alloc, + Bytes, + Hash, + StateTestFiller, + Transaction, +) +from execution_testing.vm import Op + +from tests.ported_static.stWalletTest.wallet_contracts import ( + MULTI_OWNED_CODE, + MULTI_OWNED_V2_CODE, + OWNER_INDEX_MAP, + PENDING_INDEX_SLOT, + mapping_slot, + owners_storage, +) + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +ADD_OWNER = Bytes("7065cb48") +CHANGE_OWNER = Bytes("f00d4b5d") +CHANGE_REQUIREMENT = Bytes("ba51a6df") +IS_OWNER = Bytes("2f54bf6e") +REMOVE_OWNER = Bytes("173825d9") +REVOKE = Bytes("b75c7dc6") + +RETURN_SENTINEL = 0x5E47 +CALL_VALUE = 100 + + +def word(value: int | Address) -> Hash: + """Return `value` as an ABI-encoded word.""" + return Hash(value, left_padding=True) + + +@pytest.mark.ported_from( + [ + "state_tests/stWalletTest/multiOwnedAddOwnerFiller.json", + "state_tests/stWalletTest/multiOwnedAddOwnerAddMyselfFiller.json", + "state_tests/stWalletTest/multiOwnedChangeOwnerFiller.json", + "state_tests/stWalletTest/multiOwnedChangeOwner_fromNotOwnerFiller.json", # noqa: E501 + "state_tests/stWalletTest/multiOwnedChangeOwnerNoArgumentFiller.json", + "state_tests/stWalletTest/multiOwnedChangeOwner_toIsOwnerFiller.json", + "state_tests/stWalletTest/multiOwnedChangeRequirementTo0Filler.json", + "state_tests/stWalletTest/multiOwnedChangeRequirementTo1Filler.json", + "state_tests/stWalletTest/multiOwnedChangeRequirementTo2Filler.json", + "state_tests/stWalletTest/multiOwnedIsOwnerFalseFiller.json", + "state_tests/stWalletTest/multiOwnedIsOwnerTrueFiller.json", + "state_tests/stWalletTest/multiOwnedRemoveOwnerFiller.json", + "state_tests/stWalletTest/multiOwnedRemoveOwnerByNonOwnerFiller.json", + "state_tests/stWalletTest/multiOwnedRemoveOwner_mySelfFiller.json", + "state_tests/stWalletTest/multiOwnedRemoveOwner_ownerIsNotOwnerFiller.json", # noqa: E501 + "state_tests/stWalletTest/multiOwnedRevokeNothingFiller.json", + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.parametrize( + "scenario", + [ + "add_owner", + "add_owner_add_myself", + "change_owner", + "change_owner_from_not_owner", + "change_owner_no_argument", + "change_owner_to_is_owner", + "change_requirement_to0", + "change_requirement_to1", + "change_requirement_to2", + "is_owner_false", + "is_owner_true", + "remove_owner", + "remove_owner_by_non_owner", + "remove_owner_my_self", + "remove_owner_owner_is_not_owner", + "revoke_nothing", + ], +) +def test_multi_owned( + state_test: StateTestFiller, + pre: Alloc, + scenario: str, +) -> None: + """Call one `multiOwned` function from the sender.""" + sender = pre.fund_eoa() + other_owner = pre.nonexistent_account() + stranger = pre.nonexistent_account() + + code = MULTI_OWNED_CODE + owners: list[Address] = [sender] + unchanged = owners_storage(1, owners) + pending = unchanged | {PENDING_INDEX_SLOT: 1} + caller_storage: dict | None = None + data: bytes + + if scenario == "add_owner": + data = ADD_OWNER + word(other_owner) + post_storage = owners_storage(1, [sender, other_owner]) + elif scenario == "add_owner_add_myself": + data = ADD_OWNER + word(sender) + post_storage = pending + elif scenario == "change_owner": + data = CHANGE_OWNER + word(sender) + word(other_owner) + post_storage = owners_storage(1, [other_owner]) + elif scenario == "change_owner_from_not_owner": + data = CHANGE_OWNER + word(stranger) + word(other_owner) + post_storage = pending + elif scenario == "change_owner_no_argument": + data = CHANGE_OWNER + post_storage = pending + elif scenario == "change_owner_to_is_owner": + data = CHANGE_OWNER + word(sender) + word(sender) + post_storage = pending + elif scenario == "change_requirement_to0": + data = CHANGE_REQUIREMENT + word(0) + post_storage = owners_storage(0, owners) + elif scenario == "change_requirement_to1": + data = CHANGE_REQUIREMENT + word(1) + post_storage = unchanged + elif scenario == "change_requirement_to2": + data = CHANGE_REQUIREMENT + word(2) + post_storage = pending + elif scenario == "is_owner_false": + data = IS_OWNER + word(stranger) + post_storage = unchanged + caller_storage = {0: 0, 1: 0x20} + elif scenario == "is_owner_true": + data = IS_OWNER + word(sender) + post_storage = unchanged + caller_storage = {0: 1, 1: 0x20} + elif scenario == "remove_owner": + code = MULTI_OWNED_V2_CODE + owners = [sender, other_owner] + data = REMOVE_OWNER + word(sender) + post_storage = owners_storage(1, [other_owner]) + elif scenario == "remove_owner_by_non_owner": + owners = [other_owner] + data = REMOVE_OWNER + word(other_owner) + post_storage = owners_storage(1, owners) + elif scenario == "remove_owner_my_self": + data = REMOVE_OWNER + word(sender) + post_storage = pending + elif scenario == "remove_owner_owner_is_not_owner": + data = REMOVE_OWNER + word(stranger) + post_storage = pending + elif scenario == "revoke_nothing": + data = REVOKE + word(mapping_slot(sender, OWNER_INDEX_MAP)) + post_storage = unchanged + else: + raise ValueError(f"Unknown scenario: {scenario}") + + wallet = pre.deploy_contract(code=code, storage=owners_storage(1, owners)) + post = {wallet: Account(storage=post_storage)} + + to = wallet + if caller_storage is not None: + to = pre.deploy_contract( + code=Op.CALLDATACOPY(0x20, 0, Op.CALLDATASIZE) + + Op.MSTORE(0, RETURN_SENTINEL) + + Op.POP( + Op.CALL( + address=wallet, + args_offset=0x20, + args_size=Op.CALLDATASIZE, + ret_offset=0, + ret_size=0x20, + ) + ) + + Op.SSTORE(0, Op.MLOAD(0)) + + Op.SSTORE(1, Op.RETURNDATASIZE), + ) + post[to] = Account(storage=caller_storage) + + value = 0 + if to == wallet: + value = CALL_VALUE + post[wallet] = Account(storage=post_storage, balance_change=value) + tx = Transaction(sender=sender, to=to, data=data, value=value) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_add_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_add_owner.py deleted file mode 100644 index 71b81edd443..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_add_owner.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -Test_multi_owned_add_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedAddOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedAddOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_add_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_add_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("7065cb48") - + Hash(0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 2, - 3: sender, - 4: 0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_add_owner_add_myself.py b/tests/ported_static/stWalletTest/test_multi_owned_add_owner_add_myself.py deleted file mode 100644 index da52d06e983..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_add_owner_add_myself.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Test_multi_owned_add_owner_add_myself. - -Ported from: -state_tests/stWalletTest/multiOwnedAddOwnerAddMyselfFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedAddOwnerAddMyselfFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_add_owner_add_myself( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_add_owner_add_myself.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("7065cb48") + Hash(sender, left_padding=True), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_change_owner.py deleted file mode 100644 index 7f24fa0623c..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_owner.py +++ /dev/null @@ -1,96 +0,0 @@ -""" -Test_multi_owned_change_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("f00d4b5d") - + Hash(sender, left_padding=True) - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, - 0x62CE4F671906BE9A217487BB98E428B08E12100FB0007DF10572CA00206E7D73: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_from_not_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_change_owner_from_not_owner.py deleted file mode 100644 index cdd7d00fd01..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_from_not_owner.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -Test_multi_owned_change_owner_from_not_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeOwner_fromNotOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeOwner_fromNotOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_owner_from_not_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_owner_from_not_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("f00d4b5d") - + Hash(0xB94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_no_argument.py b/tests/ported_static/stWalletTest/test_multi_owned_change_owner_no_argument.py deleted file mode 100644 index abd28c4ca20..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_no_argument.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Test_multi_owned_change_owner_no_argument. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeOwnerNoArgumentFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeOwnerNoArgumentFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_owner_no_argument( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_owner_no_argument.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("f00d4b5d"), - gas_limit=770743, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_to_is_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_change_owner_to_is_owner.py deleted file mode 100644 index aedd0a4dc9f..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_owner_to_is_owner.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -Test_multi_owned_change_owner_to_is_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeOwner_toIsOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeOwner_toIsOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_owner_to_is_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_owner_to_is_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("f00d4b5d") - + Hash(sender, left_padding=True) - + Hash(sender, left_padding=True), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to0.py b/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to0.py deleted file mode 100644 index 48c0a59ad40..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to0.py +++ /dev/null @@ -1,93 +0,0 @@ -""" -Test_multi_owned_change_requirement_to0. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeRequirementTo0Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeRequirementTo0Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_requirement_to0( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_requirement_to0.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("ba51a6df") + Hash(0x0), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to1.py b/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to1.py deleted file mode 100644 index e29e02486a2..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to1.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Test_multi_owned_change_requirement_to1. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeRequirementTo1Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeRequirementTo1Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_requirement_to1( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_requirement_to1.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("ba51a6df") + Hash(0x1), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to2.py b/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to2.py deleted file mode 100644 index 9724b0cad39..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_change_requirement_to2.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Test_multi_owned_change_requirement_to2. - -Ported from: -state_tests/stWalletTest/multiOwnedChangeRequirementTo2Filler.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedChangeRequirementTo2Filler.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_change_requirement_to2( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_change_requirement_to2.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("ba51a6df") + Hash(0x2), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_construction_correct.py b/tests/ported_static/stWalletTest/test_multi_owned_construction_correct.py deleted file mode 100644 index e8358ff7f7c..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_construction_correct.py +++ /dev/null @@ -1,78 +0,0 @@ -""" -Test_multi_owned_construction_correct. - -Ported from: -state_tests/stWalletTest/multiOwnedConstructionCorrectFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedConstructionCorrectFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_construction_correct( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_construction_correct.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A7640000) - - tx = Transaction( - sender=sender, - to=None, - data=Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529182205561090a90819061003b90396000f300606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - gas_limit=10000000, - value=100, - ) - - post = { - compute_create_address(address=sender, nonce=0): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - sender: Account(storage={}, code=b"", nonce=1), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas.py b/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas.py deleted file mode 100644 index d6be5724357..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas.py +++ /dev/null @@ -1,55 +0,0 @@ -""" -Test_multi_owned_construction_not_enough_gas. - -Ported from: -state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasFiller.json"], -) -@pytest.mark.valid_from("Cancun") -def test_multi_owned_construction_not_enough_gas( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_construction_not_enough_gas.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=1000000, - ) - - tx = Transaction( - sender=sender, - to=None, - data=Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529182205561090a90819061003b90396000f300606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - gas_limit=256449, - ) - - post = {sender: Account(storage={}, code=b"", nonce=1)} - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas_partial.py b/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas_partial.py deleted file mode 100644 index 095c422a1eb..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_construction_not_enough_gas_partial.py +++ /dev/null @@ -1,126 +0,0 @@ -""" -Test_multi_owned_construction_not_enough_gas_partial. - -Ported from: -state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasPartialFiller.json -@manually-enhanced: Do not overwrite. tx_gas[1] is tuned for the -multi-owned-wallet construction success path on Cancun; on Amsterdam -the NEW_ACCOUNT, 3 init-code SSTOREs, and 2314-byte code deposit -spill state-gas, so lift the budget by Fork.oog_budget_lift. -""" - -import pytest -from execution_testing import ( - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasPartialFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="-g0", - ), - pytest.param( - 0, - 1, - 0, - id="-g1", - ), - ], -) -def test_multi_owned_construction_not_enough_gas_partial( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Test_multi_owned_construction_not_enough_gas_partial.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = pre.fund_eoa(amount=0xDE0B6B3A7640000) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - compute_create_address( - address=sender, nonce=0 - ): Account.NONEXISTENT, - sender: Account(storage={}, code=b"", nonce=1), - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": { - compute_create_address(address=sender, nonce=0): Account( - nonce=1 - ), - sender: Account(storage={}, code=b"", nonce=1), - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes( - "606060409081526001600081815581805533600160a060020a0316600381905581526101026020529182205561090a90819061003b90396000f300606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - ] - tx_gas = [ - 601249, - 751249 - + fork.oog_budget_lift( - creates_before_oog=1, - sstores_before_oog=3, - deploy_code_size=2314, - ), - ] - tx_value = [100] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_is_owner_false.py b/tests/ported_static/stWalletTest/test_multi_owned_is_owner_false.py deleted file mode 100644 index 9728d6d8c28..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_is_owner_false.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Test_multi_owned_is_owner_false. - -Ported from: -state_tests/stWalletTest/multiOwnedIsOwnerFalseFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedIsOwnerFalseFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_is_owner_false( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_is_owner_false.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F, nonce=1) - - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0_code = bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - contract_0 = pre.deploy_contract( - code=contract_0_code, - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("2f54bf6e") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=contract_0_code, - balance=200, - nonce=1, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_is_owner_true.py b/tests/ported_static/stWalletTest/test_multi_owned_is_owner_true.py deleted file mode 100644 index 52e189305ec..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_is_owner_true.py +++ /dev/null @@ -1,76 +0,0 @@ -""" -Test_multi_owned_is_owner_true. - -Ported from: -state_tests/stWalletTest/multiOwnedIsOwnerTrueFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedIsOwnerTrueFiller.json"], -) -@pytest.mark.valid_from("Cancun") -def test_multi_owned_is_owner_true( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_is_owner_true.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F) - - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0_code = bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - # m_ownerIndex[sender] is at keccak256(sender ++ 0x102). - owner_index_slot = Bytes( - Hash(sender, left_padding=True) + Hash(0x102) - ).keccak256() - contract_0 = pre.deploy_contract( - code=contract_0_code, - storage={ - 0: 1, - 1: 1, - 3: sender, - owner_index_slot: 1, - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("2f54bf6e") + Hash(sender, left_padding=True), - gas_limit=10000000, - value=100, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - owner_index_slot: 1, - }, - code=contract_0_code, - balance=200, - nonce=1, - ), - sender: Account(storage={}, nonce=1), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_remove_owner.py deleted file mode 100644 index 9947931cf21..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner.py +++ /dev/null @@ -1,871 +0,0 @@ -""" -Test_multi_owned_remove_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedRemoveOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) -from execution_testing.vm import Op - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedRemoveOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_remove_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_remove_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056 # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=Op.DIV( - Op.CALLDATALOAD(offset=0x0), - 0x100000000000000000000000000000000000000000000000000000000, - ) - + Op.JUMPI(pc=Op.PUSH2[0x65], condition=Op.EQ(Op.DUP2, 0x173825D9)) - + Op.JUMPI(pc=Op.PUSH2[0xB7], condition=Op.EQ(0x2F54BF6E, Op.DUP1)) - + Op.JUMPI(pc=Op.PUSH2[0xE8], condition=Op.EQ(0x7065CB48, Op.DUP1)) - + Op.JUMPI(pc=0x105, condition=Op.EQ(0xB75C7DC6, Op.DUP1)) - + Op.JUMPI(pc=0x142, condition=Op.EQ(0xBA51A6DF, Op.DUP1)) - + Op.JUMPI(pc=0x15F, condition=Op.EQ(0xF00D4B5D, Op.DUP1)) - + Op.STOP - + Op.JUMPDEST - + Op.PUSH2[0x181] - + Op.CALLDATALOAD(offset=0x4) - + Op.PUSH1[0x0] - + Op.PUSH1[0x40] - + Op.PUSH1[0x0] - + Op.CALLDATASIZE - + Op.CALLDATACOPY(dest_offset=Op.DUP5, offset=Op.DUP3, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.SHA3 - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x46D] - + Op.DUP2 - + Op.JUMPDEST - + Op.AND(Op.CALLER, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SLOAD(key=Op.SHA3(offset=Op.DUP2, size=0x40)) - + Op.DUP2 - + Op.DUP1 * 2 - + Op.JUMPI(pc=0x58F, condition=Op.ISZERO(Op.EQ(Op.DUP2, Op.DUP4))) - + Op.JUMP(pc=0x586) - + Op.JUMPDEST - + Op.PUSH2[0x187] - + Op.CALLDATALOAD(offset=0x4) - + Op.JUMPDEST - + Op.PUSH20[0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF] - + Op.AND - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SLOAD(key=Op.SHA3(offset=Op.DUP2, size=0x40)) - + Op.GT - + Op.SWAP1 - + Op.JUMP - + Op.JUMPDEST - + Op.PUSH2[0x181] - + Op.CALLDATALOAD(offset=0x4) - + Op.PUSH1[0x40] - + Op.PUSH1[0x0] - + Op.CALLDATASIZE - + Op.CALLDATACOPY(dest_offset=Op.DUP5, offset=Op.DUP3, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.SHA3 - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x37C] - + Op.DUP2 - + Op.JUMP(pc=Op.PUSH2[0x80]) - + Op.JUMPDEST - + Op.PUSH2[0x181] - + Op.CALLDATALOAD(offset=0x4) - + Op.AND(Op.CALLER, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SLOAD(key=Op.SHA3(offset=Op.DUP2, size=0x40)) - + Op.SWAP1 - + Op.DUP1 * 2 - + Op.JUMPI(pc=0x191, condition=Op.ISZERO(Op.EQ(Op.DUP2, Op.DUP4))) - + Op.JUMP(pc=0x213) - + Op.JUMPDEST - + Op.PUSH2[0x181] - + Op.CALLDATALOAD(offset=0x4) - + Op.PUSH1[0x40] - + Op.PUSH1[0x0] - + Op.CALLDATASIZE - + Op.CALLDATACOPY(dest_offset=Op.DUP5, offset=Op.DUP3, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.SHA3 - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x533] - + Op.DUP2 - + Op.JUMP(pc=Op.PUSH2[0x80]) - + Op.JUMPDEST - + Op.PUSH2[0x181] - + Op.CALLDATALOAD(offset=0x4) - + Op.CALLDATALOAD(offset=0x24) - + Op.PUSH1[0x0] - + Op.PUSH1[0x40] - + Op.PUSH1[0x0] - + Op.CALLDATASIZE - + Op.CALLDATACOPY(dest_offset=Op.DUP5, offset=Op.DUP3, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.SHA3 - + Op.SWAP1 - + Op.POP - + Op.PUSH2[0x286] - + Op.DUP2 - + Op.JUMP(pc=Op.PUSH2[0x80]) - + Op.JUMPDEST - + Op.RETURN(offset=0x0, size=0x0) - + Op.JUMPDEST - + Op.MSTORE(offset=0x0, value=Op.DUP1) - + Op.RETURN(offset=0x0, size=0x20) - + Op.JUMPDEST - + Op.POP * 3 - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP3) - + Op.MSTORE(offset=0x20, value=0x103) - + Op.SHA3(offset=Op.DUP2, size=0x40) - + Op.SLOAD(key=Op.ADD(Op.DUP2, 0x1)) - + Op.PUSH1[0x2] - + Op.DUP5 - + Op.SWAP1 - + Op.EXP - + Op.SWAP3 - + Op.SWAP1 - + Op.DUP4 - + Op.AND - + Op.DUP2 - + Op.SWAP1 - + Op.JUMPI(pc=0x213, condition=Op.ISZERO(Op.GT)) - + Op.SLOAD(key=Op.DUP2) - + Op.PUSH1[0x1] - + Op.ADD(Op.DUP5, Op.DUP1) - + Op.SLOAD(key=Op.DUP1) - + Op.SWAP2 - + Op.SWAP1 - + Op.SWAP3 - + Op.SSTORE(key=Op.DUP5, value=Op.ADD) - + Op.DUP5 - + Op.SWAP1 - + Op.SUB - + Op.SWAP1 - + Op.SSTORE - + Op.AND(Op.CALLER, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x40] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.PUSH1[0x60] - + Op.DUP7 - + Op.SWAP1 - + Op.MSTORE - + Op.PUSH32[ - 0xC7FB647E59B18047309AA15AAD418E5D7CA96D173AD704F1031A2C3D7591734B - ] - + Op.SWAP1 - + Op.DUP1 - + Op.LOG1 - + Op.JUMPDEST - + Op.POP * 5 - + Op.JUMP - + Op.JUMPDEST - + Op.ADD - + Op.SSTORE - + Op.PUSH20[0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF] - + Op.AND(Op.DUP2, Op.DUP5) - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.MSTORE(offset=0x20, value=0x102) - + Op.PUSH1[0x40] - + Op.SHA3(offset=Op.DUP3, size=Op.DUP1) - + Op.DUP3 - + Op.SWAP1 - + Op.SSTORE - + Op.SWAP3 - + Op.DUP7 - + Op.AND - + Op.MSTORE(offset=Op.DUP3, value=Op.DUP1) - + Op.SWAP1 - + Op.DUP4 - + Op.SWAP1 - + Op.SHA3 - + Op.DUP6 - + Op.SWAP1 - + Op.SSTORE - + Op.SWAP1 - + Op.DUP3 - + Op.MSTORE - + Op.PUSH1[0x60] - + Op.MSTORE - + Op.PUSH32[ - 0xB532073B38C83145E3E5135377A08BF9AAB55BC0FD7C1179CD4FB995D2A5159C - ] - + Op.SWAP1 - + Op.DUP1 - + Op.LOG1 - + Op.JUMPDEST - + Op.POP - + Op.JUMPDEST - + Op.POP * 3 - + Op.JUMP - + Op.JUMPDEST - + Op.JUMPI(pc=0x27F, condition=Op.ISZERO) - + Op.PUSH2[0x294] - + Op.DUP4 - + Op.JUMP(pc=Op.PUSH2[0xBE]) - + Op.JUMPDEST - + Op.JUMPI(pc=0x29F, condition=Op.ISZERO) - + Op.POP - + Op.JUMP(pc=0x281) - + Op.JUMPDEST - + Op.AND(Op.DUP5, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SLOAD(key=Op.SHA3(offset=Op.DUP2, size=0x40)) - + Op.SWAP3 - + Op.POP - + Op.DUP3 - + Op.JUMPI(pc=0x2D5, condition=Op.ISZERO(Op.EQ)) - + Op.POP - + Op.JUMP(pc=0x281) - + Op.JUMPDEST - + Op.PUSH2[0x2F7] - + Op.JUMPDEST - + Op.SLOAD(key=0x104) - + Op.PUSH1[0x0] - + Op.JUMPDEST - + Op.JUMPI(pc=0x80C, condition=Op.ISZERO(Op.LT(Op.DUP2, Op.DUP2))) - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.DUP3 - + Op.SWAP1 - + Op.DUP2 - + Op.JUMPI(pc=0x854, condition=Op.LT) - + Op.STOP - + Op.JUMPDEST - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x2] - + Op.DUP4 - + Op.JUMPI(pc=0x21A, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ADD - + Op.SSTORE - + Op.SLOAD(key=0x1) - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP2) - + Op.PUSH2[0x102] - + Op.PUSH1[0x20] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.PUSH1[0x40] - + Op.SWAP2 - + Op.DUP3 - + Op.SWAP1 - + Op.SHA3 - + Op.SWAP4 - + Op.SWAP1 - + Op.SWAP4 - + Op.SSTORE - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.PUSH32[ - 0x994A936646FE87FFE4F1E469D3D6AA417D6B855598397F323DE5B449F765F0C3 - ] - + Op.SWAP2 - + Op.SWAP1 - + Op.LOG1 - + Op.JUMPDEST - + Op.POP - + Op.JUMPDEST - + Op.POP - + Op.JUMP - + Op.JUMPDEST - + Op.JUMPI(pc=0x377, condition=Op.ISZERO) - + Op.PUSH2[0x38A] - + Op.DUP3 - + Op.JUMP(pc=Op.PUSH2[0xBE]) - + Op.JUMPDEST - + Op.JUMPI(pc=0x395, condition=Op.ISZERO) - + Op.POP - + Op.JUMP(pc=0x379) - + Op.JUMPDEST - + Op.PUSH2[0x39D] - + Op.JUMP(pc=0x2D9) - + Op.JUMPDEST - + Op.SLOAD(key=0x1) - + Op.PUSH1[0xFA] - + Op.SWAP1 - + Op.JUMPI(pc=0x3B4, condition=Op.ISZERO(Op.ISZERO(Op.LT))) - + Op.PUSH2[0x3B2] - + Op.JUMP(pc=0x3CB) - + Op.JUMPDEST - + Op.POP - + Op.JUMPDEST - + Op.SLOAD(key=0x1) - + Op.PUSH1[0xFA] - + Op.SWAP1 - + Op.JUMPI(pc=0x3F5, condition=Op.ISZERO(Op.ISZERO(Op.LT))) - + Op.POP - + Op.JUMP(pc=0x379) - + Op.JUMPDEST - + Op.PUSH2[0x425] - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.PUSH1[0x1] - + Op.JUMPDEST - + Op.JUMPI( - pc=0x6F7, condition=Op.ISZERO(Op.LT(Op.DUP2, Op.SLOAD(key=0x1))) - ) - + Op.JUMPDEST - + Op.LT(Op.DUP2, Op.SLOAD(key=0x1)) - + Op.JUMPI(pc=0x753, condition=Op.ISZERO(Op.DUP1)) - + Op.POP - + Op.PUSH1[0x2] - + Op.DUP2 - + Op.JUMPI(pc=0x74C, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.PUSH1[0x1] - + Op.ADD(Op.DUP2, Op.SLOAD(key=Op.DUP1)) - + Op.SWAP1 - + Op.DUP2 - + Op.SWAP1 - + Op.SSTORE - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.SWAP1 - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.JUMPI(pc=0x31C, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.POP - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x40] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.PUSH32[ - 0x58619076ADF5BB0943D100EF88D52D7C3FD691B19D3A9071B555B651FBF418DA - ] - + Op.SWAP1 - + Op.PUSH1[0x20] - + Op.SWAP1 - + Op.LOG1 - + Op.POP * 3 - + Op.JUMP - + Op.JUMPDEST - + Op.JUMPI(pc=0x281, condition=Op.ISZERO) - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SLOAD(key=Op.SHA3(offset=Op.DUP2, size=0x40)) - + Op.SWAP3 - + Op.POP - + Op.DUP3 - + Op.JUMPI(pc=0x4A8, condition=Op.ISZERO(Op.EQ)) - + Op.POP - + Op.JUMP(pc=0x377) - + Op.JUMPDEST - + Op.PUSH1[0x1] * 2 - + Op.POP(0x0) - + Op.SLOAD - + Op.SUB - + Op.PUSH1[0x0] - + Op.POP(0x0) - + Op.SLOAD - + Op.JUMPI(pc=0x4C3, condition=Op.ISZERO(Op.GT)) - + Op.POP - + Op.JUMP(pc=0x377) - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.PUSH1[0x2] - + Op.DUP4 - + Op.JUMPI(pc=0x4D3, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ADD - + Op.SSTORE - + Op.AND(Op.DUP4, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.MSTORE(offset=0x20, value=0x102) - + Op.SHA3(offset=Op.DUP2, size=0x40) - + Op.SSTORE - + Op.PUSH2[0x3C7] - + Op.JUMP(pc=0x2D9) - + Op.JUMPDEST - + Op.PUSH1[0x40] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP3) - + Op.PUSH32[ - 0xACBDB084C721332AC59F9B8E392196C9EB0E4932862DA8EB9BEAF0DAD4F550DA - ] - + Op.SWAP1 - + Op.PUSH1[0x20] - + Op.SWAP1 - + Op.LOG1 - + Op.POP * 2 - + Op.JUMP - + Op.JUMPDEST - + Op.JUMPI(pc=0x377, condition=Op.ISZERO) - + Op.JUMPI( - pc=0x548, condition=Op.ISZERO(Op.GT(Op.DUP3, Op.SLOAD(key=0x1))) - ) - + Op.POP - + Op.JUMP(pc=0x379) - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.DUP3 - + Op.SWAP1 - + Op.SSTORE - + Op.PUSH2[0x504] - + Op.JUMP(pc=0x2D9) - + Op.JUMPDEST - + Op.SSTORE( - key=Op.DUP4, - value=Op.ADD( - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, # noqa: E501 - Op.SLOAD(key=Op.DUP3), - ), - ) - + Op.ADD(Op.DUP4, 0x1) - + Op.OR(Op.DUP3, Op.SLOAD(key=Op.DUP1)) - + Op.SWAP1 - + Op.SSTORE - + Op.JUMPDEST - + Op.POP * 4 - + Op.SWAP2 - + Op.SWAP1 - + Op.POP - + Op.JUMP - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP7) - + Op.MSTORE(offset=0x20, value=0x103) - + Op.SHA3(offset=Op.DUP2, size=0x40) - + Op.SLOAD(key=Op.DUP1) - + Op.SWAP1 - + Op.SWAP5 - + Op.POP - + Op.SWAP1 - + Op.SWAP3 - + Op.POP - + Op.DUP3 - + Op.JUMPI(pc=0x61A, condition=Op.ISZERO(Op.EQ)) - + Op.SSTORE(key=Op.DUP4, value=Op.SLOAD(key=Op.DUP2)) - + Op.PUSH1[0x1] - + Op.ADD(Op.DUP2, Op.DUP4) - + Op.DUP4 - + Op.SWAP1 - + Op.SSTORE - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.SWAP2 - + Op.DUP3 - + Op.ADD - + Op.SSTORE(key=Op.DUP3, value=Op.DUP1) - + Op.DUP3 - + Op.ISZERO(Op.DUP1) - + Op.DUP3 - + Op.SWAP1 - + Op.JUMPI(pc=0x6A6, condition=Op.GT) - + Op.MSTORE(offset=Op.DUP7, value=Op.DUP3) - + Op.PUSH32[ - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE - ] - + Op.SWAP1 - + Op.DUP2 - + Op.ADD - + Op.SWAP1 - + Op.DUP3 - + Op.ADD - + Op.JUMPDEST - + Op.JUMPI(pc=0x6A4, condition=Op.ISZERO(Op.GT(Op.DUP3, Op.DUP1))) - + Op.SSTORE(key=Op.DUP2, value=0x0) - + Op.PUSH1[0x1] - + Op.ADD - + Op.JUMP(pc=0x5F9) - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.DUP3 - + Op.MSTORE - + Op.PUSH1[0x20] - + Op.SWAP1 - + Op.SWAP2 - + Op.SSTORE(key=Op.ADD, value=Op.SHA3) - + Op.JUMPDEST - + Op.POP - + Op.SLOAD(key=Op.ADD(Op.DUP3, 0x1)) - + Op.PUSH1[0x2] - + Op.DUP5 - + Op.SWAP1 - + Op.EXP - + Op.SWAP1 - + Op.DUP2 - + Op.JUMPI(pc=0x586, condition=Op.ISZERO(Op.EQ(0x0, Op.AND))) - + Op.AND(Op.CALLER, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) - + Op.PUSH1[0x40] - + Op.SWAP1 - + Op.DUP2 - + Op.MSTORE - + Op.PUSH1[0x60] - + Op.DUP8 - + Op.SWAP1 - + Op.MSTORE - + Op.PUSH32[ - 0xE1C52DC63B719ADE82E8BEA94CC41A0D5D28E4AAF536ADB5E9CCCC9FF8C1AEDA - ] - + Op.SWAP1 - + Op.DUP1 - + Op.LOG1 - + Op.SLOAD(key=Op.DUP3) - + Op.PUSH1[0x1] - + Op.SWAP1 - + Op.JUMPI(pc=0x555, condition=Op.ISZERO(Op.ISZERO(Op.GT))) - + Op.PUSH1[0x0] - + Op.MSTORE(offset=Op.DUP2, value=Op.DUP7) - + Op.MSTORE(offset=0x20, value=0x103) - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.PUSH1[0x40] - + Op.SWAP1 - + Op.SWAP3 - + Op.SLOAD(key=Op.ADD(0x2, Op.SHA3)) - + Op.SWAP1 - + Op.SWAP2 - + Op.DUP2 - + Op.JUMPI(pc=0x6C0, condition=Op.LT) - + Op.STOP - + Op.JUMPDEST - + Op.POP - + Op.JUMPDEST - + Op.POP * 3 - + Op.ADD(Op.DUP5, 0x2) - + Op.DUP2 - + Op.SWAP1 - + Op.SSTORE - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.DUP9 - + Op.SWAP3 - + Op.SWAP1 - + Op.DUP2 - + Op.JUMPI(pc=0x60D, condition=Op.LT) - + Op.STOP - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.DUP3 - + Op.MSTORE - + Op.PUSH1[0x20] - + Op.SHA3(offset=Op.DUP4, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.ADD - + Op.DUP3 - + Op.SWAP1 - + Op.SSTORE - + Op.MSTORE(offset=Op.DUP3, value=Op.DUP8) - + Op.PUSH2[0x103] - + Op.SWAP1 - + Op.MSTORE - + Op.SHA3(offset=Op.DUP2, size=0x40) - + Op.SSTORE(key=Op.DUP2, value=Op.DUP2) - + Op.PUSH1[0x1] - + Op.ADD(Op.DUP2, Op.DUP2) - + Op.DUP4 - + Op.SWAP1 - + Op.SSTORE - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.SWAP2 - + Op.ADD - + Op.SWAP2 - + Op.SWAP1 - + Op.SWAP2 - + Op.SSTORE - + Op.SWAP5 - + Op.POP - + Op.JUMP(pc=0x586) - + Op.JUMPDEST - + Op.POP - + Op.SWAP1 - + Op.JUMP - + Op.JUMPDEST - + Op.EQ(0x0, Op.SLOAD(key=Op.ADD)) - + Op.JUMPDEST - + Op.JUMPI(pc=0x760, condition=Op.ISZERO) - + Op.PUSH1[0x1] - + Op.ADD( - 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, - Op.SLOAD(key=Op.DUP1), - ) - + Op.SWAP1 - + Op.SSTORE - + Op.JUMPDEST - + Op.GT(Op.SLOAD(key=Op.DUP1), 0x1) - + Op.JUMPI(pc=0x701, condition=Op.ISZERO(Op.DUP1)) - + Op.POP - + Op.SLOAD(key=0x1) - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.JUMPI(pc=0x6FB, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ISZERO(Op.EQ(0x0, Op.SLOAD(key=Op.ADD))) - + Op.JUMPDEST - + Op.JUMPI(pc=0x72F, condition=Op.ISZERO) - + Op.PUSH1[0x1] - + Op.ADD - + Op.JUMP(pc=0x3DB) - + Op.JUMPDEST - + Op.LT(Op.DUP2, Op.SLOAD(key=0x1)) - + Op.JUMPI(pc=0x784, condition=Op.ISZERO(Op.DUP1)) - + Op.POP - + Op.SLOAD(key=0x1) - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.JUMPI(pc=0x77D, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ISZERO(Op.EQ(0x0, Op.SLOAD(key=Op.ADD))) - + Op.JUMPDEST - + Op.JUMPI(pc=0x79F, condition=Op.ISZERO(Op.DUP1)) - + Op.POP - + Op.PUSH1[0x2] - + Op.DUP2 - + Op.JUMPI(pc=0x799, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.EQ(0x0, Op.SLOAD(key=Op.ADD)) - + Op.JUMPDEST - + Op.JUMPI(pc=0x7B8, condition=Op.ISZERO) - + Op.SLOAD(key=0x1) - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.JUMPI(pc=0x7BD, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ADD - + Op.SSTORE - + Op.JUMPDEST - + Op.JUMP(pc=0x3D0) - + Op.JUMPDEST - + Op.SLOAD(key=Op.ADD) - + Op.PUSH1[0x2] - + Op.DUP3 - + Op.JUMPI(pc=0x7CD, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.ADD - + Op.SSTORE - + Op.DUP1 - + Op.PUSH2[0x102] - + Op.PUSH1[0x0] - + Op.PUSH1[0x2] - + Op.DUP4 - + Op.JUMPI(pc=0x7E3, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.MSTORE(offset=Op.DUP2, value=Op.SLOAD(key=Op.ADD)) - + Op.ADD(Op.DUP2, 0x20) - + Op.SWAP2 - + Op.SWAP1 - + Op.SWAP2 - + Op.MSTORE - + Op.PUSH1[0x40] - + Op.ADD - + Op.PUSH1[0x0] - + Op.SWAP1 - + Op.DUP2 - + Op.SHA3 - + Op.SWAP2 - + Op.SWAP1 - + Op.SWAP2 - + Op.SSTORE - + Op.SLOAD(key=0x1) - + Op.PUSH1[0x2] - + Op.SWAP1 - + Op.JUMPI(pc=0x7B5, condition=Op.LT(Op.DUP2, 0x100)) - + Op.STOP - + Op.JUMPDEST - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.PUSH1[0x0] - + Op.SSTORE(key=Op.DUP4, value=Op.DUP1) - + Op.SWAP2 - + Op.SWAP1 - + Op.SWAP2 - + Op.MSTORE - + Op.PUSH32[ - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE - ] - + Op.SWAP1 - + Op.DUP2 - + Op.ADD - + Op.SWAP1 - + Op.JUMPDEST - + Op.JUMPI(pc=0x27F, condition=Op.ISZERO(Op.GT(Op.DUP3, Op.DUP1))) - + Op.SSTORE(key=Op.DUP2, value=0x0) - + Op.PUSH1[0x1] - + Op.ADD - + Op.JUMP(pc=0x840) - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.DUP3 - + Op.MSTORE - + Op.JUMPI( - pc=0x8A6, - condition=Op.ISZERO( - Op.ISZERO( - Op.EQ( - Op.SLOAD(key=Op.ADD), - Op.SHA3(offset=Op.DUP3, size=0x20), - ) - ) - ), - ) - + Op.PUSH2[0x104] - + Op.SLOAD(key=Op.DUP1) - + Op.PUSH2[0x103] - + Op.SWAP2 - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.DUP5 - + Op.SWAP1 - + Op.DUP2 - + Op.JUMPI(pc=0x87C, condition=Op.LT) - + Op.STOP - + Op.JUMPDEST - + Op.PUSH1[0x0] - + Op.SWAP2 - + Op.DUP3 - + Op.MSTORE - + Op.PUSH1[0x20] - + Op.SHA3(offset=Op.DUP4, size=Op.DUP1) - + Op.SWAP1 - + Op.SWAP2 - + Op.MSTORE(offset=Op.DUP4, value=Op.SLOAD(key=Op.ADD)) - + Op.DUP3 - + Op.ADD - + Op.SWAP3 - + Op.SWAP1 - + Op.SWAP3 - + Op.MSTORE - + Op.PUSH1[0x40] - + Op.SHA3(offset=Op.DUP2, size=Op.ADD) - + Op.SSTORE(key=Op.DUP2, value=Op.DUP2) - + Op.ADD(Op.DUP2, 0x1) - + Op.DUP3 - + Op.SWAP1 - + Op.SSTORE - + Op.SSTORE(key=Op.ADD, value=0x2) - + Op.JUMPDEST - + Op.PUSH1[0x1] - + Op.ADD - + Op.JUMP(pc=0x2E0), - storage={ - 0: 1, - 1: 2, - 3: sender, - 4: 0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("173825d9") + Hash(sender, left_padding=True), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: 0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 1, # noqa: E501 - }, - code=bytes.fromhex( - "7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_by_non_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_by_non_owner.py deleted file mode 100644 index 7c0f87348dd..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_by_non_owner.py +++ /dev/null @@ -1,80 +0,0 @@ -""" -Test_multi_owned_remove_owner_by_non_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedRemoveOwnerByNonOwnerFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedRemoveOwnerByNonOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -def test_multi_owned_remove_owner_by_non_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_remove_owner_by_non_owner.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F) - - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0_code = bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - # Source: hex - # 0x - contract_1 = pre.deploy_contract(code="", balance=0xDE0B6B3A75EF08F) - # m_ownerIndex[contract_1] is at keccak256(contract_1 ++ 0x102). - owner_index_slot = Bytes( - Hash(contract_1, left_padding=True) + Hash(0x102) - ).keccak256() - contract_0 = pre.deploy_contract( - code=contract_0_code, - storage={ - 0: 1, - 1: 1, - 3: contract_1, - owner_index_slot: 1, - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("173825d9") + Hash(contract_1, left_padding=True), - gas_limit=10000000, - value=100, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: contract_1, - owner_index_slot: 1, - }, - code=contract_0_code, - balance=200, - nonce=1, - ), - contract_1: Account(storage={}, nonce=1), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_my_self.py b/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_my_self.py deleted file mode 100644 index c71db42578f..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_my_self.py +++ /dev/null @@ -1,95 +0,0 @@ -""" -Test_multi_owned_remove_owner_my_self. - -Ported from: -state_tests/stWalletTest/multiOwnedRemoveOwner_mySelfFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedRemoveOwner_mySelfFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_remove_owner_my_self( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_remove_owner_my_self.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("173825d9") + Hash(sender, left_padding=True), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_owner_is_not_owner.py b/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_owner_is_not_owner.py deleted file mode 100644 index 1462457ee5d..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_remove_owner_owner_is_not_owner.py +++ /dev/null @@ -1,98 +0,0 @@ -""" -Test_multi_owned_remove_owner_owner_is_not_owner. - -Ported from: -state_tests/stWalletTest/multiOwnedRemoveOwner_ownerIsNotOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/multiOwnedRemoveOwner_ownerIsNotOwnerFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_remove_owner_owner_is_not_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_remove_owner_owner_is_not_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("173825d9") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_multi_owned_revoke_nothing.py b/tests/ported_static/stWalletTest/test_multi_owned_revoke_nothing.py deleted file mode 100644 index 35e97313538..00000000000 --- a/tests/ported_static/stWalletTest/test_multi_owned_revoke_nothing.py +++ /dev/null @@ -1,97 +0,0 @@ -""" -Test_multi_owned_revoke_nothing. - -Ported from: -state_tests/stWalletTest/multiOwnedRevokeNothingFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/multiOwnedRevokeNothingFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_multi_owned_revoke_nothing( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_multi_owned_revoke_nothing.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0x6295EE1B4F6DD65047762F924ECD367C17EABF8F), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b75c7dc6") - + Hash( - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D - ), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c917114610136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a3578063f00d4b5d146101e3575b005b610077600435600060003643604051808484808284375050509091019081526040519081900360200190209050610529815b600160a060020a033316600090815261010260205260408120548180808381141561066f57610806565b61021c6004355b600160a060020a0316600090815261010260205260408120541190565b61021c60015481565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506104a1816100ab565b61021c60005481565b610077600435600160a060020a033316600090815261010260205260408120549080808381141561022e576102b0565b610077600435600036436040518084848082843750505090910190815260405190819003602001902090506105e8816100ab565b61021c600435602435600082815261010360209081526040808320600160a060020a03851684526101029092528220548290818181141561064157610665565b61007760043560243560006000364360405180848480828437505050909101908152604051908190036020019020905061033a816100ab565b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a92908316819011156102b05781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a038316600283610100811015610002570155600160a060020a0384811660008181526101026020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b1561033357610348836100dc565b156103535750610335565b600160a060020a03841660009081526101026020526040812054925082141561037c5750610335565b6102b75b6101045460005b818110156107b557610104805482908110156100025760009182526000805160206108ea8339815191520154146103fa576101048054610103916000918490811015610002576000805160206108ea83398151915201548252506020919091526040812081815560018101829055600201555b600101610387565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a65b600060015b6001548110156107ef575b6001548110801561051c5750600281610100811015610002570154600014155b1561080f576001016104fc565b1561033557600160a060020a038316600090815261010260205260408120549250821415610557575061049c565b6001600160005054036000600050541115610572575061049c565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556104e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b1561049c576001548211156105fd575061049e565b600082905561060a610380565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156106605760009450610665565b600194505b5050505092915050565b60008681526101036020526040812080549094509092508214156106f85781548355600183810183905561010480549182018082558280158290116106c7578183600052602060002091820191016106c791906107db565b505050600284018190556101048054889290811015610002576000919091526000805160206108ea83398151915201555b506001820154600284900a908116600014156108065760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18254600190116107f35760008681526101036020526040902060020154610104805490919081101561000257604060009081206000805160206108ea83398151915292909201819055808255600180830182905560029092015595506108069050565b6101048054600080835591909152610335906000805160206108ea833981519152908101905b808211156107ef57600081556001016107db565b5090565b8254600019018355600183018054821790555b50505050919050565b5b6001805411801561083257506001546002906101008110156100025701546000145b156108465760018054600019019055610810565b600154811080156108695750600154600290610100811015610002570154600014155b801561088357506002816101008110156100025701546000145b156108e457600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=200, - nonce=0, - ), - sender: Account(storage={}, nonce=2), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet.py b/tests/ported_static/stWalletTest/test_wallet.py new file mode 100644 index 00000000000..d40c160b22e --- /dev/null +++ b/tests/ported_static/stWalletTest/test_wallet.py @@ -0,0 +1,259 @@ +""" +Call the `Wallet` contract: pending confirmations, execution and kill. + +Ported from: +state_tests/stWalletTest/walletAddOwnerRemovePendingTransactionFiller.json +state_tests/stWalletTest/walletChangeOwnerRemovePendingTransactionFiller.json +state_tests/stWalletTest/walletChangeRequirementRemovePendingTransactionFiller.json +state_tests/stWalletTest/walletConfirmFiller.json +state_tests/stWalletTest/walletDefaultFiller.json +state_tests/stWalletTest/walletDefaultWithOutValueFiller.json +state_tests/stWalletTest/walletExecuteOverDailyLimitMultiOwnerFiller.json +state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerFiller.json +state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerNewFiller.json +state_tests/stWalletTest/walletExecuteUnderDailyLimitFiller.json +state_tests/stWalletTest/walletKillFiller.json +state_tests/stWalletTest/walletKillNotByOwnerFiller.json +state_tests/stWalletTest/walletKillToWalletFiller.json +state_tests/stWalletTest/walletRemoveOwnerRemovePendingTransactionFiller.json + +@manually-enhanced: Do not overwrite. Merged; fixed the vacuous cases. +""" + +from typing import Dict + +import pytest +from execution_testing import ( + Account, + Address, + Alloc, + Bytes, + Hash, + StateTestFiller, + Transaction, +) + +from tests.ported_static.stWalletTest.wallet_contracts import ( + DAILY_LIMIT_SLOT, + LAST_DAY_SLOT, + PENDING_INDEX_SLOT, + PENDING_MAP, + SPENT_TODAY_SLOT, + TRANSACTIONS_MAP, + WALLET_CODE, + mapping_slot, + owners_storage, + pending_index_element_slot, +) + +REFERENCE_SPEC_GIT_PATH = "N/A" +REFERENCE_SPEC_VERSION = "N/A" + +ADD_OWNER = Bytes("7065cb48") +CHANGE_OWNER = Bytes("f00d4b5d") +CHANGE_REQUIREMENT = Bytes("ba51a6df") +CONFIRM = Bytes("797af627") +EXECUTE = Bytes("b61d27f6") +KILL = Bytes("cbf0b0c0") +REMOVE_OWNER = Bytes("173825d9") + +WALLET_BALANCE = 100 +LAST_DAY = 0xC22E4 +PENDING_OPERATION = Hash( + 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96 +) +TRANSFER_VALUE = 9 + + +def word(value: int | Address) -> Hash: + """Return `value` as an ABI-encoded word.""" + return Hash(value, left_padding=True) + + +def pending_storage( + operation: Hash, owner_index: int, to: Address, value: int +) -> dict: + """Return the storage of an operation confirmed by one owner.""" + pending = mapping_slot(operation, PENDING_MAP) + transaction = mapping_slot(operation, TRANSACTIONS_MAP) + return { + PENDING_INDEX_SLOT: 1, + pending_index_element_slot(0): operation, + pending: 1, + pending + 1: 2**owner_index, + transaction: to, + transaction + 1: value, + } + + +def queued_transaction(operation: Hash, to: Address, value: int) -> dict: + """Return the storage of a queued transaction with no pending entry.""" + transaction = mapping_slot(operation, TRANSACTIONS_MAP) + return {PENDING_INDEX_SLOT: 1, transaction: to, transaction + 1: value} + + +@pytest.mark.ported_from( + [ + "state_tests/stWalletTest/walletAddOwnerRemovePendingTransactionFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletChangeOwnerRemovePendingTransactionFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletChangeRequirementRemovePendingTransactionFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletConfirmFiller.json", + "state_tests/stWalletTest/walletDefaultFiller.json", + "state_tests/stWalletTest/walletDefaultWithOutValueFiller.json", + "state_tests/stWalletTest/walletExecuteOverDailyLimitMultiOwnerFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerNewFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletExecuteUnderDailyLimitFiller.json", + "state_tests/stWalletTest/walletKillFiller.json", + "state_tests/stWalletTest/walletKillNotByOwnerFiller.json", + "state_tests/stWalletTest/walletKillToWalletFiller.json", + "state_tests/stWalletTest/walletRemoveOwnerRemovePendingTransactionFiller.json", # noqa: E501 + ], +) +@pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip( + reason="Expects the block number and timestamp of the test env" + ) +) +@pytest.mark.parametrize( + "scenario", + [ + "add_owner_remove_pending_transaction", + "change_owner_remove_pending_transaction", + "change_requirement_remove_pending_transaction", + "confirm", + "remove_owner_remove_pending_transaction", + "default", + "default_with_out_value", + "execute_over_daily_limit_multi_owner", + "execute_over_daily_limit_only_one_owner", + "execute_over_daily_limit_only_one_owner_new", + "execute_under_daily_limit", + "kill", + "kill_not_by_owner", + "kill_to_wallet", + ], +) +def test_wallet( + state_test: StateTestFiller, + pre: Alloc, + scenario: str, +) -> None: + """Call one `Wallet` function from the sender.""" + sender = pre.fund_eoa() + other_owner = pre.nonexistent_account() + new_owner = pre.nonexistent_account() + recipient = pre.nonexistent_account() + + execute = EXECUTE + word(recipient) + word(TRANSFER_VALUE) + word(0x60) + execute_operation = Bytes(execute + word(1)).keccak256() + single_owner = owners_storage(1, [sender]) + pending = ( + owners_storage(1, [other_owner, sender]) + | {LAST_DAY_SLOT: LAST_DAY} + | pending_storage(PENDING_OPERATION, 1, recipient, TRANSFER_VALUE) + ) + + data = b"" + value = 0 + transferred = 0 + wallet_balance_change = 0 + post: Dict[Address, Account | None] = {} + + if scenario == "add_owner_remove_pending_transaction": + storage = pending + data = ADD_OWNER + word(new_owner) + post_storage = owners_storage(1, [other_owner, sender, new_owner]) | { + LAST_DAY_SLOT: LAST_DAY + } + elif scenario == "change_owner_remove_pending_transaction": + storage = pending + data = CHANGE_OWNER + word(other_owner) + word(new_owner) + post_storage = owners_storage(1, [new_owner, sender]) | { + LAST_DAY_SLOT: LAST_DAY + } + elif scenario == "change_requirement_remove_pending_transaction": + storage = pending + data = CHANGE_REQUIREMENT + word(2) + post_storage = owners_storage(2, [other_owner, sender]) | { + LAST_DAY_SLOT: LAST_DAY + } + elif scenario == "confirm": + storage = pending | {0: 2} + data = CONFIRM + PENDING_OPERATION + post_storage = owners_storage(2, [other_owner, sender]) | { + LAST_DAY_SLOT: LAST_DAY, + PENDING_INDEX_SLOT: 1, + } + transferred = TRANSFER_VALUE + elif scenario == "remove_owner_remove_pending_transaction": + storage = pending + data = REMOVE_OWNER + word(other_owner) + post_storage = owners_storage(1, [sender]) | {LAST_DAY_SLOT: LAST_DAY} + elif scenario in ("default", "default_with_out_value"): + storage = single_owner + post_storage = storage + if scenario == "default": + value = WALLET_BALANCE + wallet_balance_change = value + elif scenario == "execute_over_daily_limit_multi_owner": + storage = owners_storage(2, [sender, other_owner]) + data = execute + post_storage = storage | pending_storage( + execute_operation, 1, recipient, TRANSFER_VALUE + ) + elif scenario == "execute_over_daily_limit_only_one_owner": + storage = single_owner | {DAILY_LIMIT_SLOT: 4} + data = execute + post_storage = storage | queued_transaction( + execute_operation, recipient, TRANSFER_VALUE + ) + elif scenario == "execute_over_daily_limit_only_one_owner_new": + storage = single_owner | {SPENT_TODAY_SLOT: 4, LAST_DAY_SLOT: LAST_DAY} + data = execute + post_storage = storage | queued_transaction( + execute_operation, recipient, TRANSFER_VALUE + ) + elif scenario == "execute_under_daily_limit": + storage = single_owner | { + DAILY_LIMIT_SLOT: 255, + LAST_DAY_SLOT: LAST_DAY, + } + data = execute + post_storage = storage | {SPENT_TODAY_SLOT: TRANSFER_VALUE} + transferred = TRANSFER_VALUE + elif scenario == "kill": + storage = single_owner + data = KILL + word(sender) + post_storage = storage | {PENDING_INDEX_SLOT: 1} + wallet_balance_change = -WALLET_BALANCE + elif scenario == "kill_not_by_owner": + storage = owners_storage(1, [other_owner]) + data = KILL + word(recipient) + post_storage = storage + value = WALLET_BALANCE + wallet_balance_change = value + elif scenario == "kill_to_wallet": + storage = single_owner + post_storage = storage | {PENDING_INDEX_SLOT: 1} + else: + raise ValueError(f"Unknown scenario: {scenario}") + + wallet = pre.deploy_contract( + code=WALLET_CODE, storage=storage, balance=WALLET_BALANCE + ) + if scenario == "kill_to_wallet": + data = KILL + word(wallet) + + if transferred: + post[recipient] = Account(balance=transferred) + wallet_balance_change = -transferred + else: + post[recipient] = Account.NONEXISTENT + post[wallet] = Account( + storage=post_storage, balance_change=wallet_balance_change + ) + + tx = Transaction(sender=sender, to=wallet, data=data, value=value) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_add_owner_remove_pending_transaction.py b/tests/ported_static/stWalletTest/test_wallet_add_owner_remove_pending_transaction.py deleted file mode 100644 index ac91046d380..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_add_owner_remove_pending_transaction.py +++ /dev/null @@ -1,119 +0,0 @@ -""" -Test_wallet_add_owner_remove_pending_transaction. - -Ported from: -state_tests/stWalletTest/walletAddOwnerRemovePendingTransactionFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletAddOwnerRemovePendingTransactionFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_add_owner_remove_pending_transaction( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_add_owner_remove_pending_transaction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - contract_1 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0xA95DEFE70EBEA7804F9C3BE42D20D24375E2A92B9D9666B832069C5F3CD423DD - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0x5AF3107A4000) - # Source: hex - # 0x - contract_0 = pre.deploy_contract( # noqa: F841 - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - address=Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B), # noqa: E501 - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB2: 1, # noqa: E501 - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB3: 2, # noqa: E501 - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D0: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D1: 9, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("7065cb48") - + Hash(0xBBB1CD2CD96C6D5C0B5EB3322D807B34482481D4), - gas_limit=10000000, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account(storage={}, nonce=1), - contract_1: Account( - storage={ - 0: 1, - 1: 3, - 3: contract_0, - 4: sender, - 5: 0xBBB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 263: 0xC22E4, - 0x3412A0F379BAD2D2F891E4DB16A42D964DD63A031E22596F10B4DAB2AAA1D252: 3, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_change_owner_remove_pending_transaction.py b/tests/ported_static/stWalletTest/test_wallet_change_owner_remove_pending_transaction.py deleted file mode 100644 index a3f01e84bbb..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_change_owner_remove_pending_transaction.py +++ /dev/null @@ -1,118 +0,0 @@ -""" -Test_wallet_change_owner_remove_pending_transaction. - -Ported from: -state_tests/stWalletTest/walletChangeOwnerRemovePendingTransactionFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletChangeOwnerRemovePendingTransactionFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_change_owner_remove_pending_transaction( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_change_owner_remove_pending_transaction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - contract_1 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0xA95DEFE70EBEA7804F9C3BE42D20D24375E2A92B9D9666B832069C5F3CD423DD - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0x5AF3107A4000) - # Source: hex - # 0x - contract_0 = pre.deploy_contract( # noqa: F841 - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - address=Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B), # noqa: E501 - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB2: 1, # noqa: E501 - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB3: 2, # noqa: E501 - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D0: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D1: 9, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("f00d4b5d") - + Hash(contract_0, left_padding=True) - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account(storage={}, nonce=1), - contract_1: Account( - storage={ - 0: 1, - 1: 2, - 3: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, - 4: sender, - 263: 0xC22E4, - 0x62CE4F671906BE9A217487BB98E428B08E12100FB0007DF10572CA00206E7D73: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_change_requirement_remove_pending_transaction.py b/tests/ported_static/stWalletTest/test_wallet_change_requirement_remove_pending_transaction.py deleted file mode 100644 index 86a14063092..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_change_requirement_remove_pending_transaction.py +++ /dev/null @@ -1,116 +0,0 @@ -""" -Test_wallet_change_requirement_remove_pending_transaction. - -Ported from: -state_tests/stWalletTest/walletChangeRequirementRemovePendingTransactionFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletChangeRequirementRemovePendingTransactionFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_change_requirement_remove_pending_transaction( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_change_requirement_remove_pending_transaction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - contract_1 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0xA95DEFE70EBEA7804F9C3BE42D20D24375E2A92B9D9666B832069C5F3CD423DD - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0x5AF3107A4000) - # Source: hex - # 0x - contract_0 = pre.deploy_contract( # noqa: F841 - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - address=Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B), # noqa: E501 - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB2: 1, # noqa: E501 - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB3: 2, # noqa: E501 - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D0: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D1: 9, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("ba51a6df") + Hash(0x2), - gas_limit=10000000, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account(storage={}, nonce=1), - contract_1: Account( - storage={ - 0: 2, - 1: 2, - 3: contract_0, - 4: sender, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_confirm.py b/tests/ported_static/stWalletTest/test_wallet_confirm.py deleted file mode 100644 index addf5a88ad6..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_confirm.py +++ /dev/null @@ -1,121 +0,0 @@ -""" -Test_wallet_confirm. - -Ported from: -state_tests/stWalletTest/walletConfirmFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletConfirmFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_confirm( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_confirm.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - contract_1 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0xA95DEFE70EBEA7804F9C3BE42D20D24375E2A92B9D9666B832069C5F3CD423DD - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0x5AF3107A4000) - # Source: hex - # 0x - contract_0 = pre.deploy_contract( # noqa: F841 - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - address=Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B), # noqa: E501 - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 2, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB2: 1, # noqa: E501 - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB3: 2, # noqa: E501 - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D0: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D1: 9, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("797af627") - + Hash( - 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96 - ), - gas_limit=10000000, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account(storage={}, nonce=1), - Address(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA): Account( - storage={}, code=b"", balance=9, nonce=0 - ), - contract_1: Account( - storage={ - 0: 2, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=91, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_construction.py b/tests/ported_static/stWalletTest/test_wallet_construction.py index 63ffd581365..540c74a519d 100644 --- a/tests/ported_static/stWalletTest/test_wallet_construction.py +++ b/tests/ported_static/stWalletTest/test_wallet_construction.py @@ -1,119 +1,108 @@ """ -Test_wallet_construction. +Deploy the `multiOwned`, `daylimit` and `Wallet` contracts. Ported from: +state_tests/stWalletTest/dayLimitConstructionFiller.json +state_tests/stWalletTest/dayLimitConstructionOOGFiller.json +state_tests/stWalletTest/dayLimitConstructionPartialFiller.json +state_tests/stWalletTest/multiOwnedConstructionCorrectFiller.json +state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasFiller.json +state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasPartialFiller.json state_tests/stWalletTest/walletConstructionFiller.json +state_tests/stWalletTest/walletConstructionOOGFiller.json +state_tests/stWalletTest/walletConstructionPartialFiller.json -@manually-enhanced: Do not overwrite. Both `tx_gas` values bumped for -EIP-8037 NEW_ACCOUNT state-gas headroom on Amsterdam (the test has the -same post-state for both g indexes — both are 'should succeed' paths). +@manually-enhanced: Do not overwrite. Merged; derived the gas budget. """ +from typing import Dict + import pytest from execution_testing import ( - EOA, Account, Address, Alloc, - Bytes, - Environment, StateTestFiller, Transaction, compute_create_address, ) from execution_testing.forks import Fork +from tests.ported_static.stWalletTest.wallet_contracts import ( + DAY_LIMIT_CODE, + DAY_LIMIT_CONSTRUCTOR, + MULTI_OWNED_CODE, + MULTI_OWNED_CONSTRUCTOR, + WALLET_CODE, + WALLET_CONSTRUCTOR, + owners_storage, +) + REFERENCE_SPEC_GIT_PATH = "N/A" REFERENCE_SPEC_VERSION = "N/A" +CONTRACTS = { + "multi_owned": (MULTI_OWNED_CONSTRUCTOR, MULTI_OWNED_CODE), + "day_limit": (DAY_LIMIT_CONSTRUCTOR, DAY_LIMIT_CODE), + "wallet": (WALLET_CONSTRUCTOR, WALLET_CODE), +} + @pytest.mark.ported_from( - ["state_tests/stWalletTest/walletConstructionFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", [ - pytest.param( - 0, - 0, - 0, - id="-g0", - ), - pytest.param( - 0, - 1, - 0, - id="-g1", - ), + "state_tests/stWalletTest/dayLimitConstructionFiller.json", + "state_tests/stWalletTest/dayLimitConstructionOOGFiller.json", + "state_tests/stWalletTest/dayLimitConstructionPartialFiller.json", + "state_tests/stWalletTest/multiOwnedConstructionCorrectFiller.json", + "state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasFiller.json", # noqa: E501 + "state_tests/stWalletTest/multiOwnedConstructionNotEnoughGasPartialFiller.json", # noqa: E501 + "state_tests/stWalletTest/walletConstructionFiller.json", + "state_tests/stWalletTest/walletConstructionOOGFiller.json", + "state_tests/stWalletTest/walletConstructionPartialFiller.json", ], ) -@pytest.mark.pre_alloc_mutable +@pytest.mark.valid_from("Cancun") +@pytest.mark.execute( + pytest.mark.skip( + reason="Expects the block number and timestamp of the test env" + ) +) +@pytest.mark.parametrize("contract", list(CONTRACTS)) +@pytest.mark.parametrize("out_of_gas", [False, True], ids=["success", "oog"]) def test_wallet_construction( state_test: StateTestFiller, pre: Alloc, fork: Fork, - d: int, - g: int, - v: int, + contract: str, + out_of_gas: bool, ) -> None: - """Test_wallet_construction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) + """ + Deploy the contract, with enough gas or without enough gas to deploy. - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) + The short budget covers the intrinsic cost and the code deposit but not + the constructor, so the creation runs out of gas. + """ + constructor, runtime = CONTRACTS[contract] + initcode = constructor + runtime + sender = pre.fund_eoa() + created = compute_create_address(address=sender, nonce=0) - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - - tx_data = [ - Bytes( - "6060604052604051602080611014833960806040818152925160016000818155818055600160a060020a03331660038190558152610102909452938320939093556201518042046101075582917f102d25c49d33fcdb8976a3f2744e0785c98d9e43b88364859e6aec4ae82eff5c91a250610f958061007f6000396000f300606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - ] - # The deployed wallet contract does ~21 fresh SSTOREs during - # construction; EIP-8037 per-storage state-gas spills into regular - # gas on Amsterdam, exceeding the original 1 225 023 / 1 825 023 - # budgets. Pre-EIP-8037 keeps the original values. - construction_tx_gas = [1_225_023, 1_825_023] - if fork.is_eip_enabled(8037): - construction_tx_gas = [8_000_000, 10_000_000] - tx_gas = construction_tx_gas - tx_value = [100] + gas_limit = None + post: Dict[Address, Account | None] + if out_of_gas: + gas_limit = fork.transaction_intrinsic_cost_calculator()( + calldata=initcode, contract_creation=True + ) + fork.gas_costs().CODE_DEPOSIT_PER_BYTE * len(runtime) + post = {created: Account.NONEXISTENT} + else: + post = { + created: Account( + code=runtime, storage=owners_storage(1, [sender]), nonce=1 + ) + } + post[sender] = Account(nonce=1) tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - nonce=1, + sender=sender, to=None, data=initcode, gas_limit=gas_limit ) - - post = { - sender: Account(storage={}, code=b"", nonce=2), - compute_create_address(address=sender, nonce=1): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) + state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_construction_oog.py b/tests/ported_static/stWalletTest/test_wallet_construction_oog.py deleted file mode 100644 index 1db9df00272..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_construction_oog.py +++ /dev/null @@ -1,144 +0,0 @@ -""" -Test_wallet_construction_oog. - -Ported from: -state_tests/stWalletTest/walletConstructionOOGFiller.json -@manually-enhanced: Do not overwrite. tx_gas[1] is tuned for the -contract-creation success path on Cancun; on Amsterdam the -NEW_ACCOUNT plus the 4 fresh storage slots in the deployed wallet -spill state-gas, so lift the budget by Fork.oog_budget_lift. -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) -from execution_testing.forks import Fork - -from tests.ported_static.post_state_resolution import ( - resolve_expect_post, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletConstructionOOGFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.parametrize( - "d, g, v", - [ - pytest.param( - 0, - 0, - 0, - id="-g0", - ), - pytest.param( - 0, - 1, - 0, - id="-g1", - ), - ], -) -@pytest.mark.pre_alloc_mutable -def test_wallet_construction_oog( - state_test: StateTestFiller, - pre: Alloc, - fork: Fork, - d: int, - g: int, - v: int, -) -> None: - """Test_wallet_construction_oog.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - - expect_entries_: list[dict] = [ - { - "indexes": {"data": -1, "gas": 0, "value": -1}, - "network": [">=Cancun"], - "result": { - sender: Account(storage={}, code=b"", nonce=2), - compute_create_address( - address=sender, nonce=1 - ): Account.NONEXISTENT, - }, - }, - { - "indexes": {"data": -1, "gas": 1, "value": -1}, - "network": [">=Cancun"], - "result": { - sender: Account(storage={}, code=b"", nonce=2), - compute_create_address(address=sender, nonce=1): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - }, - }, - ] - - post, _exc = resolve_expect_post(expect_entries_, d, g, v, fork) - - tx_data = [ - Bytes( - "6060604052604051602080611014833960806040818152925160016000818155818055600160a060020a03331660038190558152610102909452938320939093556201518042046101075582917f102d25c49d33fcdb8976a3f2744e0785c98d9e43b88364859e6aec4ae82eff5c91a250610f958061007f6000396000f300606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - ] - # Deployed wallet code length (matches the bytecode in expect_entries_). - _deployed_code_len = 3989 - tx_gas = [ - 427222, - 1225022 - + fork.oog_budget_lift( - creates_before_oog=1, - sstores_before_oog=4, - deploy_code_size=_deployed_code_len, - ), - ] - tx_value = [100] - - tx = Transaction( - sender=sender, - to=None, - data=tx_data[d], - gas_limit=tx_gas[g], - value=tx_value[v], - nonce=1, - error=_exc, - ) - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_construction_partial.py b/tests/ported_static/stWalletTest/test_wallet_construction_partial.py deleted file mode 100644 index 0974f1f81d2..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_construction_partial.py +++ /dev/null @@ -1,79 +0,0 @@ -""" -Test_wallet_construction_partial. - -Ported from: -state_tests/stWalletTest/walletConstructionPartialFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - StateTestFiller, - Transaction, - compute_create_address, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletConstructionPartialFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_construction_partial( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_construction_partial.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=10000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - - tx = Transaction( - sender=sender, - to=None, - data=Bytes( - "6060604052604051602080611014833960806040818152925160016000818155818055600160a060020a03331660038190558152610102909452938320939093556201518042046101075582917f102d25c49d33fcdb8976a3f2744e0785c98d9e43b88364859e6aec4ae82eff5c91a250610f958061007f6000396000f300606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - compute_create_address(address=sender, nonce=1): Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=1, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_default.py b/tests/ported_static/stWalletTest/test_wallet_default.py deleted file mode 100644 index 9f072585821..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_default.py +++ /dev/null @@ -1,75 +0,0 @@ -""" -Test_wallet_default. - -Ported from: -state_tests/stWalletTest/walletDefaultFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletDefaultFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_default( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_default.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F, nonce=1) - - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0_code = bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - contract_0 = pre.deploy_contract( - code=contract_0_code, - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes(""), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=contract_0_code, - balance=200, - nonce=1, - ), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_default_with_out_value.py b/tests/ported_static/stWalletTest/test_wallet_default_with_out_value.py deleted file mode 100644 index 5d1b917f53d..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_default_with_out_value.py +++ /dev/null @@ -1,74 +0,0 @@ -""" -Test_wallet_default_with_out_value. - -Ported from: -state_tests/stWalletTest/walletDefaultWithOutValueFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletDefaultWithOutValueFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_default_with_out_value( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_default_with_out_value.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F, nonce=1) - - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0_code = bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - contract_0 = pre.deploy_contract( - code=contract_0_code, - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes(""), - gas_limit=10000000, - nonce=1, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=contract_0_code, - balance=100, - nonce=1, - ), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_multi_owner.py b/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_multi_owner.py deleted file mode 100644 index 0b55aad076c..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_multi_owner.py +++ /dev/null @@ -1,109 +0,0 @@ -""" -Test_wallet_execute_over_daily_limit_multi_owner. - -Ported from: -state_tests/stWalletTest/walletExecuteOverDailyLimitMultiOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletExecuteOverDailyLimitMultiOwnerFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_execute_over_daily_limit_multi_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_execute_over_daily_limit_multi_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 2, - 1: 2, - 3: sender, - 4: 0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b61d27f6") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA) - + Hash(0x9) - + Hash(0x60), - gas_limit=10000000, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 2, - 1: 2, - 3: sender, - 4: 0x3FB1CD2CD96C6D5C0B5EB3322D807B34482481D4, - 260: 1, - 263: 0, - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x28E0E8F21C16F43AAA1E26147FB1CC74296CD3823267FA5BEBC02E090063C36D, # noqa: E501 - 0x5FD43EE7113B9859F7CAB1408959B063A9B2E07B4C9EC4098B2768DB95A4CBA7: 1, # noqa: E501 - 0x5FD43EE7113B9859F7CAB1408959B063A9B2E07B4C9EC4098B2768DB95A4CBA8: 2, # noqa: E501 - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043E: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043F: 9, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner.py b/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner.py deleted file mode 100644 index 444a6a1b747..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -Test_wallet_execute_over_daily_limit_only_one_owner. - -Ported from: -state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_execute_over_daily_limit_only_one_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_execute_over_daily_limit_only_one_owner.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 261: 4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b61d27f6") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA) - + Hash(0x9) - + Hash(0x60), - gas_limit=10000000, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 261: 4, - 263: 0, - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043E: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043F: 9, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner_new.py b/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner_new.py deleted file mode 100644 index 3cc6e54b407..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_execute_over_daily_limit_only_one_owner_new.py +++ /dev/null @@ -1,105 +0,0 @@ -""" -Test_wallet_execute_over_daily_limit_only_one_owner_new. - -Ported from: -state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerNewFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletExecuteOverDailyLimitOnlyOneOwnerNewFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_execute_over_daily_limit_only_one_owner_new( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_execute_over_daily_limit_only_one_owner_new.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 4, - 263: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b61d27f6") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA) - + Hash(0x9) - + Hash(0x60), - gas_limit=10000000, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 262: 4, - 263: 0xC22E4, - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043E: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043F: 9, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_execute_under_daily_limit.py b/tests/ported_static/stWalletTest/test_wallet_execute_under_daily_limit.py deleted file mode 100644 index 2399d447e41..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_execute_under_daily_limit.py +++ /dev/null @@ -1,104 +0,0 @@ -""" -Test_wallet_execute_under_daily_limit. - -Ported from: -state_tests/stWalletTest/walletExecuteUnderDailyLimitFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletExecuteUnderDailyLimitFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_execute_under_daily_limit( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_execute_under_daily_limit.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 261: 255, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("b61d27f6") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA) - + Hash(0x9) - + Hash(0x60), - gas_limit=10000000, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 261: 255, - 262: 0xC22E4, - 263: 0, - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043E: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x69D836D8D4229A4B7482679C45208E1A6079C5BE2775A4A87CA2D168319C043F: 9, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_kill.py b/tests/ported_static/stWalletTest/test_wallet_kill.py deleted file mode 100644 index 9bd09c31dcf..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_kill.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Test_wallet_kill. - -Ported from: -state_tests/stWalletTest/walletKillFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletKillFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_kill( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_kill.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("cbf0b0c0") + Hash(sender, left_padding=True), - gas_limit=10000000, - value=1, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=0, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_kill_not_by_owner.py b/tests/ported_static/stWalletTest/test_wallet_kill_not_by_owner.py deleted file mode 100644 index 1f65252f573..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_kill_not_by_owner.py +++ /dev/null @@ -1,89 +0,0 @@ -""" -Test_wallet_kill_not_by_owner. - -Ported from: -state_tests/stWalletTest/walletKillNotByOwnerFiller.json -""" - -import pytest -from execution_testing import ( - Account, - Alloc, - Bytes, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletKillNotByOwnerFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_kill_not_by_owner( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_kill_not_by_owner.""" - sender = pre.fund_eoa(amount=0xDE0B6B3A75EF08F, nonce=1) - - # Source: hex - # 0x - contract_0 = pre.deploy_contract( - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1_code = bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ) - # m_ownerIndex[contract_0] is at keccak256(contract_0 ++ 0x102). - owner_index_slot = Bytes( - Hash(contract_0, left_padding=True) + Hash(0x102) - ).keccak256() - contract_1 = pre.deploy_contract( - code=contract_1_code, - storage={ - 0: 1, - 1: 1, - 3: contract_0, - 262: 0xC22E4, - owner_index_slot: 1, - }, - balance=100, - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("cbf0b0c0") - + Hash(0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=2), - contract_0: Account(storage={}, nonce=1), - contract_1: Account( - storage={ - 0: 1, - 1: 1, - 3: contract_0, - 262: 0xC22E4, - owner_index_slot: 1, - }, - code=contract_1_code, - balance=200, - nonce=1, - ), - } - - state_test(pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_kill_to_wallet.py b/tests/ported_static/stWalletTest/test_wallet_kill_to_wallet.py deleted file mode 100644 index 248a076edb5..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_kill_to_wallet.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Test_wallet_kill_to_wallet. - -Ported from: -state_tests/stWalletTest/walletKillToWalletFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - ["state_tests/stWalletTest/walletKillToWalletFiller.json"], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_kill_to_wallet( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_kill_to_wallet.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0x45A915E4D060149EB4365960E6A7A45F334393093061116B197E3240065FF2D8 - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0xDE0B6B3A75EF08F, nonce=1) - # Source: hex - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_0 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 1, - 3: sender, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_0, - data=Bytes("cbf0b0c0") + Hash(contract_0, left_padding=True), - gas_limit=10000000, - value=100, - nonce=1, - ) - - post = { - sender: Account(storage={}, nonce=2), - contract_0: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 260: 1, - 262: 0xC22E4, - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - }, - balance=200, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/test_wallet_remove_owner_remove_pending_transaction.py b/tests/ported_static/stWalletTest/test_wallet_remove_owner_remove_pending_transaction.py deleted file mode 100644 index cc9fedeb207..00000000000 --- a/tests/ported_static/stWalletTest/test_wallet_remove_owner_remove_pending_transaction.py +++ /dev/null @@ -1,114 +0,0 @@ -""" -Test_wallet_remove_owner_remove_pending_transaction. - -Ported from: -state_tests/stWalletTest/walletRemoveOwnerRemovePendingTransactionFiller.json -""" - -import pytest -from execution_testing import ( - EOA, - Account, - Address, - Alloc, - Bytes, - Environment, - Hash, - StateTestFiller, - Transaction, -) - -REFERENCE_SPEC_GIT_PATH = "N/A" -REFERENCE_SPEC_VERSION = "N/A" - - -@pytest.mark.ported_from( - [ - "state_tests/stWalletTest/walletRemoveOwnerRemovePendingTransactionFiller.json" # noqa: E501 - ], -) -@pytest.mark.valid_from("Cancun") -@pytest.mark.pre_alloc_mutable -def test_wallet_remove_owner_remove_pending_transaction( - state_test: StateTestFiller, - pre: Alloc, -) -> None: - """Test_wallet_remove_owner_remove_pending_transaction.""" - coinbase = Address(0x2ADC25665018AA1FE0E6BC666DAC8FC2697FF9BA) - contract_0 = Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B) - contract_1 = Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D) - sender = EOA( - key=0xA95DEFE70EBEA7804F9C3BE42D20D24375E2A92B9D9666B832069C5F3CD423DD - ) - - env = Environment( - fee_recipient=coinbase, - number=1, - timestamp=1000, - prev_randao=0x20000, - base_fee_per_gas=10, - gas_limit=100000000, - ) - - pre[sender] = Account(balance=0x5AF3107A4000) - # Source: hex - # 0x - contract_0 = pre.deploy_contract( # noqa: F841 - code="", - balance=0xDE0B6B3A75EF08F, - nonce=1, - address=Address(0xA94F5374FCE5EDBC8E2A8697C15331677E6EBF0B), # noqa: E501 - ) - # Source: raw - # 0x606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe # noqa: E501 - contract_1 = pre.deploy_contract( # noqa: F841 - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - storage={ - 0: 1, - 1: 2, - 3: contract_0, - 4: sender, - 260: 1, - 263: 0xC22E4, - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB2: 1, # noqa: E501 - 0x3736DCA762B6FCB9A97D5EAFDA4032FDBA21DBFA25F875001D51E03EFF955FB3: 2, # noqa: E501 - 0x4C0BE60200FAA20559308CB7B5A1BB3255C16CB1CAB91F525B5AE7A03D02FABE: 0x6877E4536B661640954061CDBC3A9761FB5245C340FCB1721307CD9D5F285C96, # noqa: E501 - 0x6E369836487C234B9E553EF3F787C2D8865520739D340C67B3D251A33986E58D: 1, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D0: 0xAAAF5374FCE5EDBC8E2A8697C15331677E6EBAAA, # noqa: E501 - 0x915023A2112BB78C86FA558ABC0217EA6818D13895B90CE6BE233397F55EB1D1: 9, # noqa: E501 - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 2, # noqa: E501 - }, - balance=100, - nonce=0, - address=Address(0xEC0E71AD0A90FFE1909D27DAC207F7680ABBA42D), # noqa: E501 - ) - - tx = Transaction( - sender=sender, - to=contract_1, - data=Bytes("173825d9") + Hash(contract_0, left_padding=True), - gas_limit=10000000, - ) - - post = { - sender: Account(storage={}, code=b"", nonce=1), - contract_0: Account(storage={}, nonce=1), - contract_1: Account( - storage={ - 0: 1, - 1: 1, - 3: sender, - 263: 0xC22E4, - 0xD3E69D8C7F41F7AEAF8130DDC53047AEEE8CB46A73D6BAE86B7E7D6BF8312E6B: 1, # noqa: E501 - }, - code=bytes.fromhex( - "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb48146101c9578063746c9171146101fd578063797af62714610206578063b20d30a914610219578063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d861461037f575b61038960003411156101095760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b565b610389600435600060003643604051808484808284375050509091019081526040519081900360200190209050610693815b600160a060020a0333166000908152610102602052604081205481808083811415610c1357610d6c565b61038b6004355b600160a060020a03811660009081526101026020526040812054115b919050565b61038b60015481565b610389600036436040518084848082843750505090910190815260405190819003602001902090506107e58161013d565b6103896004356000364360405180848480828437505050909101908152604051908190036020019020905061060b8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107d98161013d565b61038b6004803590602480359160443591820191013560006108043361016e565b610389600435600160a060020a033316600090815261010260205260408120549080808381141561039d5761041f565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107528161013d565b61038b600435602435600082815261010360209081526040808320600160a060020a0385168452610102909252822054829081818114156107ab576107cf565b610389600435600036436040518084848082843750505090910190815260405190819003602001902090506107f38161013d565b6103896004356024356000600036436040518084848082843750505090910190815260405190819003602001902090506104ac8161013d565b61038b6101055481565b005b60408051918252519081900360200190f35b5050506000828152610103602052604081206001810154600284900a929083168190111561041f5781546001838101805492909101845590849003905560408051600160a060020a03331681526020810187905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5050505050565b600160a060020a03831660028361010081101561000257508301819055600160a060020a03851660008181526101026020908152604080832083905584835291829020869055815192835282019290925281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b600160a060020a0384166000908152610102602052604081205492508214156104ee57506104a7565b6104265b6101045460005b81811015610eba57610104805461010891600091849081101561000257600080516020610f7583398151915201548252506020918252604081208054600160a060020a0319168155600181018290556002810180548382559083528383209193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060020a038316906002906101008110156100025790900160005081905550600160005054610102600050600084600160a060020a03168152602001908152602001600020600050819055507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040518082600160a060020a0316815260200191505060405180910390a15b505b50565b15610606576106198261016e565b156106245750610608565b61062c6104f2565b60015460fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b6107105b600060015b600154811015610a47575b600154811080156106865750600281610100811015610002570154600014155b15610d7557600101610666565b156104a757600160a060020a0383166000908152610102602052604081205492508214156106c15750610606565b60016001600050540360006000505411156106dc5750610606565b600060028361010081101561000257508301819055600160a060020a038416815261010260205260408120556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a1505050565b15610606576001548211156107675750610608565b60008290556107746104f2565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15050565b506001830154600282900a908116600014156107ca57600094506107cf565b600194505b5050505092915050565b15610606575061010555565b156106085760006101065550565b156106065781600160a060020a0316ff5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160a060020a0316815260200185815260200184600160a060020a031681526020018060200182810382528484828181526020019250808284378201915050965050505050505060405180910390a184600160a060020a03168484846040518083838082843750505090810191506000908083038185876185025a03f15060009350610a2392505050565b6000364360405180848480828437505050909101908152604051908190036020019020915061090490508161020d565b158015610927575060008181526101086020526040812054600160a060020a0316145b15610a235760008181526101086020908152604082208054600160a060020a03191688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610a2b579182015b82811115610a2b57823582600050559160200191906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a060020a0316815260200185815260200184600160a060020a03168152602001806020018281038252848482818152602001925080828437820191505097505050505050505060405180910390a15b949350505050565b5061099a9291505b80821115610a475760008155600101610a33565b5090565b15610c005760008381526101086020526040812054600160a060020a031614610c0057604080516000918220805460018201546002929092018054600160a060020a0392909216949293909291819084908015610acd57820191906000526020600020905b815481529060010190602001808311610ab057829003601f168201915b50509250505060006040518083038185876185025a03f1505050600084815261010860209081526040805181842080546001820154600160a060020a033381811686529685018c905294840181905293166060830181905260a06080840181815260029390930180549185018290527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b969294929390929160c083019085908015610ba257820191906000526020600020905b815481529060010190602001808311610b8557829003601f168201915b505097505050505050505060405180910390a160008381526101086020908152604082208054600160a060020a031916815560018101839055600281018054848255908452828420919392610c0692601f9290920104810190610a33565b50919050565b505050600191505061018a565b6000868152610103602052604081208054909450909250821415610c9c578154835560018381018390556101048054918201808255828015829011610c6b57818360005260206000209182019101610c6b9190610a33565b50505060028401819055610104805488929081101561000257600091909152600080516020610f7583398151915201555b506001820154600284900a90811660001415610d6c5760408051600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a1825460019011610d59576000868152610103602052604090206002015461010480549091908110156100025760406000908120600080516020610f758339815191529290920181905580825560018083018290556002909201559550610d6c9050565b8254600019018355600183018054821790555b50505050919050565b5b60018054118015610d9857506001546002906101008110156100025701546000145b15610dac5760018054600019019055610d76565b60015481108015610dcf5750600154600290610100811015610002570154600014155b8015610de957506002816101008110156100025701546000145b15610e4a57600154600290610100811015610002578101549082610100811015610002578101919091558190610102906000908361010081101561000257810154825260209290925260408120929092556001546101008110156100025701555b61065b565b1561018a5761010754610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b610107555b6101065480830110801590610e9c5750610106546101055490830111155b15610eb25750610106805482019055600161018a565b50600061018a565b6106066101045460005b81811015610f4a5761010480548290811015610002576000918252600080516020610f75833981519152015414610f3757610104805461010391600091849081101561000257600080516020610f7583398151915201548252506020919091526040812081815560018101829055600201555b600101610ec4565b5050506001016104f9565b61010480546000808355919091526104a790600080516020610f7583398151915290810190610a3356004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" # noqa: E501 - ), - balance=100, - nonce=0, - ), - } - - state_test(env=env, pre=pre, post=post, tx=tx) diff --git a/tests/ported_static/stWalletTest/wallet_contracts.py b/tests/ported_static/stWalletTest/wallet_contracts.py new file mode 100644 index 00000000000..d49273cc92a --- /dev/null +++ b/tests/ported_static/stWalletTest/wallet_contracts.py @@ -0,0 +1,381 @@ +"""Compiled multiOwned, daylimit and Wallet contracts and storage layout.""" + +from typing import Sequence + +from execution_testing import Address, Bytes, Hash + +REQUIRED_SLOT = 0 +OWNER_COUNT_SLOT = 1 +FIRST_OWNER_SLOT = 3 +OWNER_INDEX_MAP = 0x102 +PENDING_MAP = 0x103 +PENDING_INDEX_SLOT = 0x104 +DAILY_LIMIT_SLOT = 0x105 +SPENT_TODAY_SLOT = 0x106 +LAST_DAY_SLOT = 0x107 +TRANSACTIONS_MAP = 0x108 + + +MULTI_OWNED_CODE = Bytes( + "606060405236156100775760e060020a6000350463173825d981146100795780632f54bf" + "6e146100d55780634123cb6b146100f95780637065cb4814610102578063746c91711461" + "0136578063b75c7dc61461013f578063ba51a6df1461016f578063c2cf7326146101a357" + "8063f00d4b5d146101e3575b005b61007760043560006000364360405180848480828437" + "5050509091019081526040519081900360200190209050610529815b600160a060020a03" + "3316600090815261010260205260408120548180808381141561066f57610806565b6102" + "1c6004355b600160a060020a0316600090815261010260205260408120541190565b6102" + "1c60015481565b6100776004356000364360405180848480828437505050909101908152" + "60405190819003602001902090506104a1816100ab565b61021c60005481565b61007760" + "0435600160a060020a033316600090815261010260205260408120549080808381141561" + "022e576102b0565b61007760043560003643604051808484808284375050509091019081" + "5260405190819003602001902090506105e8816100ab565b61021c600435602435600082" + "815261010360209081526040808320600160a060020a0385168452610102909252822054" + "8290818181141561064157610665565b6100776004356024356000600036436040518084" + "8480828437505050909101908152604051908190036020019020905061033a816100ab56" + "5b60408051918252519081900360200190f35b5050506000828152610103602052604081" + "206001810154600284900a92908316819011156102b05781546001838101805492909101" + "845590849003905560408051600160a060020a03331681526020810187905281517fc7fb" + "647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390" + "910190a15b5050505050565b600160a060020a0383166002836101008110156100025701" + "55600160a060020a03848116600081815261010260209081526040808320839055938716" + "80835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08b" + "f9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b15" + "61033357610348836100dc565b156103535750610335565b600160a060020a0384166000" + "9081526101026020526040812054925082141561037c5750610335565b6102b75b610104" + "5460005b818110156107b557610104805482908110156100025760009182526000805160" + "206108ea8339815191520154146103fa5761010480546101039160009184908110156100" + "02576000805160206108ea83398151915201548252506020919091526040812081815560" + "018101829055600201555b600101610387565b60018054810190819055600160a060020a" + "038316906002906101008110156100025790900160005081905550600160005054610102" + "600050600084600160a060020a0316815260200190815260200160002060005081905550" + "7f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040" + "518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561" + "049c576104af826100dc565b156104ba575061049e565b6104c2610380565b60015460fa" + "90106104d7576104d56104ec565b505b60015460fa9010610402575061049e565b6105a6" + "5b600060015b6001548110156107ef575b6001548110801561051c575060028161010081" + "1015610002570154600014155b1561080f576001016104fc565b1561033557600160a060" + "020a038316600090815261010260205260408120549250821415610557575061049c565b" + "6001600160005054036000600050541115610572575061049c565b600060028361010081" + "101561000257508301819055600160a060020a0384168152610102602052604081205561" + "04e8610380565b5060408051600160a060020a038516815290517f58619076adf5bb0943" + "d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a150505056" + "5b1561049c576001548211156105fd575061049e565b600082905561060a610380565b60" + "40805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0" + "dad4f550da9181900360200190a15050565b506001830154600282900a90811660001415" + "6106605760009450610665565b600194505b5050505092915050565b6000868152610103" + "6020526040812080549094509092508214156106f8578154835560018381018390556101" + "0480549182018082558280158290116106c7578183600052602060002091820191016106" + "c791906107db565b50505060028401819055610104805488929081101561000257600091" + "9091526000805160206108ea83398151915201555b506001820154600284900a90811660" + "0014156108065760408051600160a060020a03331681526020810188905281517fe1c52d" + "c63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda92918190039091" + "0190a18254600190116107f3576000868152610103602052604090206002015461010480" + "5490919081101561000257604060009081206000805160206108ea833981519152929092" + "01819055808255600180830182905560029092015595506108069050565b610104805460" + "0080835591909152610335906000805160206108ea833981519152908101905b80821115" + "6107ef57600081556001016107db565b5090565b82546000190183556001830180548217" + "90555b50505050919050565b5b6001805411801561083257506001546002906101008110" + "156100025701546000145b156108465760018054600019019055610810565b6001548110" + "80156108695750600154600290610100811015610002570154600014155b801561088357" + "506002816101008110156100025701546000145b156108e4576001546002906101008110" + "156100025781015490826101008110156100025781019190915581906101029060009083" + "610100811015610002578101548252602092909252604081209290925560015461010081" + "10156100025701555b6104f156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab9" + "1f525b5ae7a03d02fabe" +) +"""Runtime code of `multiOwned`.""" + +MULTI_OWNED_V2_CODE = Bytes( + "7c0100000000000000000000000000000000000000000000000000000000600035046317" + "3825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7d" + "c614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435" + "6000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffff" + "ffffffffffff3316600090815261010260205260408120548180808381141561058f5761" + "0586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090" + "815261010260205260408120541190565b61018160043560406000368082843790912090" + "5061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffff" + "ff3316600090815261010260205260408120549080808381141561019157610213565b61" + "0181600435604060003680828437909120905061053381610080565b6101816004356024" + "356000604060003680828437909120905061028681610080565b60006000f35b80600052" + "60206000f35b5050506000828152610103602052604081206001810154600284900a9290" + "83168190111561021357815460018084018054919092018455849003905573ffffffffff" + "ffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047" + "309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b01" + "5573ffffffffffffffffffffffffffffffffffffffff8481166000818152610102602052" + "6040808220829055928616808252908390208590559082526060527fb532073b38c83145" + "e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15" + "61027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffff" + "ffffffffffffffffff84166000908152610102602052604081205492508214156102d557" + "50610281565b6102f75b6101045460005b8181101561080c576101048054829081106108" + "5457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061" + "021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff8316600081" + "81526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469" + "d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610377576103" + "8a826100be565b156103955750610379565b61039d6102d9565b60015460fa9010151561" + "03b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b" + "600060015b6001548110156106f7575b6001548110801561075357506002816101008110" + "61074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffff" + "ff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffff" + "ffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071" + "b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffff" + "ffffffffffffffff83166000908152610102602052604081205492508214156104a85750" + "610377565b60016001600050540360006000505411156104c35750610377565b60006002" + "8361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff83" + "16600090815261010260205260408120556103c76102d9565b60408281527facbdb084c7" + "21332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b" + "15610377576001548211156105485750610379565b60008290556105046102d9565b8254" + "7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355" + "600183018054821790555b50505050919050565b60008681526101036020526040812080" + "5490945090925082141561061a5781548355600183810183905561010480549182018082" + "558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1ca" + "b91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9" + "565b6000918252602090912001555b506001820154600284900a90811660001415610586" + "5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1" + "c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254" + "600190111515610555576000868152610103602052610104805460409092206002015490" + "9181106106c057005b505b505050600284018190556101048054889290811061060d5700" + "5b6000918252602080832090910182905587825261010390526040812081815560018181" + "018390556002909101919091559450610586565b5090565b01546000145b156107605760" + "0180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + "0190555b60018054118015610701575060015460029061010081106106fb57005b015460" + "0014155b1561072f576001016103db565b60015481108015610784575060015460029061" + "0100811061077d57005b0154600014155b801561079f5750600281610100811061079957" + "005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0" + "565b015460028261010081106107cd57005b015580610102600060028361010081106107" + "e357005b0154815260208101919091526040016000908120919091556001546002906101" + "0081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7" + "b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f57600081" + "55600101610840565b60009182526020822001541415156108a657610104805461010391" + "6000918490811061087c57005b6000918252602080832090910154835282019290925260" + "4001812081815560018101829055600201555b6001016102e056" +) +"""Runtime code of `multiOwned` from a later compiler.""" + +DAY_LIMIT_CODE = Bytes( + "606060405236156100985760e060020a6000350463173825d9811461009a5780632f54bf" + "6e146100f65780634123cb6b1461011a5780635c52c2f5146101235780637065cb481461" + "0154578063746c917114610188578063b20d30a914610191578063b75c7dc6146101c557" + "8063ba51a6df146101f5578063c2cf732614610229578063f00d4b5d14610269578063f1" + "736d86146102a2575b005b61009860043560006000364360405180848480828437505050" + "90910190815260405190819003602001902090506105b9815b600160a060020a03331660" + "00908152610102602052604081205481808083811415610719576108b0565b6102ac6004" + "355b600160a060020a0316600090815261010260205260408120541190565b6102ac6001" + "5481565b6100986000364360405180848480828437505050909101908152604051908190" + "036020019020905061070b816100cc565b61009860043560003643604051808484808284" + "375050509091019081526040519081900360200190209050610531816100cc565b6102ac" + "60005481565b610098600435600036436040518084848082843750505090910190815260" + "405190819003602001902090506106ff816100cc565b610098600435600160a060020a03" + "331660009081526101026020526040812054908080838114156102be57610340565b6100" + "986004356000364360405180848480828437505050909101908152604051908190036020" + "0190209050610678816100cc565b6102ac60043560243560008281526101036020908152" + "6040808320600160a060020a0385168452610102909252822054829081818114156106d1" + "576106f5565b610098600435602435600060003643604051808484808284375050509091" + "0190815260405190819003602001902090506103ca816100cc565b6102ac610105548156" + "5b60408051918252519081900360200190f35b5050506000828152610103602052604081" + "206001810154600284900a92908316819011156103405781546001838101805492909101" + "845590849003905560408051600160a060020a03331681526020810187905281517fc7fb" + "647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390" + "910190a15b5050505050565b600160a060020a0383166002836101008110156100025701" + "55600160a060020a03848116600081815261010260209081526040808320839055938716" + "80835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08b" + "f9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b505b505050565b15" + "6103c3576103d8836100fd565b156103e357506103c5565b600160a060020a0384166000" + "9081526101026020526040812054925082141561040c57506103c5565b6103475b610104" + "5460005b8181101561085f57610104805482908110156100025760009182526000805160" + "2061099483398151915201541461048a5761010480546101039160009184908110156100" + "025760008051602061099483398151915201548252506020919091526040812081815560" + "018101829055600201555b600101610417565b60018054810190819055600160a060020a" + "038316906002906101008110156100025790900160005081905550600160005054610102" + "600050600084600160a060020a0316815260200190815260200160002060005081905550" + "7f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3826040" + "518082600160a060020a0316815260200191505060405180910390a15b505b50565b1561" + "052c5761053f826100fd565b1561054a575061052e565b610552610410565b60015460fa" + "90106105675761056561057c565b505b60015460fa9010610492575061052e565b610636" + "5b600060015b600154811015610899575b600154811080156105ac575060028161010081" + "1015610002570154600014155b156108b95760010161058c565b156103c557600160a060" + "020a0383166000908152610102602052604081205492508214156105e7575061052c565b" + "6001600160005054036000600050541115610602575061052c565b600060028361010081" + "101561000257508301819055600160a060020a0384168152610102602052604081205561" + "0578610410565b5060408051600160a060020a038516815290517f58619076adf5bb0943" + "d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a150505056" + "5b1561052c5760015482111561068d575061052e565b600082905561069a610410565b60" + "40805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0" + "dad4f550da9181900360200190a15050565b506001830154600282900a90811660001415" + "6106f057600094506106f5565b600194505b5050505092915050565b1561052c57506101" + "0555565b1561052e5760006101065550565b600086815261010360205260408120805490" + "94509092508214156107a257815483556001838101839055610104805491820180825582" + "8015829011610771578183600052602060002091820191016107719190610885565b5050" + "506002840181905561010480548892908110156100025760009190915260008051602061" + "099483398151915201555b506001820154600284900a908116600014156108b057604080" + "51600160a060020a03331681526020810188905281517fe1c52dc63b719ade82e8bea94c" + "c41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a182546001901161" + "089d57600086815261010360205260409020600201546101048054909190811015610002" + "576040600090812060008051602061099483398151915292909201819055808255600180" + "830182905560029092015595506108b09050565b61010480546000808355919091526103" + "c590600080516020610994833981519152908101905b8082111561089957600081556001" + "01610885565b5090565b8254600019018355600183018054821790555b50505050919050" + "565b5b600180541180156108dc5750600154600290610100811015610002570154600014" + "5b156108f057600180546000190190556108ba565b600154811080156109135750600154" + "600290610100811015610002570154600014155b801561092d5750600281610100811015" + "6100025701546000145b1561098e57600154600290610100811015610002578101549082" + "610100811015610002578101919091558190610102906000908361010081101561000257" + "810154825260209290925260408120929092556001546101008110156100025701555b61" + "058156004c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" +) +"""Runtime code of `daylimit`.""" + +WALLET_CODE = Bytes( + "606060405236156100b95760e060020a6000350463173825d9811461010b5780632f54bf" + "6e146101675780634123cb6b1461018f5780635c52c2f5146101985780637065cb481461" + "01c9578063746c9171146101fd578063797af62714610206578063b20d30a91461021957" + "8063b61d27f61461024d578063b75c7dc61461026e578063ba51a6df1461029e578063c2" + "cf7326146102d2578063cbf0b0c014610312578063f00d4b5d14610346578063f1736d86" + "1461037f575b61038960003411156101095760408051600160a060020a03331681523460" + "2082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5c" + "c9109c929181900390910190a15b565b6103896004356000600036436040518084848082" + "84375050509091019081526040519081900360200190209050610693815b600160a06002" + "0a0333166000908152610102602052604081205481808083811415610c1357610d6c565b" + "61038b6004355b600160a060020a03811660009081526101026020526040812054115b91" + "9050565b61038b60015481565b6103896000364360405180848480828437505050909101" + "90815260405190819003602001902090506107e58161013d565b61038960043560003643" + "60405180848480828437505050909101908152604051908190036020019020905061060b" + "8161013d565b61038b60005481565b61038b6004355b600081610a4b8161013d565b6103" + "896004356000364360405180848480828437505050909101908152604051908190036020" + "01902090506107d98161013d565b61038b60048035906024803591604435918201910135" + "60006108043361016e565b610389600435600160a060020a033316600090815261010260" + "205260408120549080808381141561039d5761041f565b61038960043560003643604051" + "808484808284375050509091019081526040519081900360200190209050610752816101" + "3d565b61038b600435602435600082815261010360209081526040808320600160a06002" + "0a0385168452610102909252822054829081818114156107ab576107cf565b6103896004" + "356000364360405180848480828437505050909101908152604051908190036020019020" + "90506107f38161013d565b61038960043560243560006000364360405180848480828437" + "50505090910190815260405190819003602001902090506104ac8161013d565b61038b61" + "01055481565b005b60408051918252519081900360200190f35b50505060008281526101" + "03602052604081206001810154600284900a929083168190111561041f57815460018381" + "01805492909101845590849003905560408051600160a060020a03331681526020810187" + "905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d759173" + "4b929181900390910190a15b5050505050565b600160a060020a03831660028361010081" + "101561000257508301819055600160a060020a0385166000818152610102602090815260" + "4080832083905584835291829020869055815192835282019290925281517fb532073b38" + "c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190" + "a15b505b505050565b156104a5576104ba8361016e565b156104c557506104a7565b6001" + "60a060020a0384166000908152610102602052604081205492508214156104ee57506104" + "a7565b6104265b6101045460005b81811015610eba576101048054610108916000918490" + "81101561000257600080516020610f758339815191520154825250602091825260408120" + "8054600160a060020a031916815560018101829055600281018054838255908352838320" + "9193610f3f92601f9290920104810190610a33565b60018054810190819055600160a060" + "020a03831690600290610100811015610002579090016000508190555060016000505461" + "0102600050600084600160a060020a031681526020019081526020016000206000508190" + "55507f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c382" + "6040518082600160a060020a0316815260200191505060405180910390a15b505b50565b" + "15610606576106198261016e565b156106245750610608565b61062c6104f2565b600154" + "60fa90106106415761063f610656565b505b60015460fa901061056c5750610608565b61" + "07105b600060015b600154811015610a47575b6001548110801561068657506002816101" + "00811015610002570154600014155b15610d7557600101610666565b156104a757600160" + "a060020a0383166000908152610102602052604081205492508214156106c15750610606" + "565b60016001600050540360006000505411156106dc5750610606565b60006002836101" + "0081101561000257508301819055600160a060020a038416815261010260205260408120" + "556106526104f2565b5060408051600160a060020a038516815290517f58619076adf5bb" + "0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15050" + "50565b15610606576001548211156107675750610608565b60008290556107746104f256" + "5b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9b" + "eaf0dad4f550da9181900360200190a15050565b506001830154600282900a9081166000" + "14156107ca57600094506107cf565b600194505b5050505092915050565b156106065750" + "61010555565b156106085760006101065550565b156106065781600160a060020a0316ff" + "5b15610a2357610818846000610e4f3361016e565b156108d4577f92ca3a80853e6663fa" + "31fa10b99225f18d4902939b4c53a9caae9043f6efd00433858786866040518086600160" + "a060020a0316815260200185815260200184600160a060020a0316815260200180602001" + "828103825284848281815260200192508082843782019150509650505050505050604051" + "80910390a184600160a060020a0316848484604051808383808284375050509081019150" + "6000908083038185876185025a03f15060009350610a2392505050565b60003643604051" + "808484808284375050509091019081526040519081900360200190209150610904905081" + "61020d565b158015610927575060008181526101086020526040812054600160a060020a" + "0316145b15610a235760008181526101086020908152604082208054600160a060020a03" + "191688178155600181018790556002018054858255818452928290209092601f01919091" + "048101908490868215610a2b579182015b82811115610a2b578235826000505591602001" + "91906001019061097c565b50600050507f1733cbb53659d713b79580f79f3f9ff215f78a" + "7c7aa45890f3b89fc5cddfbf328133868887876040518087815260200186600160a06002" + "0a0316815260200185815260200184600160a060020a0316815260200180602001828103" + "825284848281815260200192508082843782019150509750505050505050506040518091" + "0390a15b949350505050565b5061099a9291505b80821115610a47576000815560010161" + "0a33565b5090565b15610c005760008381526101086020526040812054600160a060020a" + "031614610c0057604080516000918220805460018201546002929092018054600160a060" + "020a0392909216949293909291819084908015610acd5782019190600052602060002090" + "5b815481529060010190602001808311610ab057829003601f168201915b505092505050" + "60006040518083038185876185025a03f150505060008481526101086020908152604080" + "5181842080546001820154600160a060020a033381811686529685018c90529484018190" + "5293166060830181905260a06080840181815260029390930180549185018290527fe7c9" + "57c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a985095968b96" + "9294929390929160c083019085908015610ba257820191906000526020600020905b8154" + "81529060010190602001808311610b8557829003601f168201915b505097505050505050" + "505060405180910390a160008381526101086020908152604082208054600160a060020a" + "031916815560018101839055600281018054848255908452828420919392610c0692601f" + "9290920104810190610a33565b50919050565b505050600191505061018a565b60008681" + "52610103602052604081208054909450909250821415610c9c5781548355600183810183" + "90556101048054918201808255828015829011610c6b5781836000526020600020918201" + "9101610c6b9190610a33565b505050600284018190556101048054889290811015610002" + "57600091909152600080516020610f7583398151915201555b506001820154600284900a" + "90811660001415610d6c5760408051600160a060020a0333168152602081018890528151" + "7fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181" + "900390910190a1825460019011610d595760008681526101036020526040902060020154" + "61010480549091908110156100025760406000908120600080516020610f758339815191" + "529290920181905580825560018083018290556002909201559550610d6c9050565b8254" + "600019018355600183018054821790555b50505050919050565b5b60018054118015610d" + "9857506001546002906101008110156100025701546000145b15610dac57600180546000" + "19019055610d76565b60015481108015610dcf5750600154600290610100811015610002" + "570154600014155b8015610de957506002816101008110156100025701546000145b1561" + "0e4a57600154600290610100811015610002578101549082610100811015610002578101" + "919091558190610102906000908361010081101561000257810154825260209290925260" + "408120929092556001546101008110156100025701555b61065b565b1561018a57610107" + "54610e655b62015180420490565b1115610e7e57600061010655610e79610e5c565b6101" + "07555b6101065480830110801590610e9c5750610106546101055490830111155b15610e" + "b25750610106805482019055600161018a565b50600061018a565b610606610104546000" + "5b81811015610f4a5761010480548290811015610002576000918252600080516020610f" + "75833981519152015414610f375761010480546101039160009184908110156100025760" + "0080516020610f7583398151915201548252506020919091526040812081815560018101" + "829055600201555b600101610ec4565b5050506001016104f9565b610104805460008083" + "55919091526104a790600080516020610f7583398151915290810190610a3356004c0be6" + "0200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" +) +"""Runtime code of `Wallet`.""" + +MULTI_OWNED_CONSTRUCTOR = Bytes( + "606060409081526001600081815581805533600160a060020a0316600381905581526101" + "026020529182205561090a90819061003b90396000f300" +) +"""Constructor prefix of the `multiOwned` init code.""" + +DAY_LIMIT_CONSTRUCTOR = Bytes( + "606060409081526001600081815581805533600160a060020a0316600381905581526101" + "026020529190912055620151804204610107556109b4806100456000396000f300" +) +"""Constructor prefix of the `daylimit` init code.""" + +WALLET_CONSTRUCTOR = Bytes( + "606060405260405160208061101483396080604081815292516001600081815581805560" + "0160a060020a033316600381905581526101029094529383209390935562015180420461" + "01075582917f102d25c49d33fcdb8976a3f2744e0785c98d9e43b88364859e6aec4ae82e" + "ff5c91a250610f958061007f6000396000f300" +) +"""Constructor prefix of the `Wallet` init code.""" + + +def mapping_slot(key: int | Address | Hash, base: int) -> int: + """Return the storage slot of `key` in the mapping at slot `base`.""" + return int.from_bytes( + Bytes(Hash(key, left_padding=True) + Hash(base)).keccak256(), "big" + ) + + +def pending_index_element_slot(index: int) -> int: + """Return the storage slot of `m_pendingIndex[index]`.""" + return int.from_bytes(Hash(PENDING_INDEX_SLOT).keccak256(), "big") + index + + +def owners_storage(required: int, owners: Sequence[Address]) -> dict: + """Return the storage of a wallet with `owners` and `required`.""" + storage: dict = {REQUIRED_SLOT: required, OWNER_COUNT_SLOT: len(owners)} + for index, owner in enumerate(owners, start=1): + storage[FIRST_OWNER_SLOT + index - 1] = owner + storage[mapping_slot(owner, OWNER_INDEX_MAP)] = index + return storage