You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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 namedMyContract
with methodfoo
then callingethers.deployContract
returns aMyContract
instance with the requiredfoo
method.This breaks when using
deployProxy
- instead of returning the correct contract type according to the factory type, it returns a genericContract
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?The text was updated successfully, but these errors were encountered: