diff --git a/tests/prague/eip2537_bls_12_381_precompiles/spec.py b/tests/prague/eip2537_bls_12_381_precompiles/spec.py index 513a2ae9b2..cdca4c308d 100644 --- a/tests/prague/eip2537_bls_12_381_precompiles/spec.py +++ b/tests/prague/eip2537_bls_12_381_precompiles/spec.py @@ -5,6 +5,8 @@ from dataclasses import dataclass from typing import Callable, List, Sized, SupportsBytes, Tuple +from ethereum_test_addresses import Precompile + from .helpers import current_python_script_directory @@ -122,15 +124,15 @@ class Spec: """ # Addresses - G1ADD = 0x0B - G1MUL = 0x0C - G1MSM = 0x0D - G2ADD = 0x0E - G2MUL = 0x0F - G2MSM = 0x10 - PAIRING = 0x11 - MAP_FP_TO_G1 = 0x12 - MAP_FP2_TO_G2 = 0x13 + G1ADD = Precompile.BLS_12_381_G1_ADD + G1MUL = Precompile.BLS_12_381_G1_MUL + G1MSM = Precompile.BLS_12_381_G1_MULTIEXP + G2ADD = Precompile.BLS_12_381_G2_ADD + G2MUL = Precompile.BLS_12_381_G2_MUL + G2MSM = Precompile.BLS_12_381_G2_MULTIEXP + PAIRING = Precompile.BLS_12_381_PAIRING + MAP_FP_TO_G1 = Precompile.BLS_12_381_MAP_FP_TO_G1 + MAP_FP2_TO_G2 = Precompile.BLS_12_381_MAP_FP2_TO_G2 # Gas constants G1ADD_GAS = 500 diff --git a/tests/prague/eip2935_historical_block_hashes_from_state/spec.py b/tests/prague/eip2935_historical_block_hashes_from_state/spec.py index b0b7336bd2..d2c531efbd 100644 --- a/tests/prague/eip2935_historical_block_hashes_from_state/spec.py +++ b/tests/prague/eip2935_historical_block_hashes_from_state/spec.py @@ -4,6 +4,8 @@ from dataclasses import dataclass +from ethereum_test_addresses import SystemContract + @dataclass(frozen=True) class ReferenceSpec: @@ -26,6 +28,6 @@ class Spec: """ FORK_TIMESTAMP = 15_000 - HISTORY_STORAGE_ADDRESS = 0x0AAE40965E6800CD9B1F4B05FF21581047E3F91E + HISTORY_STORAGE_ADDRESS = SystemContract.BLOCK_HISTORY_CONTRACT HISTORY_SERVE_WINDOW = 8192 BLOCKHASH_OLD_WINDOW = 256 diff --git a/tests/prague/eip6110_deposits/spec.py b/tests/prague/eip6110_deposits/spec.py index 167e6f7a59..f68c8d33f6 100644 --- a/tests/prague/eip6110_deposits/spec.py +++ b/tests/prague/eip6110_deposits/spec.py @@ -3,6 +3,8 @@ """ from dataclasses import dataclass +from ethereum_test_addresses import SystemContract + @dataclass(frozen=True) class ReferenceSpec: @@ -24,4 +26,4 @@ class Spec: https://eips.ethereum.org/EIPS/eip-6110 """ - DEPOSIT_CONTRACT_ADDRESS = 0x00000000219AB540356CBB839CBE05303D7705FA + DEPOSIT_CONTRACT_ADDRESS = SystemContract.BEACON_DEPOSIT_CONTRACT diff --git a/tests/prague/eip7002_el_triggerable_withdrawals/spec.py b/tests/prague/eip7002_el_triggerable_withdrawals/spec.py index 6d9d5c8a62..3e1326cf45 100644 --- a/tests/prague/eip7002_el_triggerable_withdrawals/spec.py +++ b/tests/prague/eip7002_el_triggerable_withdrawals/spec.py @@ -5,6 +5,8 @@ from dataclasses import dataclass +from ethereum_test_addresses import SYSTEM_ADDRESS, SystemContract + @dataclass(frozen=True) class ReferenceSpec: @@ -30,8 +32,8 @@ class Spec: out. """ - WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS = 0x0000B595F2A73542E60B811C3EB8A231CA3CAAAA - SYSTEM_ADDRESS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE + WITHDRAWAL_REQUEST_PREDEPLOY_ADDRESS = SystemContract.WITHDRAWAL_REQUESTS_CONTRACT + SYSTEM_ADDRESS = SYSTEM_ADDRESS EXCESS_WITHDRAWAL_REQUESTS_STORAGE_SLOT = 0 WITHDRAWAL_REQUEST_COUNT_STORAGE_SLOT = 1 diff --git a/tests/prague/eip7251_consolidations/spec.py b/tests/prague/eip7251_consolidations/spec.py index 8e193a582a..56cd5c4b60 100644 --- a/tests/prague/eip7251_consolidations/spec.py +++ b/tests/prague/eip7251_consolidations/spec.py @@ -4,6 +4,8 @@ from dataclasses import dataclass +from ethereum_test_addresses import SYSTEM_ADDRESS, SystemContract + @dataclass(frozen=True) class ReferenceSpec: @@ -26,8 +28,8 @@ class Spec: https://eips.ethereum.org/EIPS/eip-7251#execution-layer """ - CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS = 0x000b0cbbCb4A622b212A4c8BF81A3614ceaAbBBB - SYSTEM_ADDRESS = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE + CONSOLIDATION_REQUEST_PREDEPLOY_ADDRESS = SystemContract.CONSOLIDATION_REQUESTS_CONTRACT + SYSTEM_ADDRESS = SYSTEM_ADDRESS EXCESS_CONSOLIDATION_REQUESTS_STORAGE_SLOT = 0 CONSOLIDATION_REQUEST_COUNT_STORAGE_SLOT = 1 diff --git a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py index d1e02fe230..abe70a8d92 100644 --- a/tests/prague/eip7702_set_code_tx/test_set_code_txs.py +++ b/tests/prague/eip7702_set_code_tx/test_set_code_txs.py @@ -11,6 +11,7 @@ import pytest from ethereum.crypto.hash import keccak256 +from ethereum_test_addresses import SystemContract from ethereum_test_tools import ( AccessList, Account, @@ -2440,12 +2441,12 @@ def test_set_code_to_system_contract( # Setup the initial storage of the account to mimic the system contract if required match system_contract: - case Address(0x00000000219AB540356CBB839CBE05303D7705FA): # EIP-6110 + case SystemContract.BEACON_DEPOSIT_CONTRACT: # EIP-6110 # Deposit contract needs specific storage values, so we set them on the account auth_signer = pre.fund_eoa( auth_account_start_balance, storage=deposit_contract_initial_storage() ) - case Address(0x000F3DF6D732807EF1319FB7B8BB8522D0BEAC02): # EIP-4788 + case SystemContract.BEACON_ROOT_HISTORY_CONTRACT: # EIP-4788 auth_signer = pre.fund_eoa(auth_account_start_balance, storage=Storage({1: 1})) case _: # Pre-fund without storage @@ -2453,10 +2454,10 @@ def test_set_code_to_system_contract( # Fabricate the payload for the system contract match system_contract: - case Address(0x000F3DF6D732807EF1319FB7B8BB8522D0BEAC02): # EIP-4788 + case SystemContract.BEACON_ROOT_HISTORY_CONTRACT: # EIP-4788 caller_payload = Hash(1) caller_code_storage[call_return_data_size_slot] = 32 - case Address(0x00000000219AB540356CBB839CBE05303D7705FA): # EIP-6110 + case SystemContract.BEACON_DEPOSIT_CONTRACT: # EIP-6110 # Fabricate a valid deposit request to the set-code account deposit_request = DepositRequest( pubkey=0x01, @@ -2467,7 +2468,7 @@ def test_set_code_to_system_contract( ) caller_payload = deposit_request.calldata call_value = deposit_request.value - case Address(0x0000B595F2A73542E60B811C3EB8A231CA3CAAAA): # EIP-7002 + case SystemContract.WITHDRAWAL_REQUESTS_CONTRACT: # EIP-7002 # Fabricate a valid withdrawal request to the set-code account withdrawal_request = WithdrawalRequest( source_address=0x01, @@ -2477,7 +2478,7 @@ def test_set_code_to_system_contract( ) caller_payload = withdrawal_request.calldata call_value = withdrawal_request.value - case Address(0x000B0CBBCB4A622B212A4C8BF81A3614CEAABBBB): # EIP-7251 + case SystemContract.CONSOLIDATION_REQUESTS_CONTRACT: # EIP-7251 # Fabricate a valid consolidation request to the set-code account consolidation_request = ConsolidationRequest( source_address=0x01, @@ -2487,7 +2488,7 @@ def test_set_code_to_system_contract( ) caller_payload = consolidation_request.calldata call_value = consolidation_request.value - case Address(0x0AAE40965E6800CD9B1F4B05FF21581047E3F91E): # EIP-2935 + case SystemContract.BLOCK_HISTORY_CONTRACT: # EIP-2935 caller_payload = Hash(0) caller_code_storage[call_return_data_size_slot] = 32 case _: