Skip to content

Instantly share code, notes, and snippets.

@pythonpete32
Created August 15, 2019 17:44
Show Gist options
  • Save pythonpete32/7eb18b159cfe8e43f726feda7bfd29da to your computer and use it in GitHub Desktop.
Save pythonpete32/7eb18b159cfe8e43f726feda7bfd29da to your computer and use it in GitHub Desktop.
Redemptions set up guide
# Redemptions set up guide
---
### 1. Deploy a fresh dao
Head over to the [rinkeby DAO launcher](rinkeby.aragon.org) and create a DAO with the democracy kit
Go to the settings tab where you will find the addresses for the DAO and its apps. For legibility of subsequent commands will set bash environment variable for these addresses:
`dao=0x6604f9fe9Db1D3F6a45d8F0ab79e8a4B05968816
token=0x7F42cEB659B944cBB9F3D5ED637f66818C1bAcbf
voting=0x41CA57d1e65Cdcd3A68A0e9f8E835F3a1FeDc655
vault=0x04b46b9e0c1f893cA50Cb35F096d14dD946DEf95`
---
### 2. Install Redemptions App
Redemptions has been published to APM on rinkeby at `redemptions.open.aragonpm.eth`
To deploy to an organization you can use the [Aragon CLI](https://hack.aragon.org/docs/cli-intro.html).
```sh
aragon dao install $dao redemptions.open.aragonpm.eth --app-init-args $vault $token --environment aragon:rinkeby
```
The default setup of the democracy DAO is for a vote of the token holders to take place before actions are executed. Head over to the voting app and you will see a new vote
---
### 3. Set up Permissions
Before the Redemptions app displays in the UI you must set a permission on it. First, get the address of the Redemptions app
```sh
dao apps $dao --all --environment aragon:rinkeby
```
Next, copy the proxy address of the permissionless app and create another environment variable `redemptions=0x4dA76c5B30b5a289Cb8f673Ba71A1A20bd37a00c`
---
Three permissions need to be created for the Redemptions app to function properly
- `REDEEM_ROLE`
- `ADD_TOKEN_ROLE`
- `REMOVE_TOKEN_ROLE`
After setting one of these roles the Redemptions App will appear in the UI
```sh
dao acl create $dao $redemptions REDEEM_ROLE $token $voting --environment aragon:rinkeby
```
This grants token holders the permission to redeem tokens and sets the voting app as the controller. Again like the rest of the commands that change state, you must first vote before the action takes affect.
```sh
dao acl create $dao $redemptions ADD_TOKEN_ROLE $voting $voting --environment aragon:rinkeby
```
This grants the voting app the permission to add tokens to the list of redeemable tokens and sets it as the controller
```sh
dao acl create $dao $redemptions REMOVE_TOKEN_ROLE $token $voting --environment aragon:rinkeby
```
This grants the voting app the permission to remove tokens from the list of redeemable tokens and sets it as the controller
---
The Redemptions app must also have the `TRANSFER_ROLE` permission on `Vault` and the `BURN_ROLE` permission on the `Token Manager`.
```sh
dao acl create $dao $token BURN_ROLE $redemptions $voting --environment aragon:rinkeby
```
```sh
dao acl create $dao $vault TRANSFER_ROLE $redemptions $voting --environment aragon:rinkeby
```
---
### 4. Testing the Redemptions app
Before we test out Redemptions, we are going to need some tokens to redeem and some assets to redeem them for
Go back to the settings tab and press the request tokens button a few times. This will deposit some tokens into the vault.
Open the finance app and you will see a number of deposits, you will need the contract address of the tokens you want to add to redemptions.
Choose one of the transactions and view it on etherscan, find the contract address, copy it and head over to the redemptions app.
Click add token and paste in the contract address.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment