Skip to content

deployProxy function does not return correct contract type #1082

Closed
@ryanc-bs

Description

I've encountered an issue using the deployProxy method with TypeScript.

When deployed without a proxy using ethers.deployContract, TypeScript is able to infer the correct type for the contract being deployed. For example, if I have a contract named MyContract with method foo then calling ethers.deployContract returns a MyContract instance with the required foo method.

This breaks when using deployProxy - instead of returning the correct contract type according to the factory type, it returns a generic Contract object which needs to be explicitly cast into the correct contract type from typechain-types.

Would it be possible to update deployProxy so that the correct type can be automatically inferred from the factory to avoid this ugly casting?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions