Skip to content

Commit

Permalink
fix(zk-toolbox): use chain admin for bridgehub (#2857)
Browse files Browse the repository at this point in the history
## What ❔

<!-- What are the changes this PR brings about? -->
<!-- Example: This PR adds a PR template to the repo. -->
<!-- (For bigger PRs adding more context is appreciated) -->

## Why ❔

<!-- Why are these changes done? What goal do they contribute to? What
are the principles behind them? -->
<!-- Example: PR templates ensure PR reviewers, observers, and future
iterators are in context about the evolution of repos. -->

## Checklist

<!-- Check your PR fulfills the following items. -->
<!-- For draft PRs check the boxes as you complete them. -->

- [ ] PR title corresponds to the body of PR (we generate changelog
entries from PRs).
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] Code has been formatted via `zk fmt` and `zk lint`.

---------

Signed-off-by: Danil <deniallugo@gmail.com>
  • Loading branch information
Deniallugo authored and itegulov committed Sep 13, 2024
1 parent 6992f8c commit a85977a
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
1 change: 1 addition & 0 deletions zk_toolbox/crates/config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ impl ContractsConfig {
self.ecosystem_contracts
.diamond_cut_data
.clone_from(&deploy_l1_output.contracts_config.diamond_cut_data);
self.l1.chain_admin_addr = deploy_l1_output.deployed_addresses.chain_admin;
}

pub fn set_chain_contracts(&mut self, register_chain_output: &RegisterChainOutput) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub struct DeployL1DeployedAddressesOutput {
pub governance_addr: Address,
pub transparent_proxy_admin_addr: Address,
pub validator_timelock_addr: Address,
pub chain_admin: Address,
pub bridgehub: L1BridgehubOutput,
pub bridges: L1BridgesOutput,
pub state_transition: L1StateTransitionOutput,
Expand Down
37 changes: 36 additions & 1 deletion zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use super::{
setup_observability,
};
use crate::{
accept_ownership::accept_owner,
accept_ownership::{accept_admin, accept_owner},
commands::{
chain::{self, args::init::PortOffset},
ecosystem::create_configs::{
Expand Down Expand Up @@ -332,6 +332,17 @@ async fn deploy_ecosystem_inner(
)
.await?;

accept_admin(
shell,
config,
contracts_config.l1.chain_admin_addr,
config.get_wallets()?.governor_private_key(),
contracts_config.ecosystem_contracts.bridgehub_proxy_addr,
&forge_args,
l1_rpc_url.clone(),
)
.await?;

accept_owner(
shell,
config,
Expand All @@ -343,6 +354,17 @@ async fn deploy_ecosystem_inner(
)
.await?;

accept_admin(
shell,
config,
contracts_config.l1.chain_admin_addr,
config.get_wallets()?.governor_private_key(),
contracts_config.bridges.shared.l1_address,
&forge_args,
l1_rpc_url.clone(),
)
.await?;

accept_owner(
shell,
config,
Expand All @@ -356,6 +378,19 @@ async fn deploy_ecosystem_inner(
)
.await?;

accept_admin(
shell,
config,
contracts_config.l1.chain_admin_addr,
config.get_wallets()?.governor_private_key(),
contracts_config
.ecosystem_contracts
.state_transition_proxy_addr,
&forge_args,
l1_rpc_url.clone(),
)
.await?;

Ok(contracts_config)
}

Expand Down

0 comments on commit a85977a

Please sign in to comment.