cast/forge: preserve contract types when generating interfaces from ABI #8837
Labels
C-cast
Command: cast
Cmd-forge-inspect
Command: forge inspect
T-feature
Type: feature
T-post-V1
Area: to tackle after V1
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (143abd6 2024-09-04T00:24:41.963834000Z)
What command(s) is the bug in?
cast interface / forge inspect
Operating System
None
Describe the bug
To reproduce,
forge init
a new project and add this contract:When generating an interface, the function inputs and return type both are converted to
address
, which strips information. You can see theCounter
type is present in the ABI of Foo:But when generating interfaces:
I can see the rationale for this being that forge might not know what path to use for the
Counter
import. However, even if noimport
statement is provided, I would still prefer a stronger version of interface generation that preserves the internalCounter
type. Perhaps this should be behind a--preserve-internal-types
flagcc @smartcontracts
The text was updated successfully, but these errors were encountered: