Creating a DAO with all the desired apps and permissions requires multiple operations that must be properly orchestrated. In the context of Ethereum, performing all these operations would require sending many transactions. This would not only be very costly, as every transaction needs to pay for gas, also the integrity of the deployment depends on all operations occurring in the right order.
For these reasons, the recommended way of creating Aragon DAOs is using what we call templates, on-chain deployment scripts that create a DAO and perform all the required configuration steps in an atomic manner without the possibility of an attacker interacting with the DAO while it is still being set up. Templates allow creating a DAO in just one transaction and when the transaction is processed the DAO is already fully configured and functional.
Templates can also be thought of as DAO templates as every template can create a DAO with specific settings for an organization type.
Before starting you need to check if you have already installed all these prerequisites:
- the right version of node.js (recommended
- Metamask web3 provider
- the aragonCLI (Aragon Command Line Interface)
- the Aragon Buidler plugin
Now we are ready to build our DAO with the templates.
To quickly get started developing your own templates:
npx create-aragon-app app
Import this in the app under the
contractsfolder. Then install the
@aragon/templates-sharedpackage which contains contract, deployment, and testing utilities to help you build your own template.
Then to run your DAO enter:
When modifying the name of your contract or app name be sure to update those in
Template.solotherwise running the template will fail.
All templates follow a similar structure:
- 2.Assign the template contract the necessary permissions in the DAO needed for installation (usually only
- 3.Create app proxy instances for all the apps (
- 4.Initialize apps (
- 5.Set up permissions for the apps and the DAO.
- 6.Clean up the permissions temporarily assigned to the template.
Do you have a question? Leave your comments here at our Discourse forum 👇