Skip to content

Latest commit

 

History

History
184 lines (142 loc) · 7.26 KB

README.md

File metadata and controls

184 lines (142 loc) · 7.26 KB

API3 DAO Template

This is an API3-DAO template. It integrates two custom API3 voting apps.

  • Build
npm run compile
  • Test
npm run test

Deployment

Local

Run this

npx ganache-cli --gasLimit 8000000

and this on a separate terminal

npm run deploy:rpc

Rinkeby

Create a key file for Aragon

cd ~ && mkdir .aragon && cd .aragon && touch rinkeby_key.json

and add the following to the file created

{
  "rpc": "https://rinkeby.infura.io/v3/your_infura_id",
  "keys": [
    "your_private_key"
  ]
}

and run

npm run deploy:rinkeby

Verifying the Mainnet deployment

{
  "api3Token": "0x0b38210ea11411557c13457D4dA7dC6ea731B88a",
  "timelockManager": "0xFaef86994a37F1c8b2A5c73648F07dd4eFF02baA",
  "api3Pool": "0x6dd655f10d4b9e242ae186d9050b68f725c76d76",
  "convenience": "0x95087266018b9637aff3d76d4e0cad7e52c19636",
  "dao": "0x593ea926ee9820a933488b6a288433c387d06dba",
  "acl": "0x1e7ecc6d3b5b4cfdfc71cb7c3ea9ac4a55f4195a",
  "votingAppPrimary": "0xdb6c812e439ce5c740570578681ea7aadba5170b",
  "votingAppSecondary": "0x1c8058e72e4902b3431ef057e8d9a58a73f26372",
  "agentAppPrimary": "0xd9f80bdb37e6bad114d747e60ce6d2aaf26704ae",
  "agentAppSecondary": "0x556ecbb0311d350491ba0ec7e019c354d7723ce0"
}
  1. Install aragonCLI globally (specifying the package version because latest seems to be broken for some machines):
npm install -g @aragon/[email protected]
  1. Install Frame. Run it and make sure that it is connected to the correct chain.

  2. Inspect the DAO with the following

aragon dao apps 0x593ea926ee9820a933488b6a288433c387d06dba --use-frame

Review that the displayed information is correct.

aragon dao apps 0x9B64177757a0BD2A042446C8d910526476B7Bf57 --use-frame
  1. In (3), you should have seen Api3Voting apps with the ID 0x323c4eb511f386e7972d45b948cc546db35e9ccc7161c056fb07e09abd87e554. This is derived as namehash("api3voting.open.aragonpm.eth"). To verify, run the following script
npm run derive-namehash
  1. The Api3Voting apps will have a proxy address each. Read the contract address they are pointing at using implementation() (you can use Etherscan for this because the code of the proxy contract will be verified). Then check the source code at this implementation address using Etherscan and verify that it is identical to Api3Voting.sol.

  2. Verify that the ACL (Access Control List) is configured correctly

aragon dao acl 0x593ea926ee9820a933488b6a288433c387d06dba --use-frame

You can compare with API3DAOv1

aragon dao acl 0x9B64177757a0BD2A042446C8d910526476B7Bf57 --use-frame
  1. Check that the following values are initialized correctly
  • api3Pool and the voting parameters (supportRequiredPct and minAcceptQuorumPct) at the Api3Voting apps
  • api3Token, timelockManager, agentAppPrimary, agentAppSecondary, votingAppPrimary and votingAppSecondary at the pool contract
  • If any claims manager contracts are set for the pool, they are audited and implemented to pay out claims in a trustless way with fail-safes such as payout limits (note that the pool will be deployed with no claims managers set initially and the DAO does not allow proposals in the first epoch to set a claims manager)

Permissions

System

Handle apps and permissions

App Permission Grantee Manager
Kernel APP_MANAGER PrimaryVoting [SHARE] PrimaryVoting [SHARE]
ACL CREATE_PERMISSIONS PrimaryVoting [SHARE] PrimaryVoting [SHARE]
EVMScriptRegistry REGISTRY_MANAGER PrimaryVoting [SHARE] PrimaryVoting [SHARE]
EVMScriptRegistry REGISTRY_ADD_EXECUTOR PrimaryVoting [SHARE] PrimaryVoting [SHARE]

Board

Primary Voting

Enforces important board decisions

App Permission Grantee Manager
PrimaryVoting [BOARD] CREATE_VOTES Any entity [BOARD] PrimaryVoting [SHARE]
PrimaryVoting [BOARD] MODIFY_QUORUM PrimaryAgent [BOARD] PrimaryVoting [SHARE]
PrimaryVoting [BOARD] MODIFY_SUPPORT PrimaryAgent [BOARD] PrimaryVoting [SHARE]

Secondary Voting

Enforces less important board decisions

App Permission Grantee Manager
SecondaryVoting [BOARD] CREATE_VOTES Any entity [BOARD] PrimaryVoting [SHARE]
SecondaryVoting [BOARD] MODIFY_QUORUM PrimaryAgent [BOARD] PrimaryVoting [SHARE]
SecondaryVoting [BOARD] MODIFY_SUPPORT PrimaryAgent [BOARD] PrimaryVoting [SHARE]

Primary Agent

Enforces important board decisions

App Permission Grantee Manager
PrimaryAgent EXECUTE PrimaryVoting [SHARE] PrimaryVoting [SHARE]
PrimaryAgent RUN_SCRIPT PrimaryVoting PrimaryVoting [SHARE]
PrimaryAgent REMOVE_PROTECTED_TOKEN NULL NULL
PrimaryAgent SAFE_EXECUTE NULL NULL
PrimaryAgent DESIGNATE_SIGNER NULL NULL
PrimaryAgent ADD_PRESIGNED_HASH NULL NULL
PrimaryAgent ADD_PROTECTED_TOKEN NULL NULL
PrimaryAgent TRANSFER PrimaryVoting PrimaryVoting

Secondary Agent

Enforces less important board decisions

App Permission Grantee Manager
SecondaryAgent EXECUTE SecondaryVoting [SHARE] PrimaryVoting [SHARE]
SecondaryAgent RUN_SCRIPT SecondaryVoting PrimaryVoting [SHARE]
SecondaryAgent REMOVE_PROTECTED_TOKEN NULL NULL
SecondaryAgent SAFE_EXECUTE NULL NULL
SecondaryAgent DESIGNATE_SIGNER NULL NULL
SecondaryAgent ADD_PRESIGNED_HASH NULL NULL
SecondaryAgent ADD_PROTECTED_TOKEN NULL NULL
SecondaryAgent TRANSFER PrimaryVoting PrimaryVoting

Vault and Finance

Handle board vault

App Permission Grantee Manager
Vault(PrimaryAgent) TRANSFER PrimaryVoting PrimaryVoting [SHARE]
Vault(SecondaryAgent) TRANSFER SecondaryVoting PrimaryVoting [SHARE]