kona_protocol/predeploys.rs
1//! Addresses of OP pre-deploys.
2//!
3//! This module contains the addresses of various predeploy contracts in the OP Stack.
4//! See the complete set of predeploys at <https://specs.optimism.io/protocol/predeploys.html#predeploys>
5
6use alloy_primitives::{Address, address};
7
8/// Container for all predeploy contract addresses
9#[derive(Debug, Copy, Clone, PartialEq, Eq)]
10#[non_exhaustive]
11pub struct Predeploys;
12
13impl Predeploys {
14 /// List of all predeploys.
15 pub const ALL: [Address; 24] = [
16 Self::LEGACY_MESSAGE_PASSER,
17 Self::DEPLOYER_WHITELIST,
18 Self::LEGACY_ERC20_ETH,
19 Self::WETH9,
20 Self::L2_CROSS_DOMAIN_MESSENGER,
21 Self::L2_STANDARD_BRIDGE,
22 Self::SEQUENCER_FEE_VAULT,
23 Self::OP_MINTABLE_ERC20_FACTORY,
24 Self::L1_BLOCK_NUMBER,
25 Self::GAS_PRICE_ORACLE,
26 Self::GOVERNANCE_TOKEN,
27 Self::L1_BLOCK_INFO,
28 Self::L2_TO_L1_MESSAGE_PASSER,
29 Self::L2_ERC721_BRIDGE,
30 Self::OP_MINTABLE_ERC721_FACTORY,
31 Self::PROXY_ADMIN,
32 Self::BASE_FEE_VAULT,
33 Self::L1_FEE_VAULT,
34 Self::SCHEMA_REGISTRY,
35 Self::EAS,
36 Self::BEACON_BLOCK_ROOT,
37 Self::OPERATOR_FEE_VAULT,
38 Self::CROSS_L2_INBOX,
39 Self::L2_TO_L2_XDM,
40 ];
41
42 /// The LegacyMessagePasser contract stores commitments to withdrawal transactions before the
43 /// Bedrock upgrade.
44 /// <https://specs.optimism.io/protocol/predeploys.html#legacymessagepasser>
45 pub const LEGACY_MESSAGE_PASSER: Address =
46 address!("0x4200000000000000000000000000000000000000");
47
48 /// The DeployerWhitelist was used to provide additional safety during initial phases of
49 /// Optimism.
50 /// <https://specs.optimism.io/protocol/predeploys.html#deployerwhitelist>
51 pub const DEPLOYER_WHITELIST: Address = address!("0x4200000000000000000000000000000000000002");
52
53 /// The LegacyERC20ETH predeploy represented all ether in the system before the Bedrock upgrade.
54 /// <https://specs.optimism.io/protocol/predeploys.html#legacyerc20eth>
55 pub const LEGACY_ERC20_ETH: Address = address!("0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000");
56
57 /// The WETH9 predeploy address.
58 /// <https://specs.optimism.io/protocol/predeploys.html#weth9>
59 pub const WETH9: Address = address!("0x4200000000000000000000000000000000000006");
60
61 /// Higher level API for sending cross domain messages.
62 /// <https://specs.optimism.io/protocol/predeploys.html#l2crossdomainmessenger>
63 pub const L2_CROSS_DOMAIN_MESSENGER: Address =
64 address!("0x4200000000000000000000000000000000000007");
65
66 /// The L2 cross-domain messenger proxy address.
67 /// <https://specs.optimism.io/protocol/predeploys.html#l2standardbridge>
68 pub const L2_STANDARD_BRIDGE: Address = address!("0x4200000000000000000000000000000000000010");
69
70 /// The sequencer fee vault proxy address.
71 /// <https://specs.optimism.io/protocol/predeploys.html#sequencerfeevault>
72 pub const SEQUENCER_FEE_VAULT: Address = address!("0x4200000000000000000000000000000000000011");
73
74 /// The Optimism mintable ERC20 factory proxy address.
75 /// <https://specs.optimism.io/protocol/predeploys.html#optimismmintableerc20factory>
76 pub const OP_MINTABLE_ERC20_FACTORY: Address =
77 address!("0x4200000000000000000000000000000000000012");
78
79 /// Returns the last known L1 block number (legacy system).
80 /// <https://specs.optimism.io/protocol/predeploys.html#l1blocknumber>
81 pub const L1_BLOCK_NUMBER: Address = address!("0x4200000000000000000000000000000000000013");
82
83 /// The gas price oracle proxy address.
84 /// <https://specs.optimism.io/protocol/predeploys.html#gaspriceoracle>
85 pub const GAS_PRICE_ORACLE: Address = address!("0x420000000000000000000000000000000000000F");
86
87 /// The governance token proxy address.
88 /// <https://specs.optimism.io/governance/gov-token.html>
89 pub const GOVERNANCE_TOKEN: Address = address!("0x4200000000000000000000000000000000000042");
90
91 /// The L1 block information proxy address.
92 /// <https://specs.optimism.io/protocol/predeploys.html#l1block>
93 pub const L1_BLOCK_INFO: Address = address!("0x4200000000000000000000000000000000000015");
94
95 /// The L2 contract `L2ToL1MessagePasser`, stores commitments to withdrawal transactions.
96 /// <https://specs.optimism.io/protocol/predeploys.html#l2tol1messagepasser>
97 pub const L2_TO_L1_MESSAGE_PASSER: Address =
98 address!("0x4200000000000000000000000000000000000016");
99
100 /// The L2 ERC721 bridge proxy address.
101 /// <https://specs.optimism.io/protocol/predeploys.html>
102 pub const L2_ERC721_BRIDGE: Address = address!("0x4200000000000000000000000000000000000014");
103
104 /// The Optimism mintable ERC721 proxy address.
105 /// <https://specs.optimism.io/protocol/predeploys.html#optimismmintableerc721factory>
106 pub const OP_MINTABLE_ERC721_FACTORY: Address =
107 address!("0x4200000000000000000000000000000000000017");
108
109 /// The L2 proxy admin address.
110 /// <https://specs.optimism.io/protocol/predeploys.html#proxyadmin>
111 pub const PROXY_ADMIN: Address = address!("0x4200000000000000000000000000000000000018");
112
113 /// The base fee vault address.
114 /// <https://specs.optimism.io/protocol/predeploys.html#basefeevault>
115 pub const BASE_FEE_VAULT: Address = address!("0x4200000000000000000000000000000000000019");
116
117 /// The L1 fee vault address.
118 /// <https://specs.optimism.io/protocol/predeploys.html#l1feevault>
119 pub const L1_FEE_VAULT: Address = address!("0x420000000000000000000000000000000000001a");
120
121 /// The schema registry proxy address.
122 /// <https://specs.optimism.io/protocol/predeploys.html#schemaregistry>
123 pub const SCHEMA_REGISTRY: Address = address!("0x4200000000000000000000000000000000000020");
124
125 /// The EAS proxy address.
126 /// <https://specs.optimism.io/protocol/predeploys.html#eas>
127 pub const EAS: Address = address!("0x4200000000000000000000000000000000000021");
128
129 /// Provides access to L1 beacon block roots (EIP-4788).
130 /// <https://specs.optimism.io/protocol/predeploys.html#beacon-block-root>
131 pub const BEACON_BLOCK_ROOT: Address = address!("0x000F3df6D732807Ef1319fB7B8bB8522d0Beac02");
132
133 /// The Operator Fee Vault proxy address.
134 pub const OPERATOR_FEE_VAULT: Address = address!("420000000000000000000000000000000000001B");
135
136 /// The CrossL2Inbox proxy address.
137 pub const CROSS_L2_INBOX: Address = address!("0x4200000000000000000000000000000000000022");
138
139 /// The L2ToL2CrossDomainMessenger proxy address.
140 pub const L2_TO_L2_XDM: Address = address!("0x4200000000000000000000000000000000000023");
141}