Skip to content

Commit

Permalink
feat: upgrade apps to 0.7 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai authored Apr 16, 2019
1 parent f5b3c23 commit b9d9a6c
Show file tree
Hide file tree
Showing 8 changed files with 46 additions and 65 deletions.
8 changes: 4 additions & 4 deletions kits/beta-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@
"@aragon/os": "^4.2.0",
"@aragon/apps-shared-minime": "^1.0.0",
"@aragon/apps-shared-migrations": "^1.0.0",
"@aragon/apps-voting": "^2.0.0",
"@aragon/apps-vault": "^4.0.0",
"@aragon/apps-finance": "^2.1.0",
"@aragon/apps-token-manager": "^2.0.0",
"@aragon/apps-voting": "^2.1.0",
"@aragon/apps-vault": "^4.1.0",
"@aragon/apps-finance": "^3.0.0",
"@aragon/apps-token-manager": "^2.1.0",
"@aragon/kits-base": "^1.0.0"
}
}
31 changes: 7 additions & 24 deletions kits/beta-base/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Aragon 0.5 beta templates
# Aragon 0.7 beta templates

## Description

Expand All @@ -18,9 +18,9 @@ distribution.

## Usage

Both templates require 2 transactions to completely set up an organization.
One to create the token (which is cached in the template) and one to create the
organization and finish the setup.
Both templates may require 2 transactions to completely set up an organization, due
to gas costs: one to create the token (which is cached in the template) and one to
create the organization and finish the setup.

- Both transactions have to be done by the same sender (cache reasons).
- Thanks to account nonces, we can prompt the user to sign and broadcast both
Expand All @@ -29,7 +29,8 @@ and we can be sure that they will be mined in order.
Metamask will probably tell the user the second transaction will fail, but that's
because they don't know better (they don't calculate the state as if the first
transaction was already mined).
- Addresses for deployed templates can be found in `index.js`.
- Addresses for deployed templates on individual networks can be found in
[`aragon/deployments`](https://github.com/aragon/deployments).

### 1. Token creation

Expand All @@ -48,7 +49,7 @@ Then see each template's documentation for their own specific transactions.
## ENS, APM and aragonID

Our fake ENS instance that we use across the entire system can also be found in
`index.js`.
[`aragon/deployments`](https://github.com/aragon/deployments).

Using it as the ENS registry, we can find everything else by using ENS.

Expand All @@ -74,14 +75,6 @@ are managed by different team members.
Templates will deploy the last version of the apps according to their APM repos,
this will allow us to update the apps without the need to update templates.

For our Rinkeby deployment we are using a custom ENS deployment. This is fairly
trustful as an account we control is the ENS root.

```
ENS: 0xaa0ccb537289d226941745c4dd7a819a750897d0
APM: 0x8da0fe11ece85f48723d45c3d6767db9bd4f0b29
```

Repos can be found by resolving the repo appId in ENS (e.g. `ens.resolve('voting.aragonpm.eth')`).
New versions have to be submitted directly to the repo address. If you don't
have permission to do so, please ask the permission manager (aka Jorge).
Expand All @@ -92,16 +85,6 @@ have permission to do so, please ask the permission manager (aka Jorge).
name of an existing one will fail. For the client, an easy way to check is
whether `[name].aragonid.eth` owner's is `0x00...00`

## Gas costs

As of Feb 14th (❤️) the costs of deploying a fully working organization are:

- `template.newToken(...)`: ~2.4m gas
- `template.newInstance(...)`: ~6.08m gas

Which total in 106% of a mainnet block worth of gas, making deploying an Aragon org
cheaper than $100 at given current gas and ETH prices.

## Deploying templates

See instructions in each template's individual documentation.
8 changes: 4 additions & 4 deletions kits/democracy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"@aragon/os": "^4.2.0",
"@aragon/apps-shared-minime": "^1.0.0",
"@aragon/apps-shared-migrations": "^1.0.0",
"@aragon/apps-voting": "^2.0.0",
"@aragon/apps-vault": "^4.0.0",
"@aragon/apps-finance": "^2.1.0",
"@aragon/apps-token-manager": "^2.0.0",
"@aragon/apps-voting": "^2.1.0",
"@aragon/apps-vault": "^4.1.0",
"@aragon/apps-finance": "^3.0.0",
"@aragon/apps-token-manager": "^2.1.0",
"@aragon/kits-base": "^1.0.0",
"@aragon/kits-beta-base": "^1.0.0"
}
Expand Down
39 changes: 19 additions & 20 deletions kits/democracy/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Aragon 0.5 Democracy template
# Aragon 0.7 Democracy template

See [Beta templates description](https://github.com/aragon/dao-kits/blob/master/kits/beta-base/readme.md).

Expand All @@ -15,32 +15,31 @@ democracy.newInstance(name, holders, stakes, supportNeeded, minAcceptanceQuorum,

## Deploying templates

After deploying ENS, APM and AragonID. Change `index.js` ENS address for the
deployment network.

Then just:
After deploying ENS, APM and AragonID, just run:

```
npm run deploy:rinkeby
```

The network details will be automatically selected by the `arapp.json`'s environments.

## Permissions

| App | Permission | Grantee | Manager |
|-------------------|-----------------------|---------|---------|
| Voting | CREATE_VOTES | Any | Voting |
| Voting | MODIFY_QUORUM | Voting | Voting |
| Voting | MODIFY_SUPPORT | None | Burned |
| Vault | TRANSFER | Finance | Voting |
| Finance | CREATE_PAYMENTS | Voting | Voting |
| Finance | EXECUTE_PAYMENTS | Voting | Voting |
| Finance | DISABLE_PAYMENTS | Voting | Voting |
| Token Manager | ASSIGN | Voting | Voting |
| Token Manager | REVOKE_VESTINGS | Voting | Voting |
| Kernel | APP_MANAGER | Voting | Voting |
| ACL | CREATE_PERMISSIONS | Voting | Voting |
| EVMScriptRegistry | REGISTRY_ADD_EXECUTOR | Voting | Voting |
| EVMScriptRegistry | REGISTRY_MANAGER | Voting | Voting |
| App | Permission | Grantee | Manager |
|-------------------|-----------------------|---------------|---------|
| Voting | CREATE_VOTES | Token Manager | Voting |
| Voting | MODIFY_QUORUM | Voting | Voting |
| Voting | MODIFY_SUPPORT | None | Burned |
| Vault | TRANSFER | Finance | Voting |
| Finance | CREATE_PAYMENTS | Voting | Voting |
| Finance | EXECUTE_PAYMENTS | Voting | Voting |
| Finance | DISABLE_PAYMENTS | Voting | Voting |
| Token Manager | ASSIGN | Voting | Voting |
| Token Manager | REVOKE_VESTINGS | Voting | Voting |
| Kernel | APP_MANAGER | Voting | Voting |
| ACL | CREATE_PERMISSIONS | Voting | Voting |
| EVMScriptRegistry | REGISTRY_ADD_EXECUTOR | Voting | Voting |
| EVMScriptRegistry | REGISTRY_MANAGER | Voting | Voting |

## Gas usage

Expand Down
4 changes: 2 additions & 2 deletions kits/democracy/test/democracy.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ contract('Democracy Kit', accounts => {
beforeEach(async () => {
// Fund Finance
await finance.sendTransaction({ value: payment, from: owner })
const action = { to: financeAddress, calldata: finance.contract.newPayment.getData(ETH, nonHolder, payment, 0, 0, 1, "voting payment") }
const action = { to: financeAddress, calldata: finance.contract.newImmediatePayment.getData(ETH, nonHolder, payment, "voting payment") }
script = encodeCallScript([action])
const action2 = { to: voting.address, calldata: voting.contract.newVote.getData(script, 'metadata') }
const script2 = encodeCallScript([action2])
Expand All @@ -396,7 +396,7 @@ contract('Democracy Kit', accounts => {

it('finance can not be accessed directly (without a vote)', async () => {
try {
await finance.newPayment(ETH, nonHolder, 2e16, 0, 0, 1, "voting payment")
await finance.newImmediatePayment(ETH, nonHolder, 2e16, "voting payment")
} catch (err) {
assert.equal(err.receipt.status, 0, "It should have thrown")
return
Expand Down
8 changes: 4 additions & 4 deletions kits/multisig/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
"@aragon/os": "^4.2.0",
"@aragon/apps-shared-minime": "^1.0.0",
"@aragon/apps-shared-migrations": "^1.0.0",
"@aragon/apps-voting": "^2.0.0",
"@aragon/apps-vault": "^4.0.0",
"@aragon/apps-finance": "^2.1.0",
"@aragon/apps-token-manager": "^2.0.0",
"@aragon/apps-voting": "^2.1.0",
"@aragon/apps-vault": "^4.1.0",
"@aragon/apps-finance": "^3.0.0",
"@aragon/apps-token-manager": "^2.1.0",
"@aragon/kits-base": "^1.0.0",
"@aragon/kits-beta-base": "^1.0.0"
}
Expand Down
9 changes: 4 additions & 5 deletions kits/multisig/readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Aragon 0.5 beta templates
# Aragon 0.7 Multisig template

See [Beta templates description](https://github.com/aragon/dao-kits/blob/master/kits/beta-base/readme.md).

Expand All @@ -16,15 +16,14 @@ multisig.newInstance(name, signers, neededSignatures)

## Deploying templates

After deploying ENS, APM and AragonID. Change `index.js` ENS address for the
deployment network.

Then just:
After deploying ENS, APM and AragonID, just run:

```
npm run deploy:rinkeby
```

The network details will be automatically selected by the `arapp.json`'s environments.

## Permissions

| App | Permission | Grantee | Manager |
Expand Down
4 changes: 2 additions & 2 deletions kits/multisig/test/multisig.js
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ contract('Multisig Kit', accounts => {
//await logBalances(financeAddress, vaultAddress)
await finance.sendTransaction({ value: payment, from: owner })
//await logBalances(financeAddress, vaultAddress)
const action = { to: financeAddress, calldata: finance.contract.newPayment.getData(ETH, nonHolder, payment, 0, 0, 1, "voting payment") }
const action = { to: financeAddress, calldata: finance.contract.newImmediatePayment.getData(ETH, nonHolder, payment, "voting payment") }
script = encodeCallScript([action])
const action2 = { to: voting.address, calldata: voting.contract.newVote.getData(script, 'metadata') }
const script2 = encodeCallScript([action2])
Expand All @@ -362,7 +362,7 @@ contract('Multisig Kit', accounts => {

it('finance can not be accessed directly (without a vote)', async () => {
try {
await finance.newPayment(ETH, nonHolder, 2e16, 0, 0, 1, "voting payment")
await finance.newImmediatePayment(ETH, nonHolder, 2e16, "voting payment")
} catch (err) {
assert.equal(err.receipt.status, 0, "It should have thrown")
return
Expand Down

0 comments on commit b9d9a6c

Please sign in to comment.