Skip to content

Commit

Permalink
Fix: use L2 msg bus address
Browse files Browse the repository at this point in the history
  • Loading branch information
BedrockSquirrel committed Nov 6, 2024
1 parent bd52fb5 commit 9cef895
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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", {
Expand Down Expand Up @@ -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,
})
Expand Down

0 comments on commit 9cef895

Please sign in to comment.