From 9cef895086765011a7873eb03cb5c6ee1497c036 Mon Sep 17 00:00:00 2001 From: Matt Curtis Date: Wed, 6 Nov 2024 11:54:31 +0000 Subject: [PATCH] Fix: use L2 msg bus address --- .../testing/003_simple_withdrawal.ts | 3 ++- .../testnet/layer2/001_whitelist_tokens.ts | 10 +++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/contracts/deployment_scripts/testing/003_simple_withdrawal.ts b/contracts/deployment_scripts/testing/003_simple_withdrawal.ts index c265311c4f..2b447a07a1 100644 --- a/contracts/deployment_scripts/testing/003_simple_withdrawal.ts +++ b/contracts/deployment_scripts/testing/003_simple_withdrawal.ts @@ -63,8 +63,9 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const mgmtContractAddress = networkConfig.ManagementContractAddress; const messageBusAddress = networkConfig.MessageBusAddress; + const l2MessageBusAddress = networkConfig.L2MessageBusAddress; - var mbusBase = await hre.ethers.getContractAt("MessageBus", messageBusAddress); + var mbusBase = await hre.ethers.getContractAt("MessageBus", l2MessageBusAddress); const mbus = mbusBase.connect(await hre.ethers.provider.getSigner(deployer)); const tx = await mbus.getFunction("sendValueToL2").send(deployer, 1000, { value: 1000}); const receipt = await tx.wait() diff --git a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts index 3839e92782..c831f99bb3 100644 --- a/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts +++ b/contracts/deployment_scripts/testnet/layer2/001_whitelist_tokens.ts @@ -29,11 +29,11 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // Request the message bus address from the config endpoint const networkConfig: any = await hre.network.provider.request({ method: 'net_config' }); - if (!networkConfig || !networkConfig.MessageBusAddress) { - throw new Error("Failed to retrieve MessageBusAddress from network config"); + if (!networkConfig || !networkConfig.L2MessageBusAddress) { + throw new Error("Failed to retrieve L2MessageBusAddress from network config"); } - const messageBusAddress = networkConfig.MessageBusAddress; - console.log(`Loaded message bus address = ${messageBusAddress}`); + const l2messageBusAddress = networkConfig.L2MessageBusAddress; + console.log(`Loaded message bus address = ${l2messageBusAddress}`); // Tell the bridge to whitelist the address of HOC token. This generates a cross chain message. let hocResult = await l1Network.deployments.execute("ObscuroBridge", { @@ -103,7 +103,7 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { // Poll message submission await new Promise(async (resolve, fail)=> { setTimeout(fail, 30_000) - const messageBusContract = (await hre.ethers.getContractAt('MessageBus', messageBusAddress)); + const messageBusContract = (await hre.ethers.getContractAt('MessageBus', l2messageBusAddress)); const gasLimit = await messageBusContract.getFunction('verifyMessageFinalized').estimateGas(messages[1], { maxFeePerGas: 1000000001, })