Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes for toolbox #3329

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
4 changes: 2 additions & 2 deletions core/tests/ts-integration/tests/ether.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('ETH token checks', () => {
const l2GasLimit = await zksync.utils.estimateDefaultBridgeDepositL2Gas(
alice.providerL1!,
alice.provider,
zksync.utils.ETH_ADDRESS,
zksync.utils.ETH_ADDRESS_IN_CONTRACTS,
amount,
alice.address,
alice.address,
Expand All @@ -73,7 +73,7 @@ describe('ETH token checks', () => {
});

const depositOp = alice.deposit({
token: zksync.utils.ETH_ADDRESS,
token: zksync.utils.ETH_ADDRESS_IN_CONTRACTS,
amount,
gasPerPubdataByte,
l2GasLimit,
Expand Down
4 changes: 1 addition & 3 deletions core/tests/ts-integration/tests/l1.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ describe('Tests for L1 behavior', () => {
expect(msgProof).toBeTruthy();

// Ensure that received proof matches the provided root hash.
const { id, proof, root } = msgProof!;
const accumulatedRoot = calculateAccumulatedRoot(alice.address, message, receipt.l1BatchTxIndex!, id, proof);
expect(accumulatedRoot).toBe(root);
const { id, proof } = msgProof!;

// Ensure that provided proof is accepted by the main ZKsync contract.
const chainContract = await alice.getMainContract();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use zksync_basic_types::L2ChainId;
use crate::{
consts::INITIAL_DEPLOYMENT_FILE,
traits::{FileConfigWithDefaultName, ZkStackConfig},
ContractsConfig, GenesisConfig, WalletsConfig,
ContractsConfig, GenesisConfig, WalletsConfig, ERC20_DEPLOYMENT_FILE,
};

#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down Expand Up @@ -69,7 +69,7 @@ pub struct Erc20DeploymentConfig {
}

impl FileConfigWithDefaultName for Erc20DeploymentConfig {
const FILE_NAME: &'static str = INITIAL_DEPLOYMENT_FILE;
const FILE_NAME: &'static str = ERC20_DEPLOYMENT_FILE;
}

impl ZkStackConfig for Erc20DeploymentConfig {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use ethers::types::Address;
use serde::{Deserialize, Serialize};
use zksync_basic_types::L2ChainId;

use crate::{traits::ZkStackConfig, ChainConfig};
use crate::{traits::ZkStackConfig, ChainConfig, EcosystemConfig};

impl ZkStackConfig for DeployL2ContractsInput {}

Expand All @@ -20,16 +20,20 @@ pub struct DeployL2ContractsInput {
}

impl DeployL2ContractsInput {
pub fn new(chain_config: &ChainConfig, era_chain_id: L2ChainId) -> anyhow::Result<Self> {
let contracts = chain_config.get_contracts_config()?;
pub fn new(
ecosystem_govenor_addr: Address,
era_chain_id: L2ChainId,
chain_config: &ChainConfig,
) -> anyhow::Result<Self> {
let chain_contracts = chain_config.get_contracts_config()?;
let wallets = chain_config.get_wallets_config()?;
Ok(Self {
era_chain_id,
era_chain_id: era_chain_id,
chain_id: chain_config.chain_id,
l1_shared_bridge: contracts.bridges.shared.l1_address,
bridgehub: contracts.ecosystem_contracts.bridgehub_proxy_addr,
governance: wallets.governor.address,
erc20_bridge: contracts.bridges.erc20.l1_address,
l1_shared_bridge: chain_contracts.bridges.shared.l1_address,
bridgehub: chain_contracts.ecosystem_contracts.bridgehub_proxy_addr,
governance: ecosystem_govenor_addr,
erc20_bridge: chain_contracts.bridges.erc20.l1_address,
consensus_registry_owner: wallets.governor.address,
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,15 @@ async fn call_forge(
forge_args: ForgeScriptArgs,
signature: Option<&str>,
) -> anyhow::Result<()> {
let input = DeployL2ContractsInput::new(chain_config, ecosystem_config.era_chain_id)?;
let input = DeployL2ContractsInput::new(
ecosystem_config
.get_contracts_config()
.context("ecosystem contracts mmissing")?
.l1
.governance_addr,
ecosystem_config.era_chain_id,
chain_config,
)?;
let foundry_contracts_path = chain_config.path_to_foundry();
let secrets = chain_config.get_secrets_config()?;
input.save(
Expand Down
Loading