await routerContract
.addLiquidityETH(
daiAddress,
ethers.utils.parseEther(strDaiAmount),
ethers.utils.parseEther(strDaiSlippage),
ethers.utils.parseEther(strEthSlippage),
signerAddress,
Date.now() + 60000 * props.deadline,
{ value: ethers.utils.parseEther(strEthAmount) }
)
The above is working code. I am writing this question for further understanding.
I am having trouble understanding the final parameter of my smart contract... { value: ethers.utils.parseEther(strEthAmount) }
I added the final parameter as the code was throwing errors and I saw a thread saying that you have to add this parameter so that ethers knows that I am making a transaction. As far as I understand, the parameter is only passing the ether amount.
Another resolution that I tried was putting a .send method for my transaction. But ethers does not recognize the .send method.
If anyone could help to clear my confusion or give some pointers, I would be very grateful. Thanks!