Skip to content

feat(cast): Get interface of proxy implementation with cast interface #4651

Open
@ckoopmann

Description

@ckoopmann

Component

Cast

Describe the feature you would like

Currently when using cast interface with an upgradeable proxy contract, it only generates the interface of the proxy and does not include the implementation functions which are usually of more interest.

At least for standard transparent proxy implementations where etherscan also provides the read as proxy / write as proxy options, it should be possible to get the abi of the implementation contract and generate an interface based on that.

Imo there are two options regarding the interface here:

  1. Always add the functions of the implementation contract to the interface (in addition to the proxy / update functions)
  2. Add --as-proxy flag to get the implementation interface instead of the proxy interface.

In the case of a simple proxy this just removes the extra step of the user having to manually look up the implementation address.
It would be more powerful though, if we could get this to work for Diamond proxys, where figuring out all the facets implementation manually can be non-trivial / time consuming. Being able to assemble the full contract interface automatically could be a big help there.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions