Skip to main content

Vault

The Vault is a simple app intended to store funds. It doesn't have a user interface, so it is typically installed in tandem with the Finance app to manage the funds inside of it.

Installing the App​

You can use this syntax to install the Vault:

install vault:new

There are no parameters needed to install a new vault to your DAO.

Common Usage Example​

The Vault is usually used alongside the Finance app, although it can be used alone. You can install it and grant Voting with the TRANSFER_ROLE.

load aragonos as ar

ar:connect exampleDAO token-manager voting (
install vault:new
grant voting vault:new TRANSFER_ROLE voting
)

After filling the Vault with some tokens, we can create a vote to send 1 ANT to our account with the following command:

load aragonos as ar

ar:connect exampleDAO token-manager voting (
exec vault transfer @token(ANT) @me 1e18
)
Installing Different App Versions
If you want to install a different version of an Aragon app other than the default, you can use this syntax:
install <appName> [parameters...] --version <versionNumber>

For example:

install voting:new @token(HNY) 90e16 20e16 3d --version 1.0.0

It would install a new Voting app, using version 1.0.0, with HNY as the voting token, 90% support required, 20% quorum, and three days vote duration.

Granting Permissions​

warning

This command can potentially burn a permission manager if it is set to the wrong address, making the permission unable to be changed in the future. This is because we usually want to set the main Voting app as the permission manager of all permissions.

The Vault only has one role it can give to other entities, TRANSFER_ROLE, which would allow a given entity to transfer the funds held in the Vault.

To grant permissions, you will use the following syntax:

grant <entity> <app> <roleName> [defaultPermissionManager]

Here is an exhaustive list of roles for the vault app:

  • TRANSFER_ROLE
    • Allows an entity to transfer tokens from the Vault's address.
Types of Entities

An entity is an Ethereum Address. It can be specified using the Ethereum Address directly, using the entity identifier, or using an address that represents any entity.

  • Specified Eth Address is expressed as the ETH address starting with 0x. Only this address will be the specified entity.
  • Identifier is the name of the internal Aragon App installed on your DAO, such as voting, token-manager (representing any token holder), or agent.
  • Anyone is expressed as ANY_ENTITY and can be any user visiting your DAO with a web wallet.
Grant via an Oracle
You can create a condition for a grant command to be issued by specifying an oracle app to check specific parameters, such as token ownership. Only if the oracle returns true then is the permission request approved. Here's the syntax of how to implement this:
grant <entity> <app> <roleName> [defaultPermissionManager] --oracle <oracleAppName>

An excellent example of that is the 1hive token oracle Aragon app, which is an ACL oracle that returns true when the address that acts has a specific token. So take a look at this example:

grant ANY_ENTITY voting CREATE_VOTES_ROLE voting --oracle token-oracle.open

This action would grant any entity permission to create votes if they have a specific token. The token and minimum amount of tokens needed to hold would be specified when the app is installed on the DAO.

Revoking Permissions​

To remove permission from an entity, follow this syntax:

revoke <entity> <app> <roleName> [removePermissionManager=false]

In practice, this could look like this:

revoke finance vault TRANSFER_ROLE

It would remove the ability for the Finance app to transfer funds held by the Vault, while keeping the Permission Manager in place should this permission need to be modified in the future.

Internal Actions​

Using the exec command, we can create internal actions.

We will use the transfer function to show the syntax of the exec command. The base syntax looks like this:

exec vault[:<id>] transfer <token> <to> <amount>

For example:

load aragonos as ar

ar:connect exampleDAO token-manager voting (
exec vault transfer @token(ANT) vault:1 100e18
)

It would create a vote to transfer 100 ANT tokens from the first Vault to the second Vault, given a second Vault is installed.

Below is an exhaustive list of all possible internal actions you can perform with the Vault app. In addition, we will identify the function in the contract and outline any parameters and permissions you need and the expected syntax to run them.

transfer

Transfers tokens from the Vault to a specified ETH address.

Parameters​

  • token - The token contract address of the token you wish to transfer. (address)
  • to - The ETH address to send tokens to. (address)
  • value - The number of tokens you wish to send, considering the decimal precision. (uint256)

Permissions​

The entity executing the action via the Vault will need the TRANSFER_ROLE role.

Syntax​

exec vault transfer <token> <to> <value>