Closed
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?
Metadata
Assignees
Labels
No labels
Activity