-
Notifications
You must be signed in to change notification settings - Fork 29
Consider removing proxy creation from the responsibilities of App #210
Description
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.