diff --git a/chains/era/configs/.gitkeep b/chains/era/configs/.gitkeep new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/contracts b/contracts index db9387690502..8172969672cc 160000 --- a/contracts +++ b/contracts @@ -1 +1 @@ -Subproject commit db9387690502937de081a959b164db5a5262ce0a +Subproject commit 8172969672cc6a38542cd8f5578c74b7e30cd3b4 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..e0ad2ac70cdc 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,21 +79,21 @@ impl Default for Erc20DeploymentConfig { symbol: String::from("DAI"), decimals: 18, implementation: String::from("TestnetERC20Token.sol"), - mint: 10000000000, + mint: U256::from_str("9000000000000000000000").unwrap(), }, Erc20DeploymentTokensConfig { name: String::from("WBTC"), symbol: String::from("WBTC"), decimals: 8, implementation: String::from("TestnetERC20Token.sol"), - mint: 10000000000, + mint: U256::from_str("9000000000000000000000").unwrap(), }, Erc20DeploymentTokensConfig { name: String::from("Wrapped Ether"), symbol: String::from("WETH"), decimals: 18, implementation: String::from("WETH9.sol"), - mint: 0, + mint: U256::zero(), }, ], } @@ -106,7 +106,7 @@ pub struct Erc20DeploymentTokensConfig { pub symbol: String, pub decimals: u64, pub implementation: String, - pub mint: u64, + pub mint: U256, } #[derive(Debug, Deserialize, Serialize, Clone)] @@ -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, } } } @@ -245,5 +248,5 @@ pub struct TokenDeployErc20Config { pub symbol: String, pub decimals: u64, pub implementation: String, - pub mint: u64, + pub mint: U256, } diff --git a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs index 1200bf7eab0d..874414ccc1a4 100644 --- a/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs +++ b/zk_toolbox/crates/config/src/forge_interface/deploy_ecosystem/output.rs @@ -1,6 +1,6 @@ use std::collections::HashMap; -use ethers::types::{Address, H256}; +use ethers::types::{Address, H256, U256}; use serde::{Deserialize, Serialize}; use crate::{ @@ -85,7 +85,7 @@ pub struct TokenDeployErc20Output { pub symbol: String, pub decimals: u64, pub implementation: String, - pub mint: u64, + pub mint: U256, } #[derive(Debug, Deserialize, Serialize, Clone)] 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 383be1f09370..cca800c9fe2f 100644 --- a/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs +++ b/zk_toolbox/crates/zk_inception/src/commands/chain/init.rs @@ -68,6 +68,12 @@ pub async fn init( contracts_config.l1.base_token_addr = chain_config.base_token.address; 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 mut secrets = chain_config.get_secrets_config()?; secrets.set_l1_rpc_url(init_args.l1_rpc_url.clone()); secrets.save_with_base_path(shell, &chain_config.configs)?; 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 3099b3cf8c27..26a5a7f4d88b 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)]