1111import pytest
1212from ethereum .crypto .hash import keccak256
1313
14+ from ethereum_test_addresses import SystemContract
1415from ethereum_test_tools import (
1516 AccessList ,
1617 Account ,
@@ -2440,23 +2441,23 @@ def test_set_code_to_system_contract(
24402441
24412442 # Setup the initial storage of the account to mimic the system contract if required
24422443 match system_contract :
2443- case Address ( 0x00000000219AB540356CBB839CBE05303D7705FA ) : # EIP-6110
2444+ case SystemContract . BEACON_DEPOSIT_CONTRACT : # EIP-6110
24442445 # Deposit contract needs specific storage values, so we set them on the account
24452446 auth_signer = pre .fund_eoa (
24462447 auth_account_start_balance , storage = deposit_contract_initial_storage ()
24472448 )
2448- case Address ( 0x000F3DF6D732807EF1319FB7B8BB8522D0BEAC02 ) : # EIP-4788
2449+ case SystemContract . BEACON_ROOT_HISTORY_CONTRACT : # EIP-4788
24492450 auth_signer = pre .fund_eoa (auth_account_start_balance , storage = Storage ({1 : 1 }))
24502451 case _:
24512452 # Pre-fund without storage
24522453 auth_signer = pre .fund_eoa (auth_account_start_balance )
24532454
24542455 # Fabricate the payload for the system contract
24552456 match system_contract :
2456- case Address ( 0x000F3DF6D732807EF1319FB7B8BB8522D0BEAC02 ) : # EIP-4788
2457+ case SystemContract . BEACON_ROOT_HISTORY_CONTRACT : # EIP-4788
24572458 caller_payload = Hash (1 )
24582459 caller_code_storage [call_return_data_size_slot ] = 32
2459- case Address ( 0x00000000219AB540356CBB839CBE05303D7705FA ) : # EIP-6110
2460+ case SystemContract . BEACON_DEPOSIT_CONTRACT : # EIP-6110
24602461 # Fabricate a valid deposit request to the set-code account
24612462 deposit_request = DepositRequest (
24622463 pubkey = 0x01 ,
@@ -2467,7 +2468,7 @@ def test_set_code_to_system_contract(
24672468 )
24682469 caller_payload = deposit_request .calldata
24692470 call_value = deposit_request .value
2470- case Address ( 0x0000B595F2A73542E60B811C3EB8A231CA3CAAAA ) : # EIP-7002
2471+ case SystemContract . WITHDRAWAL_REQUESTS_CONTRACT : # EIP-7002
24712472 # Fabricate a valid withdrawal request to the set-code account
24722473 withdrawal_request = WithdrawalRequest (
24732474 source_address = 0x01 ,
@@ -2477,7 +2478,7 @@ def test_set_code_to_system_contract(
24772478 )
24782479 caller_payload = withdrawal_request .calldata
24792480 call_value = withdrawal_request .value
2480- case Address ( 0x000B0CBBCB4A622B212A4C8BF81A3614CEAABBBB ) : # EIP-7251
2481+ case SystemContract . CONSOLIDATION_REQUESTS_CONTRACT : # EIP-7251
24812482 # Fabricate a valid consolidation request to the set-code account
24822483 consolidation_request = ConsolidationRequest (
24832484 source_address = 0x01 ,
@@ -2487,7 +2488,7 @@ def test_set_code_to_system_contract(
24872488 )
24882489 caller_payload = consolidation_request .calldata
24892490 call_value = consolidation_request .value
2490- case Address ( 0x0AAE40965E6800CD9B1F4B05FF21581047E3F91E ) : # EIP-2935
2491+ case SystemContract . BLOCK_HISTORY_CONTRACT : # EIP-2935
24912492 caller_payload = Hash (0 )
24922493 caller_code_storage [call_return_data_size_slot ] = 32
24932494 case _:
0 commit comments