Skip to content

Commit

Permalink
add base_token_addr into contract configs
Browse files Browse the repository at this point in the history
  • Loading branch information
JayT106 committed Feb 3, 2024
1 parent e024af2 commit f36dec8
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/bin/external_node/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pub struct RemoteENConfig {
pub l1_weth_bridge_proxy_addr: Option<Address>,
pub l2_weth_bridge_addr: Option<Address>,
pub l2_testnet_paymaster_addr: Option<Address>,
pub base_token_addr: Option<Address>,
pub l2_chain_id: L2ChainId,
pub l1_chain_id: L1ChainId,

Expand Down Expand Up @@ -80,6 +81,7 @@ impl RemoteENConfig {
l2_erc20_bridge_addr: bridges.l2_erc20_default_bridge,
l1_weth_bridge_proxy_addr: bridges.l1_weth_bridge,
l2_weth_bridge_addr: bridges.l2_weth_bridge,
base_token_addr: bridges.base_token_addr,
l2_chain_id,
l1_chain_id,
fair_l2_gas_price: block_header.l2_fair_gas_price,
Expand Down Expand Up @@ -501,6 +503,7 @@ impl From<ExternalNodeConfig> for InternalApiConfig {
l2_erc20_default_bridge: config.remote.l2_erc20_bridge_addr,
l1_weth_bridge: config.remote.l1_weth_bridge_proxy_addr,
l2_weth_bridge: config.remote.l2_weth_bridge_addr,
base_token_addr: config.remote.base_token_addr,
},
diamond_proxy_addr: config.remote.diamond_proxy_addr,
l2_testnet_paymaster_addr: config.remote.l2_testnet_paymaster_addr,
Expand Down
2 changes: 2 additions & 0 deletions core/lib/config/src/configs/contracts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub struct ContractsConfig {
pub fri_recursion_leaf_level_vk_hash: H256,
pub prover_at_genesis: ProverAtGenesis,
pub snark_wrapper_vk_hash: H256,
pub base_token_addr: Option<Address>,
}

impl ContractsConfig {
Expand Down Expand Up @@ -77,6 +78,7 @@ impl ContractsConfig {
governance_addr: Address::repeat_byte(0x13),
prover_at_genesis: ProverAtGenesis::Fri,
snark_wrapper_vk_hash: H256::repeat_byte(0x09),
base_token_addr: Some(Address::repeat_byte(0x14)),
}
}
}
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 @@ -64,6 +64,7 @@ mod tests {
snark_wrapper_vk_hash: hash(
"0x4be443afd605a782b6e56d199df2460a025c81b3dea144e135bece83612563f2",
),
base_token_addr: Some(addr("8656770FA78c830456B00B4fFCeE6b1De0e1b888")),
}
}

Expand Down Expand Up @@ -99,6 +100,7 @@ CONTRACTS_FRI_RECURSION_NODE_LEVEL_VK_HASH="0x5a3ef282b21e12fe1f4438e5bb158fc506
CONTRACTS_FRI_RECURSION_LEAF_LEVEL_VK_HASH="0x72167c43a46cf38875b267d67716edc4563861364a3c03ab7aee73498421e828"
CONTRACTS_PROVER_AT_GENESIS="fri"
CONTRACTS_SNARK_WRAPPER_VK_HASH="0x4be443afd605a782b6e56d199df2460a025c81b3dea144e135bece83612563f2"
CONTRACTS_BASE_TOKEN_ADDR="0x8656770FA78c830456B00B4fFCeE6b1De0e1b888"
"#;
lock.set_env(config);

Expand Down
1 change: 1 addition & 0 deletions core/lib/types/src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ pub struct BridgeAddresses {
pub l2_erc20_default_bridge: Address,
pub l1_weth_bridge: Option<Address>,
pub l2_weth_bridge: Option<Address>,
pub base_token_addr: Option<Address>,
}

#[derive(Debug, Default, Clone, PartialEq, Serialize, Deserialize)]
Expand Down
1 change: 1 addition & 0 deletions core/lib/zksync_core/src/api_server/web3/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ impl InternalApiConfig {
l2_erc20_default_bridge: contracts_config.l2_erc20_bridge_addr,
l1_weth_bridge: contracts_config.l1_weth_bridge_proxy_addr,
l2_weth_bridge: contracts_config.l2_weth_bridge_addr,
base_token_addr: contracts_config.base_token_addr,
},
diamond_proxy_addr: contracts_config.diamond_proxy_addr,
l2_testnet_paymaster_addr: contracts_config.l2_testnet_paymaster_addr,
Expand Down
1 change: 1 addition & 0 deletions etc/env/base/contracts.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ FRI_RECURSION_LEAF_LEVEL_VK_HASH ="0x14628525c227822148e718ca1138acfc6d25e759e19
FRI_RECURSION_NODE_LEVEL_VK_HASH ="0x5a3ef282b21e12fe1f4438e5bb158fc5060b160559c5158c6389d62d9fe3d080"
FRI_RECURSION_SCHEDULER_LEVEL_VK_HASH ="0x61ed1ea338680a9f83945b300a4a4778dd76d74a015b43a3e9b7fedba914a3d0"
SNARK_WRAPPER_VK_HASH = "0x750d8e21be7555a6841472a5cacd24c75a7ceb34261aea61e72bb7423a7d30fc"
BASE_TOKEN_ADDR="0x5E6D086F5eC079ADFF4FB3774CDf3e8D6a34F7E9"

# Prover that should be used at genesis. 'fri' or 'snark'
PROVER_AT_GENESIS="fri"
Expand Down

0 comments on commit f36dec8

Please sign in to comment.