Skip to content

Commit

Permalink
fix gateway address
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAtwill committed Nov 29, 2024
1 parent 9c4bfa3 commit d03dce8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions contracts/tasks/cross-network-messenger.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { task } from 'hardhat/config'
import { HardhatRuntimeEnvironment, TaskArguments } from 'hardhat/types'
import { Deployments } from './lib'
import { artifacts } from 'hardhat'

// step 1. deploy the cross network messenger util contract
// sample command: pnpm exec hardhat cross-network-messenger-deploy --network calibrationnet
// sample command: pnpm exec hardhat cross-network-messenger-deploy --network calibrationnet <SUBNET ETH ADDRESS>
task('cross-network-messenger-deploy')
.addPositionalParam('subnetAddress', 'the address of the subnet actor contract')
.setDescription('Deploy example cross network messenger util contract')
Expand All @@ -17,9 +16,14 @@ task('cross-network-messenger-deploy')
`Deploying cross network messenger contract with account: ${deployer} and balance: ${hre.ethers.utils.formatEther(balance.toString())}`,
)

const artifact = await hre.artifacts.readArtifact("SubnetActorGetterFacet")
const contract = new hre.ethers.Contract(args.subnetAddress, artifact.abi, hre.ethers.provider);
const gateway = await contract.ipcGatewayAddr();
console.log("queried ipc gateway", gateway);

await Deployments.deploy(hre, deployer, {
name: 'CrossMessengeCaller',
args: [args.subnetAddress],
args: [args.subnetAddress, gateway],
libraries: ['SubnetIDHelper'],
})
})
Expand Down

0 comments on commit d03dce8

Please sign in to comment.