@here I've been trying to get addLiquidityETH working for a whole week now and I've been trying to test this on Kovan. I am using the Uniswap Javascript SDK and when using the chainId 42, which is Kovan, I get this runtime error message:
Apr 19, 2021, 10:51 PM
invalid address (argument="address", value={"decimals":18,"chainId":42,"address":"0xfdf7f21EDA1fB8AeBEd2FC8b0e8F72a8f17cf823"}, code=INVALID_ARGUMENT, version=address/5.1.0) (argument="token", value={"decimals":18,"chainId":42,"address":"0xfdf7f21EDA1fB8AeBEd2FC8b0e8F72a8f17cf823"}, code=INVALID_ARGUMENT, version=abi/5.0.7)
The address "0xfdf7f21EDA1fB8AeBEd2FC8b0e8F72a8f17cf823", shows transactions in Kovan.
this is supposed to be the DAI address in Kovan
nvm figured out what I was doing wrong.
Anyone here used ethers.js? I can't seem to get the syntax right for sending transaction.
I have this setup:
const provider = ethers.getDefaultProvider('kovan', {
infura: process.env.KOVAN_INFURA
})
const signer = new ethers.Wallet(process.env.KOVAN_PRIVATEKEY)
const account = signer.connect(provider)
infura: process.env.KOVAN_INFURA
})
const signer = new ethers.Wallet(process.env.KOVAN_PRIVATEKEY)
const account = signer.connect(provider)
this is the parameters I want to send:
const _params = [{
gasPrice: new BigNumber( (gweisafelow.toString()).padEnd(11,0) ), //'0x09184e72a000', // customizable by user during MetaMask confirmation.
gasLimit: new BigNumber( (gweisafelow.toString()).padEnd(11,0) ), // customizable by user during MetaMask confirmation.
from: process.env.KOVAN_WALLETADDRESS, // must match user's active address.
value: new BigNumber(amountIn), // Only required to send ether to the recipient from the initiating external account.
data: anathalp.methods.appAddLiquidityETH(
process.env.KOVAN_DAI,
amountIn,
amountTokenMin,
amountETHMin,
process.env.KOVAN_WALLETADDRESS,
deadline).encodeABI()
}];
gasPrice: new BigNumber( (gweisafelow.toString()).padEnd(11,0) ), //'0x09184e72a000', // customizable by user during MetaMask confirmation.
gasLimit: new BigNumber( (gweisafelow.toString()).padEnd(11,0) ), // customizable by user during MetaMask confirmation.
from: process.env.KOVAN_WALLETADDRESS, // must match user's active address.
value: new BigNumber(amountIn), // Only required to send ether to the recipient from the initiating external account.
data: anathalp.methods.appAddLiquidityETH(
process.env.KOVAN_DAI,
amountIn,
amountTokenMin,
amountETHMin,
process.env.KOVAN_WALLETADDRESS,
deadline).encodeABI()
}];
any help is appreciated
this is all from Nodejs
Apr 19, 2021, 11:33 PM