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
Labels
kind:refactor
Refactor existing code without adding new features
topic:upgradeability
Upgreadeability for user contracts
Milestone
We currently have a
ProxyFactory
contract that provides an API to create proxies and initialize them. The functionality is exposed throughBaseApp
ascreate
andcreateAndCall
.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
andcreateAndCall
. We're only left with the downsides of forcing proxy creation to happen through the App: mainly that the originalmsg.sender
that requests the instance is lost. Another possible downside is that the App is stuck with one implementation ofProxy
, whereas if deployment happened separately it could use different versions ofProxy
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
andcreateAndCall
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.The text was updated successfully, but these errors were encountered: