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

Provide implementation of UUPS proxy pattern #2421

Closed
frangio opened this issue Dec 2, 2020 · 5 comments · Fixed by #2542
Closed

Provide implementation of UUPS proxy pattern #2421

frangio opened this issue Dec 2, 2020 · 5 comments · Fixed by #2542
Labels
feature New contracts, functions, or helpers.

Comments

@frangio
Copy link
Contributor

frangio commented Dec 2, 2020

EIP 1822 describes the UUPS proxy pattern. This pattern is simpler and should be cheaper as well, so we're interested in providing it as an alternative to the transparent proxy pattern.

@Amxx Amxx added the feature New contracts, functions, or helpers. label Jan 8, 2021
@Amxx
Copy link
Collaborator

Amxx commented Feb 24, 2021

@frangio
Copy link
Contributor Author

frangio commented Feb 24, 2021

The EIP as published on the eips site is using the "PROXIABLE" storage slot but there is an open PR that changes it to the same slot we use in our upgradeable proxies.

@Amxx
Copy link
Collaborator

Amxx commented Feb 25, 2021

With that change, it feels like the UpgradeableProxy we currently have is an UUPS proxy. The only missing brick would be an abstract class Proxiable (with a public proxiableUUID(), and an internal _updateCodeAddress that verifies this UUID). What do you think ?

@frangio
Copy link
Contributor Author

frangio commented Feb 25, 2021

Yeah that sounds good. I don't understand what the UUID is though. I couldn't find an explanation in the EIP.

It seems like it's a mechanism to avoid bricking the upgradeability mechanism. We had some other ideas for such mechanisms and I'm not sure the EIP should be opinionated on which one to implement. I think this is something we should discuss.

@Amxx
Copy link
Collaborator

Amxx commented Feb 25, 2021

The proxiableUUID() is just a function that returns the slot. It is used to verify that an implementation is "Proxiable". If not, you should not be able to update to it. This is a small security feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New contracts, functions, or helpers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants