Commit 90ce7a9a authored by refcell.eth's avatar refcell.eth Committed by GitHub

Merge pull request #8335 from ethereum-optimism/ctb/predeploys-test

contracts-bedrock: predeploys test
parents 0347c9b3 64a1f118
This diff is collapsed.
This diff is collapsed.
......@@ -4,6 +4,6 @@
"label": "mapping(uint256 => struct BlockOracle.BlockInfo)",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_uint256,t_struct(BlockInfo)83035_storage)"
"type": "t_mapping(t_uint256,t_struct(BlockInfo)72112_storage)"
}
]
\ No newline at end of file
......@@ -11,6 +11,6 @@
"label": "mapping(string => struct Drippie.DripState)",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_string_memory_ptr,t_struct(DripState)91598_storage)"
"type": "t_mapping(t_string_memory_ptr,t_struct(DripState)91663_storage)"
}
]
\ No newline at end of file
......@@ -18,7 +18,7 @@
"label": "mapping(bytes32 => struct Attestation)",
"offset": 0,
"slot": "50",
"type": "t_mapping(t_bytes32,t_struct(Attestation)55340_storage)"
"type": "t_mapping(t_bytes32,t_struct(Attestation)44875_storage)"
},
{
"bytes": "32",
......
......@@ -4,14 +4,14 @@
"label": "mapping(contract IFaucetAuthModule => struct Faucet.ModuleConfig)",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_contract(IFaucetAuthModule)92519,t_struct(ModuleConfig)92196_storage)"
"type": "t_mapping(t_contract(IFaucetAuthModule)92584,t_struct(ModuleConfig)92261_storage)"
},
{
"bytes": "32",
"label": "mapping(contract IFaucetAuthModule => mapping(bytes32 => uint256))",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_contract(IFaucetAuthModule)92519,t_mapping(t_bytes32,t_uint256))"
"type": "t_mapping(t_contract(IFaucetAuthModule)92584,t_mapping(t_bytes32,t_uint256))"
},
{
"bytes": "32",
......
......@@ -4,49 +4,49 @@
"label": "Timestamp",
"offset": 0,
"slot": "0",
"type": "t_userDefinedValueType(Timestamp)88547"
"type": "t_userDefinedValueType(Timestamp)77431"
},
{
"bytes": "1",
"label": "enum GameStatus",
"offset": 8,
"slot": "0",
"type": "t_enum(GameStatus)88563"
"type": "t_enum(GameStatus)77447"
},
{
"bytes": "20",
"label": "contract IBondManager",
"offset": 9,
"slot": "0",
"type": "t_contract(IBondManager)86056"
"type": "t_contract(IBondManager)75133"
},
{
"bytes": "32",
"label": "Hash",
"offset": 0,
"slot": "1",
"type": "t_userDefinedValueType(Hash)88539"
"type": "t_userDefinedValueType(Hash)77423"
},
{
"bytes": "32",
"label": "struct IFaultDisputeGame.ClaimData[]",
"offset": 0,
"slot": "2",
"type": "t_array(t_struct(ClaimData)86270_storage)dyn_storage"
"type": "t_array(t_struct(ClaimData)75347_storage)dyn_storage"
},
{
"bytes": "128",
"label": "struct IFaultDisputeGame.OutputProposals",
"offset": 0,
"slot": "3",
"type": "t_struct(OutputProposals)86285_storage"
"type": "t_struct(OutputProposals)75362_storage"
},
{
"bytes": "32",
"label": "mapping(ClaimHash => bool)",
"offset": 0,
"slot": "7",
"type": "t_mapping(t_userDefinedValueType(ClaimHash)88543,t_bool)"
"type": "t_mapping(t_userDefinedValueType(ClaimHash)77427,t_bool)"
},
{
"bytes": "32",
......
......@@ -39,7 +39,7 @@
"label": "mapping(address => struct Counters.Counter)",
"offset": 0,
"slot": "5",
"type": "t_mapping(t_address,t_struct(Counter)51095_storage)"
"type": "t_mapping(t_address,t_struct(Counter)49118_storage)"
},
{
"bytes": "32",
......@@ -60,14 +60,14 @@
"label": "mapping(address => struct ERC20Votes.Checkpoint[])",
"offset": 0,
"slot": "8",
"type": "t_mapping(t_address,t_array(t_struct(Checkpoint)48241_storage)dyn_storage)"
"type": "t_mapping(t_address,t_array(t_struct(Checkpoint)46264_storage)dyn_storage)"
},
{
"bytes": "32",
"label": "struct ERC20Votes.Checkpoint[]",
"offset": 0,
"slot": "9",
"type": "t_array(t_struct(Checkpoint)48241_storage)dyn_storage"
"type": "t_array(t_struct(Checkpoint)46264_storage)dyn_storage"
},
{
"bytes": "20",
......
......@@ -123,6 +123,6 @@
"label": "contract SuperchainConfig",
"offset": 0,
"slot": "251",
"type": "t_contract(SuperchainConfig)77365"
"type": "t_contract(SuperchainConfig)4111"
}
]
\ No newline at end of file
......@@ -32,6 +32,6 @@
"label": "struct Types.OutputProposal[]",
"offset": 0,
"slot": "3",
"type": "t_array(t_struct(OutputProposal)89412_storage)dyn_storage"
"type": "t_array(t_struct(OutputProposal)2677_storage)dyn_storage"
}
]
\ No newline at end of file
......@@ -18,7 +18,7 @@
"label": "struct ResourceMetering.ResourceParams",
"offset": 0,
"slot": "1",
"type": "t_struct(ResourceParams)76842_storage"
"type": "t_struct(ResourceParams)3420_storage"
},
{
"bytes": "1536",
......@@ -46,7 +46,7 @@
"label": "mapping(bytes32 => struct OptimismPortal.ProvenWithdrawal)",
"offset": 0,
"slot": "52",
"type": "t_mapping(t_bytes32,t_struct(ProvenWithdrawal)75921_storage)"
"type": "t_mapping(t_bytes32,t_struct(ProvenWithdrawal)2750_storage)"
},
{
"bytes": "1",
......@@ -60,6 +60,6 @@
"label": "contract SuperchainConfig",
"offset": 1,
"slot": "53",
"type": "t_contract(SuperchainConfig)77365"
"type": "t_contract(SuperchainConfig)3943"
}
]
\ No newline at end of file
......@@ -4,49 +4,49 @@
"label": "Timestamp",
"offset": 0,
"slot": "0",
"type": "t_userDefinedValueType(Timestamp)88547"
"type": "t_userDefinedValueType(Timestamp)77431"
},
{
"bytes": "8",
"label": "Timestamp",
"offset": 8,
"slot": "0",
"type": "t_userDefinedValueType(Timestamp)88547"
"type": "t_userDefinedValueType(Timestamp)77431"
},
{
"bytes": "1",
"label": "enum GameStatus",
"offset": 16,
"slot": "0",
"type": "t_enum(GameStatus)88563"
"type": "t_enum(GameStatus)77447"
},
{
"bytes": "20",
"label": "contract IBondManager",
"offset": 0,
"slot": "1",
"type": "t_contract(IBondManager)86056"
"type": "t_contract(IBondManager)75133"
},
{
"bytes": "32",
"label": "Hash",
"offset": 0,
"slot": "2",
"type": "t_userDefinedValueType(Hash)88539"
"type": "t_userDefinedValueType(Hash)77423"
},
{
"bytes": "32",
"label": "struct IOutputBisectionGame.ClaimData[]",
"offset": 0,
"slot": "3",
"type": "t_array(t_struct(ClaimData)86391_storage)dyn_storage"
"type": "t_array(t_struct(ClaimData)75468_storage)dyn_storage"
},
{
"bytes": "32",
"label": "mapping(ClaimHash => bool)",
"offset": 0,
"slot": "4",
"type": "t_mapping(t_userDefinedValueType(ClaimHash)88543,t_bool)"
"type": "t_mapping(t_userDefinedValueType(ClaimHash)77427,t_bool)"
},
{
"bytes": "32",
......
......@@ -11,7 +11,7 @@
"label": "mapping(address => enum ProxyAdmin.ProxyType)",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_enum(ProxyType)95525)"
"type": "t_mapping(t_address,t_enum(ProxyType)2988)"
},
{
"bytes": "32",
......@@ -25,7 +25,7 @@
"label": "contract AddressManager",
"offset": 0,
"slot": "3",
"type": "t_contract(AddressManager)87040"
"type": "t_contract(AddressManager)2205"
},
{
"bytes": "1",
......
......@@ -11,6 +11,6 @@
"label": "mapping(address => contract AddressManager)",
"offset": 0,
"slot": "1",
"type": "t_mapping(t_address,t_contract(AddressManager)87040)"
"type": "t_mapping(t_address,t_contract(AddressManager)76117)"
}
]
\ No newline at end of file
......@@ -4,7 +4,7 @@
"label": "mapping(bytes32 => struct SchemaRecord)",
"offset": 0,
"slot": "0",
"type": "t_mapping(t_bytes32,t_struct(SchemaRecord)57720_storage)"
"type": "t_mapping(t_bytes32,t_struct(SchemaRecord)47255_storage)"
},
{
"bytes": "1568",
......
......@@ -67,6 +67,6 @@
"label": "struct ResourceMetering.ResourceConfig",
"offset": 0,
"slot": "105",
"type": "t_struct(ResourceConfig)76855_storage"
"type": "t_struct(ResourceConfig)3433_storage"
}
]
\ No newline at end of file
......@@ -41,6 +41,9 @@ library Predeploys {
/// @notice Address of the DeployerWhitelist predeploy. No longer active.
address internal constant DEPLOYER_WHITELIST = 0x4200000000000000000000000000000000000002;
/// @notice Address of the canonical WETH9 contract.
address internal constant WETH9 = 0x4200000000000000000000000000000000000006;
/// @custom:legacy
/// @notice Address of the LegacyERC20ETH predeploy. Deprecated. Balances are migrated to the
/// state trie as of the Bedrock upgrade. Contract has been locked and write functions
......
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import { CommonTest } from "test/setup/CommonTest.sol";
import { EIP1967Helper } from "test/mocks/EIP1967Helper.sol";
import { Predeploys } from "src/libraries/Predeploys.sol";
contract PredeploysTest is CommonTest {
/// @dev Tests that the predeploy addresses are set correctly. They have code
/// and the proxied accounts have the correct admin.
function test_predeploysSet_succeeds() external {
uint256 count = 2048;
uint160 prefix = uint160(0x420) << 148;
for (uint256 i = 0; i < count; i++) {
address addr = address(prefix | uint160(i));
bytes memory code = addr.code;
assertTrue(code.length > 0);
// Skip the accounts that do not have a proxy
if (addr == Predeploys.LEGACY_ERC20_ETH || addr == Predeploys.GOVERNANCE_TOKEN || addr == Predeploys.WETH9)
{
continue;
}
assertTrue(EIP1967Helper.getAdmin(addr) == Predeploys.PROXY_ADMIN, "Admin mismatch");
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment