setWeightForChainPath.js 866 B

123456789101112131415161718
  1. task("setWeightForChainPath", "setWeightForChainPath function of a stargate router for initialization")
  2. .addParam("router", "The stargate Router address")
  3. .addParam("poolId", "the poolId")
  4. .addParam("destChainId", "the destination chainId")
  5. .addParam("weight", "the pool weight for this path (default: 1)")
  6. .setAction(async (taskArgs) => {
  7. console.log(`taskArgs: ${JSON.stringify(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 router.setWeightForChainPath(taskArgs.poolId, taskArgs.destChainId, taskArgs.weight, { gasLimit: 1000000 })
  14. console.log(`tx: ${JSON.stringify(tx)}`)
  15. })