Skip to content
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

Having "Insufficient funds" in require message causing "insufficient funds for intrinsic transaction cost" unrelated error to be thrown #2489

Closed
ishayhil opened this issue Mar 14, 2022 · 8 comments
Assignees

Comments

@ishayhil
Copy link

ishayhil commented Mar 14, 2022

Reproduce steps

run (on hardhat network)

require(1 > 2, Insufficient funds)

and receive
Error: insufficient funds for intrinsic transaction cost
instead of
Insufficient funds

For some reason, if the require message contains "insufficient funds", the "insufficient funds for intrinsic transaction cost" pops.

@ishayhil ishayhil changed the title Having "Insufficient funds Having "Insufficient funds" in require causing "insufficient funds for intrinsic transaction cost" error to be thrown Mar 14, 2022
@ishayhil ishayhil changed the title Having "Insufficient funds" in require causing "insufficient funds for intrinsic transaction cost" error to be thrown Having "Insufficient funds" in require message causing "insufficient funds for intrinsic transaction cost" error to be thrown Mar 14, 2022
@ishayhil ishayhil changed the title Having "Insufficient funds" in require message causing "insufficient funds for intrinsic transaction cost" error to be thrown Having "Insufficient funds" in require message causing "insufficient funds for intrinsic transaction cost" unrelated error to be thrown Mar 14, 2022
@ta5een
Copy link

ta5een commented Mar 15, 2022

Hi, I'm also getting this unusual error! Seems that if the reason string contains "Insufficient funds" anywhere, Hardhat treats it specially. I don't think that's supposed to happen, otherwise the Hardhat documentation would have mentioned this behaviour somewhere.

@narghev
Copy link

narghev commented Mar 29, 2022

Any news on this?

@fvictorio fvictorio assigned fvictorio and unassigned kanej Mar 29, 2022
@fvictorio
Copy link
Member

It's possible that this is caused by the latest version(s) of ethers. Anyone running into this: can you try downgrading ethers and trying again? Thanks.

@fvictorio
Copy link
Member

Hmm, it is caused by ethers but it's not a recent change:

https://github.com/ethers-io/ethers.js/blob/ef1b28e958b50cea7ff44da43b3c5ff054e4b483/packages/providers/src.ts/json-rpc-provider.ts#L80

Sadly I can't think of a workaround right now.

@github-actions
Copy link
Contributor

This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 28, 2022
@fvictorio
Copy link
Member

I believe this is a problem in ethers, so I submitted an issue there: ethers-io/ethers.js#2954. Closing this one for now.

@AliNawaz-777
Copy link

Insufficient balance
Is any help when I try to run the testcase then get the error Insufficient balance'

@jason-gigastar
Copy link

I just ran into this myself:

Broken:     require(..., 'PREFIX: Insufficient funds');
Resolved 1: require(..., 'PREFIX: Insufficient Xfunds');
Resolved 2: require(..., 'PREFIX: Insufficient Balance');

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants