Is your feature request related to a problem? Please describe.
Deploying upgradable contract implementing the popular proxy pattern requires having a proxy contract (P) with fallback selector (_) which redirects all calls to target contract (T).
Currently this needs to be done by deploying P, setting T's address in P's storage, then forgetting P from Contracts UI and reimporting it using P's address with T's metadata (to be able to call T's methods on P's instance)
Then, when an upgrade of T is needed, one needs to do the same forget+reimport trick twice:
forget contract, import again using P's address and P's metadata, to be able to do the call updating the address used as a proxy target
forget contract, import again using P's address and (updated T)'s metadata
This is not a big issue, just a slight annoyance, but it seems like the solution described below is quick and easy to implement.
Describe the solution you'd like
A button in "Metadata" tab on the contract's page which allows uploading new metadata.
Describe alternatives you've considered
An alternative would be to have a mechanism that allows to "merge" two pieces of metadata into one, so that the proxy contract's metadata has both calls for updating target address and target's calls. In other words, having something like an "additive contract API composer". Sound like much bigger project though, and still requires doing one forget+reimport trick when updating the target contract.
Is your feature request related to a problem? Please describe. Deploying upgradable contract implementing the popular proxy pattern requires having a proxy contract (P) with fallback selector (
_
) which redirects all calls to target contract (T). Currently this needs to be done by deploying P, setting T's address in P's storage, then forgetting P from Contracts UI and reimporting it using P's address with T's metadata (to be able to call T's methods on P's instance)Then, when an upgrade of T is needed, one needs to do the same forget+reimport trick twice:
This is not a big issue, just a slight annoyance, but it seems like the solution described below is quick and easy to implement.
Describe the solution you'd like A button in "Metadata" tab on the contract's page which allows uploading new metadata.
Describe alternatives you've considered An alternative would be to have a mechanism that allows to "merge" two pieces of metadata into one, so that the proxy contract's metadata has both calls for updating target address and target's calls. In other words, having something like an "additive contract API composer". Sound like much bigger project though, and still requires doing one forget+reimport trick when updating the target contract.