Skip to content

Commit 4e97d89

Browse files
committed
pulls chain configs out into constants module
1 parent 8980e23 commit 4e97d89

File tree

7 files changed

+66
-22
lines changed

7 files changed

+66
-22
lines changed

src/config.rs

+17-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
use crate::signer::{LocalOrAws, SignerError};
1+
use crate::{
2+
constants::{self, HOST_WBTC},
3+
signer::{LocalOrAws, SignerError},
4+
};
25
use alloy::{
36
network::{Ethereum, EthereumWallet},
47
primitives::{Address, address},
@@ -251,26 +254,26 @@ impl BuilderConfig {
251254
pub const fn load_pecorino_constants(&self) -> SignetSystemConstants {
252255
let host = HostConfig::new(
253256
self.host_chain_id,
254-
149984,
257+
constants::PECORINO_DEPLOY_HEIGHT,
255258
self.zenith_address,
256-
address!("0x4E8cC181805aFC307C83298242271142b8e2f249"),
257-
address!("0xd553C4CA4792Af71F4B61231409eaB321c1Dd2Ce"),
258-
address!("0x1af3A16857C28917Ab2C4c78Be099fF251669200"),
259+
constants::HOST_ORDERS,
260+
constants::HOST_PASSAGE,
261+
constants::HOST_TRANSACTOR,
259262
PredeployTokens::new(
260-
address!("0x885F8DB528dC8a38aA3DDad9D3F619746B4a6A81"),
261-
address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A"),
262-
address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A"),
263+
constants::HOST_USDC,
264+
constants::HOST_USDT,
265+
constants::HOST_WBTC,
263266
),
264267
);
265268
let rollup = RollupConfig::new(
266269
self.ru_chain_id,
267-
address!("0x4E8cC181805aFC307C83298242271142b8e2f249"),
268-
address!("0xd553C4CA4792Af71F4B61231409eaB321c1Dd2Ce"),
269-
address!("0xe0eDA3701D44511ce419344A4CeD30B52c9Ba231"),
270+
constants::ROLLUP_ORDERS,
271+
constants::ROLLUP_PASSAGE,
272+
constants::BASE_FEE_RECIPIENT,
270273
PredeployTokens::new(
271-
address!("0x0B8BC5e60EE10957E0d1A0d95598fA63E65605e2"),
272-
address!("0xF34326d3521F1b07d1aa63729cB14A372f8A737C"),
273-
address!("0xE3d7066115f7d6b65F88Dff86288dB4756a7D733"),
274+
constants::ROLLUP_USDC,
275+
constants::ROLLUP_USDT,
276+
constants::ROLLUP_WBTC,
274277
),
275278
);
276279

src/constants.rs

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
//! Constants used in the builder.
2+
3+
use alloy::primitives::{Address, address};
4+
5+
/// Pecorino Chain ID used for the Pecorino network.
6+
pub const PECORINO_CHAIN_ID: u64 = 14174;
7+
8+
/// Block number at which the Pecorino rollup contract is deployed.
9+
pub const PECORINO_DEPLOY_HEIGHT: u64 = 149984;
10+
11+
/// Address of the orders contract on the host.
12+
pub const HOST_ORDERS: Address = address!("0x4E8cC181805aFC307C83298242271142b8e2f249");
13+
14+
/// Address of the passage contract on the host.
15+
pub const HOST_PASSAGE: Address = address!("0xd553C4CA4792Af71F4B61231409eaB321c1Dd2Ce");
16+
17+
/// Address of the transactor contract on the host.
18+
pub const HOST_TRANSACTOR: Address = address!("0x1af3A16857C28917Ab2C4c78Be099fF251669200");
19+
20+
/// Address of the USDC token contract on the host.
21+
pub const HOST_USDC: Address = address!("0x885F8DB528dC8a38aA3DDad9D3F619746B4a6A81");
22+
23+
/// Address of the USDT token contract on the host.
24+
pub const HOST_USDT: Address = address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A");
25+
26+
/// Address of the WBTC token contract on the host.
27+
pub const HOST_WBTC: Address = address!("0x7970D259D4a96764Fa9B23FF0715A35f06f52D1A");
28+
29+
/// Address of the orders contract on the rollup.
30+
pub const ROLLUP_ORDERS: Address = address!("0x4E8cC181805aFC307C83298242271142b8e2f249");
31+
32+
/// Address of the passage contract on the rollup.
33+
pub const ROLLUP_PASSAGE: Address = address!("0xd553C4CA4792Af71F4B61231409eaB321c1Dd2Ce");
34+
35+
/// Base fee recipient address.
36+
pub const BASE_FEE_RECIPIENT: Address = address!("0xe0eDA3701D44511ce419344A4CeD30B52c9Ba231");
37+
38+
/// Address of the USDC token contract on the rollup.
39+
pub const ROLLUP_USDC: Address = address!("0x0B8BC5e60EE10957E0d1A0d95598fA63E65605e2");
40+
41+
/// Address of the USDT token contract on the rollup.
42+
pub const ROLLUP_USDT: Address = address!("0xF34326d3521F1b07d1aa63729cB14A372f8A737C");
43+
44+
/// Address of the WBTC token contract on the rollup.
45+
pub const ROLLUP_WBTC: Address = address!("0xE3d7066115f7d6b65F88Dff86288dB4756a7D733");

src/consts.rs

-4
This file was deleted.

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
1414

1515
/// Constants for the Builder.
16-
pub mod consts;
16+
pub mod constants;
1717

1818
/// Configuration for the Builder binary.
1919
pub mod config;

src/tasks/block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::{
22
config::{BuilderConfig, RuProvider},
3-
consts::PECORINO_CHAIN_ID,
3+
constants::PECORINO_CHAIN_ID,
44
tasks::bundler::Bundle,
55
};
66
use alloy::{

src/test_utils.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//! Test utilities for testing builder tasks
2-
use crate::{config::BuilderConfig, consts::PECORINO_CHAIN_ID};
2+
use crate::{config::BuilderConfig, constants::PECORINO_CHAIN_ID};
33
use alloy::{
44
consensus::{SignableTransaction, TxEip1559, TxEnvelope},
55
primitives::{Address, TxKind, U256},

tests/block_builder_test.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ mod tests {
66
signers::local::PrivateKeySigner,
77
};
88
use builder::{
9-
consts::PECORINO_CHAIN_ID,
9+
constants::PECORINO_CHAIN_ID,
1010
tasks::block::Simulator,
1111
test_utils::{new_signed_tx, setup_logging, setup_test_config},
1212
};

0 commit comments

Comments
 (0)