I have built my own custom plugin for Aragon OSx, but I'm unsure how to install it into my Aragon DAO.
In order to use your plugin, you want to install it in your DAO. Installation is done through a proposal action - so that when the proposal passes, executing the action installs the plugin. You can understand "installation" as calling on the
prepareInstallation function from your plugin's
PluginSetup contract and granting the required permissions to the DAO so it can connect with the plugin.
Here's how to do it:
1. Prepare the plugin installation item:
In order to apply the installation, we will need to first prepare the plugin install item. We can do this through using the SDK function called
prepareInstallation item. https://devs.aragon.org/docs/sdk/examples/client/prepare-installation
2. Encode the action to apply the installation: In order to create a proposal with the installation action, we need encode the prepareInstallation action. You can do this through using this SDK function. https://devs.aragon.org/docs/sdk/examples/encoders-decoders/apply-installation
2. Create a proposal with an action: Now that the action is encoded, we can use it to pass it when creating the proposal. The easiest way to do this is to use our createProposalWithAction SDK function. https://devs.aragon.org/docs/sdk/examples/tokenVoting-client/create-proposal-with-actions -- keep in mind, depending on the governance mechanism you're using, you may want to check out the multisig version of "create proposal with action" also found within the docs
3. Approve proposal: Getting proposal approved by DAO members is the next step after publishing the proposal. This can happen through the Aragon App.
4. Execute action: Once the proposal is approved by members, you'll be able to execute the action into the DAO and your plugin will be installed! You can execute it through the Aragon App as well.
5. Using the plugin: To use the plugin, you can call on it's Plugin contract's address using a tool like ethers.js or wagmi hooks.
- Ethers: https://docs.alchemy.com/docs/ethers-js-contract
- Wagmi: https://wagmi.sh/react/hooks/useContract
-- updates coming on the developer experience side to streamline this process.
As a reference, plugins consist of two key contracts:
Plugincontract itself containing all the logic used to extend DAOs' functionalities
PluginSetupcontract which contains the installation/uninstallation logic for the plugin into the DAO
So - plugins can be installed in two different ways:
When you create your DAO
Via proposal when the DAO already exists
If you want to install your plugin upon DAO creation, you will need to pass the params that you want your
PluginSetupto receive. You can find detailed explanation about this here.
If you want to install on an already existing DAO, you will need:
- Run an unprivileged
prepareInstallation()function (found in the
PluginSetupProcessorcontract) so that your
PluginSetupdeploys the needed stuff and adds the "installation request" to the
- Use an existing plugin on the DAO (multisig, token voting, etc) to create a proposal that executes
applyInstallation(...)on the install you started before.
- Run an unprivileged
The concept of a Proposal, is something that every plugin decides to handle in its very own way. There is no DAO-level concept of a proposal. Plugin's have permissions, that's all the DAO knows.
So, if you want the DAO to execute something like applying the installation of a plugin, you'll need to ask a plugin with
EXECUTE_PERMISSION to go and handle it (via proposal, via dictatorship, via calling whatever address, etc -- this is based on the governance plugin of your DAO).
Regarding the SDK, there are two types of scenarios:
- The general purpose Client, which handles things that affect all DAOs
- The plugin-specific Clients
Future versions of the UI will greatly improve and expand on the case of a plugin using another one to create proposals. But as of today, the use case of installing a plugin after a DAO is created requires some manual handling on the SDK side still.