Skip to content
This repository has been archived by the owner on Jul 11, 2019. It is now read-only.

Consider removing proxy creation from the responsibilities of App #210

Open
frangio opened this issue Jul 16, 2018 · 0 comments
Open

Consider removing proxy creation from the responsibilities of App #210

frangio opened this issue Jul 16, 2018 · 0 comments
Labels
kind:refactor Refactor existing code without adding new features topic:upgradeability Upgreadeability for user contracts
Milestone

Comments

@frangio
Copy link
Contributor

frangio commented Jul 16, 2018

We currently have a ProxyFactory contract that provides an API to create proxies and initialize them. The functionality is exposed through BaseApp as create and createAndCall.

The main motivation behind these functions was to provide an atomic way to create a proxy and initialize it. This was needed because with initializer functions initialization is a function call separate from contract creation. With the upcoming initializer contracts model (OpenZeppelin/openzeppelin-labs#120), initialization is done atomically at the moment the proxy is created.[1]

Since the atomicity will already be guaranteed, it's no longer a motivation for create and createAndCall. We're only left with the downsides of forcing proxy creation to happen through the App: mainly that the original msg.sender that requests the instance is lost. Another possible downside is that the App is stuck with one implementation of Proxy, whereas if deployment happened separately it could use different versions of Proxy if there are new optimizations or features.

Additionally, we think reducing the interface and the responsibilities of App is a good idea.

Thus, we want to consider removing create and createAndCall from App, and to deploy proxies with normal contract creation transactions.


[1] After discussing this we realized that we could already guarantee atomicity by invoking the initializer function through a delegatecall directly to the logic contract in the proxy constructor. We may want to implement this now by changing the proxy in this way, instead of waiting for initializer contracts to land.

@frangio frangio added kind:discussion To discuss on a task before implementing it kind:refactor Refactor existing code without adding new features labels Jul 16, 2018
@facuspagnuolo facuspagnuolo added this to the Backlog milestone Jul 23, 2018
@facuspagnuolo facuspagnuolo modified the milestones: Backlog, v2.0.0 Sep 13, 2018
@facuspagnuolo facuspagnuolo added topic:upgradeability Upgreadeability for user contracts and removed kind:discussion To discuss on a task before implementing it labels Sep 13, 2018
@facuspagnuolo facuspagnuolo modified the milestones: v2.0.0, Backlog Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind:refactor Refactor existing code without adding new features topic:upgradeability Upgreadeability for user contracts
Projects
None yet
Development

No branches or pull requests

2 participants