axos_primitives/chain/optimism/
sepolia.rs1use crate::alloc::string::ToString;
2use alloy_primitives::{address, b256, B256, U256};
3
4use crate::BlockInfo;
5use crate::ChainConfig;
6use crate::Epoch;
7use crate::SystemConfig;
8
9impl ChainConfig {
10 pub fn optimism_sepolia() -> Self {
12 Self {
13 network: "optimism-sepolia".to_string(),
14 l1_chain_id: 11155111,
15 l2_chain_id: 11155420,
16 l1_start_epoch: Epoch {
17 hash: b256!("48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b"),
18 number: 4071408,
19 timestamp: 1691802540,
20 },
21 l2_genesis: BlockInfo {
22 hash: b256!("102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d"),
23 number: 0,
24 parent_hash: B256::ZERO,
25 timestamp: 1691802540,
26 },
27 system_config: SystemConfig {
28 batch_sender: address!("8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c"),
29 gas_limit: U256::from(30_000_000),
30 l1_fee_overhead: U256::from(188),
31 l1_fee_scalar: U256::from(684000),
32 unsafe_block_signer: address!("0000000000000000000000000000000000000000"),
33 },
34 system_config_contract: address!("034edd2a225f7f429a63e0f1d2084b9e0a93b538"),
35 batch_inbox: address!("ff00000000000000000000000000000011155420"),
36 deposit_contract: address!("16fc5058f25648194471939df75cf27a2fdc48bc"),
37 l2_to_l1_message_passer: address!("4200000000000000000000000000000000000016"),
38 max_channel_size: 100_000_000,
39 channel_timeout: 300,
40 seq_window_size: 3600,
41 max_seq_drift: 600,
42 regolith_time: 0,
43 blocktime: 2,
44 }
45 }
46}
47
48#[cfg(test)]
49mod test {
50 use super::*;
51
52 const OPTIMISM_SEPOLIA: &str = r#"
53 {
54 "network": "optimism-sepolia",
55 "l1_chain_id": 11155111,
56 "l2_chain_id": 11155420,
57 "l1_start_epoch": {
58 "number": 4071408,
59 "hash": "48f520cf4ddaf34c8336e6e490632ea3cf1e5e93b0b2bc6e917557e31845371b",
60 "timestamp": 1691802540
61 },
62 "l2_genesis": {
63 "number": 0,
64 "hash": "102de6ffb001480cc9b8b548fd05c34cd4f46ae4aa91759393db90ea0409887d",
65 "parent_hash": "0000000000000000000000000000000000000000000000000000000000000000",
66 "timestamp": 1691802540
67 },
68 "system_config": {
69 "batch_sender": "8F23BB38F531600e5d8FDDaAEC41F13FaB46E98c",
70 "gas_limit": 30000000,
71 "l1_fee_overhead": 188,
72 "l1_fee_scalar": 684000,
73 "unsafe_block_signer": "0000000000000000000000000000000000000000"
74 },
75 "system_config_contract": "034edd2a225f7f429a63e0f1d2084b9e0a93b538",
76 "batch_inbox": "ff00000000000000000000000000000011155420",
77 "deposit_contract": "16fc5058f25648194471939df75cf27a2fdc48bc",
78 "l2_to_l1_message_passer": "4200000000000000000000000000000000000016",
79 "max_channel_size": 100000000,
80 "channel_timeout": 300,
81 "seq_window_size": 3600,
82 "max_seq_drift": 600,
83 "regolith_time": 0,
84 "blocktime": 2
85 }
86 "#;
87
88 #[test]
89 fn test_optimism_sepolia() {
90 let config = ChainConfig::optimism_sepolia();
91 let parsed = serde_json::from_str::<ChainConfig>(OPTIMISM_SEPOLIA).unwrap();
92 assert_eq!(config, parsed);
93 }
94}