axos_primitives/chain/base/
mainnet.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 base() -> Self {
12 Self {
13 network: "base".to_string(),
14 l1_chain_id: 1,
15 l2_chain_id: 8453,
16 l1_start_epoch: Epoch {
17 number: 17481768,
18 hash: b256!("5c13d307623a926cd31415036c8b7fa14572f9dac64528e857a470511fc30771"),
19 timestamp: 1686789347,
20 },
21 l2_genesis: BlockInfo {
22 hash: b256!("f712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd"),
23 number: 0,
24 parent_hash: B256::ZERO,
25 timestamp: 1686789347,
26 },
27 system_config: SystemConfig {
28 batch_sender: address!("5050f69a9786f081509234f1a7f4684b5e5b76c9"),
29 gas_limit: U256::from(30000000),
30 l1_fee_overhead: U256::from(188),
31 l1_fee_scalar: U256::from(684000),
32 unsafe_block_signer: address!("Af6E19BE0F9cE7f8afd49a1824851023A8249e8a"),
33 },
34 batch_inbox: address!("ff00000000000000000000000000000000008453"),
35 deposit_contract: address!("49048044d57e1c92a77f79988d21fa8faf74e97e"),
36 system_config_contract: address!("73a79fab69143498ed3712e519a88a918e1f4072"),
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 blocktime: 2,
43 regolith_time: 0,
44 }
45 }
46}
47
48#[cfg(test)]
49mod test {
50 use super::*;
51
52 const BASE: &str = r#"
53 {
54 "network": "base",
55 "l1_chain_id": 1,
56 "l2_chain_id": 8453,
57 "l1_start_epoch": {
58 "number": 17481768,
59 "hash": "5c13d307623a926cd31415036c8b7fa14572f9dac64528e857a470511fc30771",
60 "timestamp": 1686789347
61 },
62 "l2_genesis": {
63 "hash": "f712aa9241cc24369b143cf6dce85f0902a9731e70d66818a3a5845b296c73dd",
64 "number": 0,
65 "timestamp": 1686789347,
66 "parent_hash": "0000000000000000000000000000000000000000000000000000000000000000"
67 },
68 "system_config": {
69 "batch_sender": "5050f69a9786f081509234f1a7f4684b5e5b76c9",
70 "gas_limit": 30000000,
71 "l1_fee_overhead": 188,
72 "l1_fee_scalar": 684000,
73 "unsafe_block_signer": "Af6E19BE0F9cE7f8afd49a1824851023A8249e8a"
74 },
75 "batch_inbox": "ff00000000000000000000000000000000008453",
76 "deposit_contract": "49048044d57e1c92a77f79988d21fa8faf74e97e",
77 "system_config_contract": "73a79fab69143498ed3712e519a88a918e1f4072",
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 "blocktime": 2,
84 "regolith_time": 0
85 }
86 "#;
87
88 #[test]
89 fn test_base_goerli() {
90 let config = ChainConfig::base();
91 let parsed = serde_json::from_str::<ChainConfig>(BASE).unwrap();
92 assert_eq!(config, parsed);
93 }
94}