How to deploy/upgrade proxy through TypeChain?

With regular non-upgradeable contracts, the generated Typescript files from Typechain can be used to directly deploy a contract through the ContractFactory using its deploy function.

However, when using an upgradeable contract, the files generated from TyepChain doesn't have deployProxy and upgradeProxy. I have to go back to the upgrades module from the hardhat-upgrades plugin to deploy through hardhat.

Is there a way to deploy/upgrade an upgradeable contract and its proxy through TypeChain so that the whole process can be done in Typescript?

:computer: Environment

hardhat

It is not possible to deploy the proxy through TypeChain directly. You need to use deployProxy.

Also keep in mind that there is a bug where a TypeChain Factory will not type as the argument to deployProxy.

But I still encourage you to go ahead and find a way, I'm sure there is a workaround, and please share with us!