Skip to content

Commit

Permalink
chore(sidecar): const manager address
Browse files Browse the repository at this point in the history
  • Loading branch information
thedevbirb committed Oct 30, 2024
1 parent 0765076 commit c589453
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions bolt-sidecar/src/config/chain.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
use core::fmt;
use std::str::FromStr;
use std::{
fmt::{Display, Formatter},
time::Duration,
};

use alloy::primitives::Address;
use alloy::primitives::{address, Address};
use clap::{Args, ValueEnum};
use ethereum_consensus::deneb::{compute_fork_data_root, Root};
use serde::Deserialize;
Expand Down Expand Up @@ -33,6 +32,11 @@ pub const DEFAULT_CHAIN_CONFIG: ChainConfig = ChainConfig {
enable_unsafe_lookahead: false,
};

/// The address of the canonical BoltManager contract for the Holesky chain.
///
/// https://holesky.etherscan.io/address/0x440202829b493F9FF43E730EB5e8379EEa3678CF
pub const MANAGER_ADDRESS_HOLESKY: Address = address!("440202829b493F9FF43E730EB5e8379EEa3678CF");

/// Configuration for the chain the sidecar is running on.
#[derive(Debug, Clone, Copy, Args, Deserialize)]
pub struct ChainConfig {
Expand Down Expand Up @@ -106,12 +110,9 @@ impl Chain {
}

/// Returns the address of the canonical BoltManager contract for a given chain, if present
pub fn manager_address(&self) -> Option<Address> {
pub const fn manager_address(&self) -> Option<Address> {
match self {
Chain::Holesky => Some(
Address::from_str("0x440202829b493F9FF43E730EB5e8379EEa3678CF")
.expect("valid address"),
),
Chain::Holesky => Some(MANAGER_ADDRESS_HOLESKY),
_ => None,
}
}
Expand Down

0 comments on commit c589453

Please sign in to comment.