Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for custom proxy factory #231

Closed
thegostep opened this issue Nov 19, 2020 · 5 comments
Closed

Add support for custom proxy factory #231

thegostep opened this issue Nov 19, 2020 · 5 comments

Comments

@thegostep
Copy link
Contributor

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

@frangio
Copy link
Contributor

frangio commented Nov 19, 2020

We will be adding a beacon proxy like Dharma's in OpenZeppelin Contracts soon, so this is something we're interested in as well.

@kiliw
Copy link

kiliw commented Feb 12, 2021

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.

@frangio
Copy link
Contributor

frangio commented Feb 12, 2021

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...

@frangio frangio changed the title add support for custom proxy factory Add support for custom proxy factory Mar 11, 2021
@gnarvaja
Copy link
Contributor

I'm pushing for this change. I submitted PR #1104 with tests and the use case that this change will unlock for me.

@ericglau
Copy link
Member

ericglau commented Dec 5, 2024

Fixed by #1104 and available in @openzeppelin/hardhat-upgrades@3.7.0

@ericglau ericglau closed this as completed Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants