createChainPath.js 865 B

1234567891011121314151617
  1. task("createChainPath", "createChainPath function of a stargate router for initialization")
  2. .addParam("router", "The stargate Router address")
  3. .addParam("poolId", "the poolId")
  4. .addParam("dstChainId", "the destination chainId")
  5. .addParam("dstPoolId", "the destination poolId")
  6. .addParam("weight", "the pool weight for this path (default: 1)")
  7. .setAction(async (taskArgs) => {
  8. let accounts = await ethers.getSigners()
  9. let owner = accounts[0] // me
  10. console.log(`owner: ${owner.address}`)
  11. let Router = await ethers.getContractFactory("Router")
  12. let router = await Router.attach(taskArgs.router)
  13. let tx = await (await router.createChainPath(taskArgs.poolId, taskArgs.dstChainId, taskArgs.dstPoolId, taskArgs.weight)).wait()
  14. console.log(`tx.transactionHash: ${tx.transactionHash}`)
  15. })