How to create your first custom DAO using Aragon CLI!
This guide will show you the process to deploy a blank DAO using Aragon CLI and configure it as a custom DAO for a cooperative organisation, let's say a cooperative of dairy farmers.
We assume you have a general understanding of Aragon stack.
Environment setup
Before starting you need to check if you have already installed all these prerequisites:
the right version of node.js (recommended
v12.7 LTS
version)the aragonCLI (Aragon Command Line Interface)
an IPFS server.
If installing IPFS on Linux, it can be easily done with: sudo snap install ipfs
If you haven't already installed them or if you need more info about this goes to the "Enviroment Setup" paragraph here.
Creating a blank DAO
Warning
Installing Frame is necessary for this step. Read here how to setup a Frame wallet. Select 'RINKEBY' network and make sure you open your new account (unfold it) in Frame for the transaction to appear.
Let's create a blank DAO! Insert and run the following command in your terminal:
In the Frame app now a 'permission request' from aragonCLI should show up. 'Sign' the request.
After this a transaction to create the DAO should show up in Frame, also 'sign' this transaction:
Hint
Make sure you have sufficient Rinkeby Ethereum (ETH) in your wallet for the transaction fees. If not you can request for Rinkeby ETH here. The transaction could take long. Increase the 'gas fees' to speed up the transaction.
Well done you just created your first DAO! You should now be able to open the DAO on: https://client.aragon.org/#/<dao-address>
Find the DAO address in the terminal, and make sure you select the 'Rinkeby' network in Aragon Client for your DAO to load (since Ethereum mainnet is default). You can change to Rinkeby network from here in the top right hand corner: https://client.aragon.org/#/
The DAO was created with the default bare-template
. So it won’t have a token manager, vault, finance, or voting app installed yet.
Note
The bare-kit
has been deprecated and bare-template
should be used instead. To learn more about templates check the introduction about them.
The above command used the --use-frame
and --env
flags. You can find other possible flags here, or by adding the --help
flag to the command.
Adding a Token and Token Manager to your DAO
Next we will add a token and a token-manager to your DAO. The following types of tokens can be created:
Membership
: a non-transferrable token limited to 1 per account.Reputation
: a non-transferrable token without balance restriction.Equity
: a transferrable token without balance restriction.
For the dairy cooperative we want to start with a membership token: one farmer, one member.
First we need to deploy a MiniMe token. The dao new token
command takes the following variables:
Note
The MiniMeToken contract is a standard ERC20 token with extra functionality.
For our membership token we take "Member"
as token-name
, with "MBR"
as symbol
.
We want to set decimal-units
to 0
(the default is 18
).
The default of tranfer-enabled
is true
. By leaving transfered-enabled
out of the command it takes the default value automatically, which is good for now since we will restrict transferability using the token-manager in a later step.
Warning
For the next step it is necessary to start an instance of Aragon Devchain. To do so open up an new tab or window in your terminal and run the following command:
aragon devchain --env aragon:rinkeby
So now run the following command in your terminal:
Copy the token address from the terminal as we will need it later!
Next we need to deploy an instance of the token-manager app which will serve as the token-controller for the membership token we just created.
Note
The token-manager cannot be initialized unless it's already the controller of a MiniMe token. So in this case we want to use the dao install
command with the --app-init none
flag. In that way we can perform some actions before we initialize the token-manager. Read more about this flag here.
Insert the DAO address in the below command and run it in your terminal:
In order to get the token-manager address we need to run the following command:
You should see a list of apps, and a token-manager instance listed under permissionless apps. Copy this address as we will need it later.
Next are going to set the token-address as the token-controller on our token, by running the following command:
Now we are creating a MINT_ROLE
permission for the token-manager so more farmers can be added as members to the dairy-DAO at a later point in time. Run the following command:
Warning
Make sure you do not accidentally include multiple spaces instead of 1 space between each variable in the command. Since if you do, you will run into this error:
✖ Not enough non-option arguments: got 4, need at least 5
We can now initialize the token manager using the dao exec
command. The token-manager’s initialise function takes 3 parameters:
minime token
: token-address of a MiniMe token.transferrable
: a boolean indicating if the token should be transferrable or not.uint
: determining max number of tokens an address can control (use0
if you do not want to restrict balances).
Note
You can find more info about dao exec
commands here.
We would not like dairy farmers to transfer their membership tokens, so we set the boolean to false
. Then we want one address to control a maximum of 1 membership token, so the unit
will be set to 1
. Insert the data of the variables in the below command, and run it in your terminal:
At this point if you open your DAO in a web browser you should be able to see the token manager app installed, and should be able to mint tokens from your-address
. Open your DAO UI from here: https://client.aragon.org/#/<dao-address>
Warning
Even though we have initialized the token manager as transferrable = false
, and token transfers fail, there is what appears to be a UI bug where the token manager will list the token as transferrable even though it is not. GitHub issue.
Adding a Voting App to your DAO
Adding a voting-app allows actions to be protected by a vote. This to ensure that the required support and quorum is reached in case of changes to your DAO. The dairy-DAO might want to transfer control to another member, such as change can then only be executed when the required majority of members is met.
Since we already have a token and token-manager deployed all we have to do is install the voting-app. This can be done in one step using the dao install
command and passing arguments via --app-init-args
.
The voting-app requires the following initialization parameters:
minime token
: token-address of a MiniMe token.support required percentage
: percentage of yeas in casted votes for a vote to succeed (expressed as a percentage of10^18
; eg.10^16 = 1%
,10^18 = 100%
).min accept quorum
: percentage of yeas in total possible votes for a vote to succeed (expressed as a percentage of10^18
; eg.10^16 = 1%
,10^18 = 100%
).vote time
: seconds that a vote will be open for token holders to vote (unless enough yeas or nays have been cast to make an early decision).
So if we want a voting-app instance with a support requirement of 60% and min accept quorum of 25% and a voting period of 7 days we would use the following command. Run the command in your terminal:
Next you will need to assign the create votes permission. If you want all token holders to be able to create votes, we can assign the CREATE_VOTES_ROLE
to the token-manager-address
.
The following command grants token holders (so all members of the dairy-DAO) the ability to create votes. Also from now a vote will be required to manage changes to the permissions. Run the command:
At this point you should be able to open your organization in the browser and be able to create votes! 👏
Note
You can find more info about dao acl
commands here.
Adding a Vault and Finance App
Note
The vault-app is intended to securely store and manage funds but does not have its own user interface (UI). The finance-app provides an interface for the vault-app and provides some limited budgeting capabilities. In the future, it may make sense to install the vault app without the finance app, or the finance app with a different version of the vault app, but for now these two apps generally make sense to install as a pair.
The vault-app can be installed without passing any specific initialization parameters. Run the following command in the terminal:
Copy the provided vault-address
from the terminal, which will be needed later.
The finance-app however requires two initialization parameters:
vault-address.
budgeting period
(in seconds).
If you are familiar with the finance-app in the UI, you may have noticed that there is not way to configure or set a budget. However, the smart-contracts allow you to set a per-asset budget which is reset each time period.
Eventually the UI will be updated to support these functions. If you don’t intend to use any of the budgetting functionality the budget period parameter doesn't matter but it does need to be passed. If you do plan on using the budgeting functionality however here is how it works:
For a given budget period P, a budget B can be set for asset A. The total volume of transfers of A cannot exceed its budget within a period P. So for example, if we initialize P as 1 Month, we could set a budget for DAI of 1000, and even if the vault contains more than 1000 DAI it will not be able to spend more than 1000 DAI per month. Keep in mind that the budget cannot be seen from the UI, so transactions which exceed the budget will just fail.
For demonstrations purposes, let's set install the finance-app with a budget period of 30 days (in seconds). Run the following command:
Now we want to create a permission that grants the finance-app the TRANSFER_ROLE
on the vault. For future possible changes we will also make voting required. Run the following command to do so:
We also want to grant some permissions to the voting app on the finance-app. In that way voting will be required do the dairy-DAO members wish to make changes to the roles. Run the follwoing commands in the terminal:
For more information on what each of these roles do as well as additional roles made available by the finance-app, see the repository.
At this point you should be able to open your custom DAO in the web browser and manage tokens, create votes, and manage funds using the vault and finance apps! 🎉
Review & Finalize Permissions
While we have a mostly functional dairy-DAO the permissions need to be cleaned up because we do not want our personal address to have root authority in the organization. These steps can be done from the permissions UI (see image below), or directly from Aragon CLI.
To see what permissions are currently assigned, run the following dao acl
command:
You will notice that some key permissions have been granted and are managed by the address you used to perform these commands. By following these steps you are transferring authority as creator of the organization to other applications and entities defined above,
Warning
Transferring permissions is an irreversible process, so be careful not to revoke a permission before granting it to an appropriate entity!
You’ll want to grant permissions which are currently only assigned to your address to another entity (eg. voting-address
):
You’ll want to revoke permissions for yourself once they have been granted to another entity:
You’ll want change the permission manager for permissions from your address to another entity (eg. voting-address
):
At this point you should have changed permissions. Well done you successfully set up a custom DAO for the dairy-farmers cooperation. Let's toast to that! 🐮🥛🥛🐮
Last updated