Skip to content

Better error reporting when interacting with undeployed contracts #4141

@PaulRBerg

Description

@PaulRBerg

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.:

You have attempted to make a call to address 0xCAFE..., but not contract is present there

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Completed

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions