You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a solidity contract function is invoked, ethers first attempts to estimate the gas needed for the transaction. If the function errors, a generic Error: cannot estimate gas; transaction may fail or may require manual gas limit error is thrown.
One workaround is to specify the gasLimit override for every function call. That's pretty cumbersome and easy to forget.
Is there a better way to avoid the generic errors and see useful revert reasons?
The text was updated successfully, but these errors were encountered:
I checked out the main branch and ran the tests. I saw some errors running typechain, but they went away when I blew away the artifacts folder. When I ran yarn I got loads of changes to yarn.lock.
When I ran the tests, I saw the revert reason:
Error: cannot estimate gas; transaction may fail or may require manual gas limit (error="Error: VM Exception while processing transaction: reverted with reason string 'foobar'", tx={"da...
I saw the same with and without setting a manual gas limit.
I wonder if there could be some mismatch in ethers versions causing the different behaviour on our machines? Without an identical yarn.lock file, it’s hard to rule that out. #68
@geoknee, thanks for looking into this! For future reference, if you use yarn 3.1.0 (or, likely, any somewhat recent version of yarn), you shouldn't see yarn.lock changes.
When a solidity contract function is invoked,
ethers
first attempts to estimate the gas needed for the transaction. If the function errors, a genericError: cannot estimate gas; transaction may fail or may require manual gas limit
error is thrown.One workaround is to specify the
gasLimit
override for every function call. That's pretty cumbersome and easy to forget.Is there a better way to avoid the generic errors and see useful revert reasons?
The text was updated successfully, but these errors were encountered: