Problem
I am trying to use a method of a contract on the test network (ropsten), but it fails due to this error:
reason: 'cannot estimate gas; transaction may fail or may require manual gas limit', code: 'UNPREDICTABLE_GAS_LIMIT'
Code
I created an instance of the smart contract and wanted to call it's register method:
const registrationContract = new ethers.Contract(ADDRESS, abi, signer);
const hashedDomain = utils.keccak256(utils.toUtf8Bytes(domain));
const register = await registrationContract.register(hashedDomain, walletAddress);
Does ethers.js provide a function to set the limit on the contract? Or can this be done otherwise? I didn't find one in the documentation.
x
with :uniswap.swapExactTokensForETH(tokenAmount, ethAmount, etc., {gasLimit: x})
– Morass