diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs index 0998d459ba5c..e2465ae940c1 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/input.rs @@ -79,14 +79,14 @@ impl Default for Erc20DeploymentConfig { symbol: String::from("DAI"), decimals: 18, implementation: String::from("TestnetERC20Token.sol"), - mint: 10000000000, + mint: 10000000000000000000, }, Erc20DeploymentTokensConfig { name: String::from("WBTC"), symbol: String::from("WBTC"), decimals: 8, implementation: String::from("TestnetERC20Token.sol"), - mint: 10000000000, + mint: 10000000000000000000, }, Erc20DeploymentTokensConfig { name: String::from("Wrapped Ether"), @@ -209,6 +209,7 @@ pub struct DeployErc20Config { pub create2_factory_salt: H256, pub create2_factory_addr: Address, pub tokens: HashMap, + pub additional_addresses_for_minting: Vec
, } impl FileConfig for DeployErc20Config {} @@ -217,6 +218,7 @@ impl DeployErc20Config { pub fn new( erc20_deployment_config: &Erc20DeploymentConfig, contracts_config: &ContractsConfig, + additional_addresses_for_minting: Vec
, ) -> Self { let mut tokens = HashMap::new(); for token in &erc20_deployment_config.tokens { @@ -235,6 +237,7 @@ impl DeployErc20Config { create2_factory_addr: contracts_config.create2_factory_addr, create2_factory_salt: contracts_config.create2_factory_salt, tokens, + additional_addresses_for_minting, } } } diff --git a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs index 0c9ac8743eee..1434c6123e23 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs @@ -64,6 +64,12 @@ pub async fn init( // Copy ecosystem contracts contracts_config.save_with_base_path(shell, &chain_config.configs)?; + crate::commands::ecosystem::init::distribute_eth( + &ecosystem_config, + &chain_config, + init_args.l1_rpc_url.clone(), + ) + .await?; let spinner = Spinner::new(MSG_REGISTERING_CHAIN_SPINNER); contracts_config = register_chain( shell, diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs index fecda40c7760..9f15de6b91e6 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/init.rs @@ -109,13 +109,6 @@ pub async fn run(args: EcosystemInitArgs, shell: &Shell) -> anyhow::Result<()> { l1_rpc_url: final_ecosystem_args.ecosystem.l1_rpc_url.clone(), }; - distribute_eth( - &ecosystem_config, - &chain_config, - final_ecosystem_args.ecosystem.l1_rpc_url.clone(), - ) - .await?; - chain::init::init( &mut chain_init_args, shell, @@ -195,8 +188,17 @@ async fn deploy_erc20( l1_rpc_url: String, ) -> anyhow::Result { let deploy_config_path = DEPLOY_ERC20_SCRIPT_PARAMS.input(&ecosystem_config.link_to_code); - DeployErc20Config::new(erc20_deployment_config, contracts_config) - .save(shell, deploy_config_path)?; + let wallets = ecosystem_config.get_wallets()?; + DeployErc20Config::new( + erc20_deployment_config, + contracts_config, + vec![ + wallets.governor.address, + wallets.operator.address, + wallets.blob_operator.address, + ], + ) + .save(shell, deploy_config_path)?; let mut forge = Forge::new(&ecosystem_config.path_to_foundry()) .script(&DEPLOY_ERC20_SCRIPT_PARAMS.script(), forge_args.clone()) diff --git a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs index e2db65b213f8..e4074ed3070b 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/ecosystem/mod.rs @@ -9,7 +9,7 @@ mod args; mod change_default; mod create; pub mod create_configs; -mod init; +pub(crate) mod init; #[derive(Subcommand, Debug)] #[allow(clippy::large_enum_variant)]