eth_estimateGas error

I keep on getting this error when using a deployed contract, but it only happens on chains other than Kovan

Error: cannot estimate gas; transaction may fail or may require manual gas limit 
[ See: https://links.ethers.org/v5-errors-UNPREDICTABLE_GAS_LIMIT ] 
(error={"code":-32000,"message":"execution reverted"}, method="estimateGas", 
transaction={"from":"0xD63b631e3A73ad517bddC618273d28871ba28897","to":
"0x4A59016c78E3A53cA3E92a47338976189B68cE2D","value":{"type":"BigNumber",
"hex":"0x02c68af0bb140000"},"data":"0xf305d71900000000000000000000000
0e4e81fa6b16327d4b78cfeb83aade04ba70751650000000000000000000000000
0000000000000000000001b9a317b26f8cd9d8400000000000000000000000000000000
000000000000001b9a317b26f8cd9d840000000000000000000000000000000000000000000000
0002c68af0bb140000000000000000000000000000d63b631e3a73ad517bddc618273d28871ba
288970000000000000000000000000000000000000000000000000000000062f
92d4c","accessList":null}, code=UNPREDICTABLE_GAS_LIMIT, version=providers/5.3.0)

Is there a fix to this?

Wait… I fixed it. Messed up on defining a variable in migrations

2 Likes

@Brfi
Thanks for letting us know! I’m glad you fixed it!

Excuse me, how did you fix it.

Hi, our contract was a fork of Uniswap v2’s core, so the error came up when we put in the wrong WETH address in our migrations file when deploying to chains other than Kovan