I want to create my own plugin for the aragonOSx framework, but I'm unsure whether I need to submit my plugin into Aragon's pluginRepo
or if I can use a developed plugin from a personal repoRegistry
contract?
1 Answer
You can build your own custom plugin!
Here's how: https://devs.aragon.org/docs/core/how-to-guides/plugin-development/implemention/
TLDR:
- you'll want to build your
Plugin
contract, which contains the logic of your plugin + build aPluginSetup
contract which contains all the instructions regarding installing, uninstalling, updating a plugin for a DAO. - then, you want to use the
createPluginRepoWithFirstVersion
function from thePluginRepoFactory.sol
contract and pass it the address of yourPluginSetup.sol
contract. And you're done - your plugin will be published in the aragonOSx protocol for anyone to use!!
Here's an example of an Aragon Multisig
plugin:
- Code: https://github.com/aragon/core/tree/develop/packages/contracts/contracts/voting/multisig
- Published plugin on Etherscan: https://goerli.etherscan.io/address/0x2F41BD1405E066749FFC719468ac8920BA815be1
For some additional context on publishing:
The way it works is the PluginSetup
contract holds a connection to your Plugin
contract and any other Helper
contracts. It is the one who sets the permissions for everything to work and presents the instructions on how to install this version of your Plugin
in your DAO.
So, what you're doing when you call on the createPluginRepoWithFirstVersion
from the PluginRepoFactory.sol
contract is that you're generating a PluginRepo
for your plugin with this specific PluginSetup
as your first version. That way, when you want to update your plugin, you can simply update the version in your PluginRepo
contract and submit a new PluginSetup
contract.
The PluginRepo
is your homebase for all versions of a given plugin and is an array filled with previous PluginSetup
contract addresses from previous versions.
For additional context if needed:
- Here is the
createPluginRepoWithFirstVersion
from thePluginRepoFactory
- which creates the first version of a plugin and adds it to thePluginRepoRegistry
: https://github.com/aragon/core/blob/develop/packages/contracts/src/framework/plugin/repo/PluginRepoFactory.sol#L48 - This is how the
PluginRepoFactory
knows thePluginRepoRegistry
: https://github.com/aragon/core/blob/da1278afd8263f7cc13973853bd3b58a352a1ec8/packages/contracts/src/framework/plugin/repo/PluginRepoFactory.sol#L15 - Once the
PluginRepo
with the initial version in it is created, subsequent versions are released through thePluginRepo
contract for that plugin, which is registered in thePluginRepoRegistry
after you call on thecreatePluginRepoWithFirstVersion
: https://github.com/aragon/core/blob/da1278afd8263f7cc13973853bd3b58a352a1ec8/packages/contracts/src/framework/plugin/repo/PluginRepo.sol#L134