-
Notifications
You must be signed in to change notification settings - Fork 2k
Better error reporting when interacting with undeployed contracts #4141
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
Comments
Another related use case - calling undeployed library functions. When library functions are declared as public or external, the library must be deployed separately and then linked before it can be used. |
sg @PaulRBerg — agreed we could probably improve this error. Will take a stab at this during the next week to see if we can improve this |
I've bumped into the same situation again and spent ~15 minutes that would have been spared had Foundry detected that the contract doesn't exist on the network. cc @grandizzy I suspect this is a common debugging situation, especially when running tests against mainnet forks. |
Component
Forge
Describe the feature you would like
I have bumped into many
EvmError
errors that were caused by an attempt to interact with a contract which was either undeployed already or was deployed to a local network and by the time I was making the call, the contract did no longer exist because I had used a fork cheatcode.I think that this is such a common scenario that it would be extremely helpful (and prevent many angry reports in the Foundry Support group) for Foundry to handle this sort of error more gracefully and display a clearer error, e.g.:
The text was updated successfully, but these errors were encountered: