Skip to content

Commit

Permalink
(merge): resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
Raid Ateir committed Oct 16, 2024
2 parents ff3e64c + dfe03d3 commit f5120ef
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 5 deletions.
3 changes: 3 additions & 0 deletions core/lib/config/src/configs/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ pub struct ContractsConfig {
pub l2_da_validator_addr: Option<Address>,

pub chain_admin_addr: Option<Address>,

pub settlement_layer: Option<u64>,
}

impl ContractsConfig {
Expand All @@ -78,6 +80,7 @@ impl ContractsConfig {
user_facing_diamond_proxy_addr: Some(Address::repeat_byte(0x16)),
chain_admin_addr: Some(Address::repeat_byte(0x18)),
l2_da_validator_addr: Some(Address::repeat_byte(0x19)),
settlement_layer: Some(0),
}
}
}
1 change: 1 addition & 0 deletions core/lib/config/src/testonly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ impl Distribution<configs::ContractsConfig> for EncodeDist {
l2_da_validator_addr: rng.gen(),
base_token_addr: self.sample_opt(|| rng.gen()),
chain_admin_addr: self.sample_opt(|| rng.gen()),
settlement_layer: self.sample_opt(|| rng.gen()),
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions core/lib/env_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ mod tests {
)),
chain_admin_addr: Some(addr("0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
l2_da_validator_addr: Some(addr("0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff")),
settlement_layer: Some(0),
}
}

Expand Down Expand Up @@ -129,6 +130,7 @@ CONTRACTS_USER_FACING_DIAMOND_PROXY_ADDR="0xF00B988a98Ca742e7958DeF9F7823b590871
CONTRACTS_L2_NATIVE_TOKEN_VAULT_PROXY_ADDR="0xfc073319977e314f251eae6ae6be76b0b3baeecf"
CONTRACTS_L2_DA_VALIDATOR_ADDR="0xed6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_CHAIN_ADMIN_ADDR="0xdd6fa5c14e7550b4caf2aa2818d24c69cbc347ff"
CONTRACTS_SETTLEMENT_LAYER="0"
"#;
lock.set_env(config);

Expand Down
2 changes: 2 additions & 0 deletions core/lib/protobuf_config/src/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl ProtoRepr for proto::Contracts {
.map(|x| parse_h160(x))
.transpose()
.context("chain_admin_addr")?,
settlement_layer: self.settlement_layer,
})
}

Expand Down Expand Up @@ -191,6 +192,7 @@ impl ProtoRepr for proto::Contracts {
user_facing_diamond_proxy: this
.user_facing_diamond_proxy_addr
.map(|a| format!("{:?}", a)),
settlement_layer: this.settlement_layer,
}
}
}
1 change: 1 addition & 0 deletions core/lib/protobuf_config/src/proto/config/contracts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ message Contracts {
optional EcosystemContracts ecosystem_contracts = 4;
optional string user_facing_bridgehub = 5;
optional string user_facing_diamond_proxy = 6;
optional uint64 settlement_layer = 7;
}
3 changes: 0 additions & 3 deletions core/tests/ts-integration/tests/contracts.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ describe('Smart contract behavior checks', () => {
// We manually provide a constant, since otherwise the exception would be thrown
// while estimating gas
await expect(counterContract.incrementWithRevert(5, true, { gasLimit: 5000000, gasPrice })).toBeReverted();
// await expect(
// counterContract.incrementWithRevert(5, true, { gasLimit: 5000000, gasPrice })
// ).toBeRevertedEstimateGas();

// The tx has been reverted, so the value Should not have been changed:
const newValue = await counterContract.get();
Expand Down
1 change: 1 addition & 0 deletions zk_toolbox/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ zksync_consensus_roles = "=0.3.0"
zksync_consensus_crypto = "=0.3.0"
zksync_protobuf = "=0.3.0"
zksync_types = { path = "../core/lib/types" }
zksync_web3_decl = { path = "../core/lib/web3_decl" }

# External dependencies
anyhow = "1.0.82"
Expand Down
1 change: 1 addition & 0 deletions zk_toolbox/crates/common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ async-trait = "0.1.68"

zksync_system_constants.workspace = true
zksync_types.workspace = true
zksync_web3_decl.workspace = true
1 change: 1 addition & 0 deletions zk_toolbox/crates/zk_inception/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ clap-markdown.workspace = true
zksync_consensus_roles.workspace = true
zksync_consensus_crypto.workspace = true
zksync_types.workspace = true
zksync_web3_decl.workspace = true
secrecy.workspace = true

[build-dependencies]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ lazy_static! {
.unwrap(),
);

static ref BRDIGEHUB_INTERFACE: BaseContract = BaseContract::from(
static ref BRIDGEHUB_INTERFACE: BaseContract = BaseContract::from(
parse_abi(&[
"function getHyperchain(uint256 chainId) public returns (address)"
])
Expand Down Expand Up @@ -174,7 +174,7 @@ pub async fn run(args: MigrateToGatewayArgs, shell: &Shell) -> anyhow::Result<()

// TODO: maybe move to using a precalculated address, just like for EN
let chain_id = U256::from(chain_config.chain_id.0);
let contract = BRDIGEHUB_INTERFACE
let contract = BRIDGEHUB_INTERFACE
.clone()
.into_contract(L2_BRIDGEHUB_ADDRESS, gateway_provider);

Expand Down

0 comments on commit f5120ef

Please sign in to comment.