addLiquidityForEth.js 644 B

12345678910111213141516
  1. task("addLiquidityForEth", "add liquidity to mirrorgate instance")
  2. .addParam("qty", "the qty of tokens to add")
  3. .setAction(async (taskArgs) => {
  4. let accounts = await ethers.getSigners()
  5. let owner = accounts[0]
  6. // factory / router
  7. const router = await ethers.getContract("RouterETH")
  8. const qtyEth = ethers.utils.parseEther(taskArgs.qty);
  9. console.log("transfer to router", qtyEth.toString())
  10. // return;
  11. let tx = await (await router.addLiquidityETH({
  12. value: qtyEth,
  13. })).wait(1)
  14. console.log(`💦 addLiquidity | tx: ${tx.transactionHash}`)
  15. })