Add support for custom proxy factory
I've been playing around with various types of proxies and there is a fair bit of friction to putting them in prod due to poor testing infra.
Proxy examples: https://github.com/onboardmoney/solidity-version-proxy https://github.com/0age/Spawner
It would be great to be able to use the upgrades package and pass in a custom proxy factory
We will be adding a beacon proxy like Dharma's in OpenZeppelin Contracts soon, so this is something we're interested in as well.
Are there any updates so far? I'm playing around with the beacon proxy but I could not find any equivalents for deployProxy and upgradeProxy functions from the truffle upgrades plugin, which works with the beacon proxies.
No updates on this yet. Some thoughts on how the implementation should proceed:
We will need to parameterize deployProxy and upgradeProxy with a structure describing how to deploy and interact with the custom proxy. We seem to need these operations:
-
deploy(admin: address, impl: address, data: bytes): Promise<address> -
getCurrentImplementation(proxy: address): Promise<address> -
upgrade(proxy: address, newImpl: address): Promise<void>
There may be another operation needed to check that an upgrade will be possible with the current provider signer (i.e. if it is the right admin for the proxy), to avoid deploying an implementation if the upgrade will not be able to proceed.
For beacon proxies it's kind of weird that upgrading a single one will end up upgrading multiple proxies, I wish there was some way to make this more explicit in the API...