-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: cannot estimate gas; transaction may fail or may require manual gas limit #13159
Comments
Hi. Did you fix this error? I have the same shit :/ |
I checked the Solidity documentation, and sometimes this is triggered simply by a transaction reverting. I don't know why some transactions reverting trigger this and some don't. |
Add |
Have you fixed it yet? Having the same issue using ether js and walletconnect provider. But works with injected Am doing: Edit: My bad, it was my mistake on contract. I was facing the issue for doing unhandled rejections. From my side the solution would be for this by debugging the contract if somehow it reverts the call by any unhandled rejection |
but what about in remix ide??? |
worked for me, Gracias man, you just saved my day! |
I had the same issue but solved it myselfI forgot to add the following line of code in my contract
|
Niceeee, well done man |
in my case, there is a line of code in the constructor that revert the transaction Check your code for any revert boyz |
where and how can i run this code please |
Hi const binary = fs.readFileSync(
"./SimpleStorage_sol_SimpleStorage.bin",
"utf8"
); and this fixes my error. And I mean that maybe your code (@lukehutch) has some bugs like that. |
This issue has been marked as stale due to inactivity for the last 90 days. |
Am having same issue. Any idea on how to solve it? |
Can you share the code of buy function? |
Same problem. I solved it in this way.
/blabla/createsmartaccount_dir/index.js /blabla/createsmartaccount_dir/package.json
npm install node ./index.js
|
My solve was to upgrade everything I could in my project relating to hardhat and ganache.
Out of nowhere some conflict between my packages was causing my configuration to no longer function as it used to.
|
Sometimes its working and sometimes not |
This issue has been marked as stale due to inactivity for the last 90 days. |
Hi everyone! This issue has been automatically closed due to inactivity. |
Have you tried specifically setting a higher gas limit?
Let me know if that helps! |
This comment was marked as off-topic.
This comment was marked as off-topic.
|
This is the exact error I'm having |
I've got same error. |
Hi I am getting same error but not getting where configuration for caller and owner , verified .env file and hardhat.config.js |
Description
I frequently get errors like the following:
This only happens occasionally (I'll include a testcase below), and it's always hard to fix. The only solution is to set
{gasLimit: 3e7}
in each contract function call.One thing that can trigger this problem is when the contract size approaches the maximum possible size. (Hopefully the testcase triggers this as a standalone program -- other contracts in my build environment raise the total size close to the limit.)
Environment
Steps to Reproduce
Contracts.sol
:index.js
:To trigger the error, you need to do two things:
gasLimit: 3e7
args.(bool success,) = to.call{value: msg.value}("");
into(bool success,) = to.call{value: msg.value}("x");
-- this should revert thecall
, becausereceive
functions require thatmsg.data.length == 0
. It's when this call tries to revert that the "cannot estimate gas" error seems to be triggered.The text was updated successfully, but these errors were encountered: