Skip to content

Commit

Permalink
Merge branch 'main' into matias-override
Browse files Browse the repository at this point in the history
  • Loading branch information
matias-gonz authored Sep 16, 2024
2 parents 7a4a5aa + 6d4090f commit 8193106
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts
7 changes: 7 additions & 0 deletions zk_toolbox/crates/config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use crate::{
deploy_ecosystem::output::DeployL1Output,
deploy_l2_contracts::output::{
ConsensusRegistryOutput, DefaultL2UpgradeOutput, InitializeBridgeOutput,
Multicall3Output,
},
register_chain::output::RegisterChainOutput,
},
Expand Down Expand Up @@ -102,6 +103,11 @@ impl ContractsConfig {
self.l2.default_l2_upgrader = default_upgrade_output.l2_default_upgrader;
Ok(())
}

pub fn set_multicall3(&mut self, multicall3_output: &Multicall3Output) -> anyhow::Result<()> {
self.l2.multicall3 = Some(multicall3_output.multicall3);
Ok(())
}
}

impl FileConfigWithDefaultName for ContractsConfig {
Expand Down Expand Up @@ -152,4 +158,5 @@ pub struct L2Contracts {
pub testnet_paymaster_addr: Address,
pub default_l2_upgrader: Address,
pub consensus_registry: Option<Address>,
pub multicall3: Option<Address>,
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::traits::ZkToolboxConfig;
impl ZkToolboxConfig for InitializeBridgeOutput {}
impl ZkToolboxConfig for DefaultL2UpgradeOutput {}
impl ZkToolboxConfig for ConsensusRegistryOutput {}
impl ZkToolboxConfig for Multicall3Output {}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InitializeBridgeOutput {
Expand All @@ -23,3 +24,8 @@ pub struct ConsensusRegistryOutput {
pub consensus_registry_implementation: Address,
pub consensus_registry_proxy: Address,
}

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Multicall3Output {
pub multicall3: Address,
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,10 @@ use config::{
forge_interface::{
deploy_l2_contracts::{
input::DeployL2ContractsInput,
output::{ConsensusRegistryOutput, DefaultL2UpgradeOutput, InitializeBridgeOutput},
output::{
ConsensusRegistryOutput, DefaultL2UpgradeOutput, InitializeBridgeOutput,
Multicall3Output,
},
},
script_params::DEPLOY_L2_CONTRACTS_SCRIPT_PARAMS,
},
Expand Down Expand Up @@ -205,6 +208,7 @@ pub async fn deploy_l2_contracts(
contracts_config.set_l2_shared_bridge(&InitializeBridgeOutput::read(shell, out)?)?;
contracts_config.set_default_l2_upgrade(&DefaultL2UpgradeOutput::read(shell, out)?)?;
contracts_config.set_consensus_registry(&ConsensusRegistryOutput::read(shell, out)?)?;
contracts_config.set_multicall3(&Multicall3Output::read(shell, out)?)?;
Ok(())
},
)
Expand Down

0 comments on commit 8193106

Please sign in to comment.