Upgradeable Plugins
How to develop an Upgradeable Plugin
Upgradeable contracts offer advantages because you can cheaply change or fix the logic of your contract without losing the storage of your contract. If you want to review plugin types in depth, check out our guide on plugin types here.
The drawbacks however, are that:
- there are plenty of ways to make a mistake, and
- the changeable logic poses a new attack surface.
Although we've abstracted away most of the complications of the upgrade process through our PluginUUPSUpgradeable
base class, please know that writing an upgradeable contract is an advanced topic.
Prerequisites
- You have read about the different plugin types and decided to develop an upgradeable plugin being deployed via the UUPS pattern (ERC-1822).
- You know how to write a non-upgradeable plugin.
- You know about the difficulties and pitfalls of "Writing Upgradeable Contracts" that come with
- modifying the storage layout
- initialization
- inheritance
- leaving storage gaps
Up next, check out our guides on:
- How to initialize an Upgradeable Plugins
- How to build the implementation of an Upgradeable Plugin
- How to build and deploy a Plugin Setup contract for an Upgradeable Plugin
- How to create a subsequent build implementation to an Upgradeable Plugin
- How to upgrade an Upgradeable Plugin
- How to publish my plugin into the Aragon OSx protocol