Code Monkey home page Code Monkey logo

dao-templates's Introduction

DAO Templates Build Status

What is a DAO template

The best way to kickstart an Aragon organization is by using a template. A template are a set of smart contracts that will create an organization from scratch and configure it according to some provided parameters.

Because they involve smart contract code, modifying a template, even though it's usually really easy, must be done with extreme care. It is always recommended to do a third party security audit to review the template code when modified.

Mainnet-ready templates

Aragon creates and have put most of the templates in this repo through an external audit. Despite this, they come without any guarantees; a template we consider secure today may be vulnerable to an unknown security hole discovered down the road. Moreover, once a user has created their organization, they may grant or transfer permissions in a way that makes their organization insecure.

You can find more information about template deployments and their addresses in the deployments repo.

Aragon 0.8

With Aragon 0.8, the client has switched to the following templates:

These templates were audited as part of the 0.8 release.

Aragon 0.7

With Aragon 0.6 and 0.7, the following templates were used by the client to create organizations for users:

These templates were audited as part of the 0.6 and 0.7 releases by WHG and Consensys Diligence.

Build your own template!

@aragon/templates-shared is published on npm and contains contract, deployment, and testing utilities to help you build your own template. All of the templates in this monorepo use templates-shared internally.

Help

For help and support, feel free to contact us at any time on Discord.

dao-templates's People

Contributors

0xgabi avatar benstew avatar bingen avatar fabiobonfiglio avatar facuspagnuolo avatar githubdoramon avatar izqui avatar john-light avatar macor161 avatar mathewmeconry avatar novaknole avatar sohkai avatar theethernaut avatar vdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dao-templates's Issues

Docker Test Fails

I'm running npm test or npm install and getting the following errors from docker

> npm run docker:build && npm run docker:run && test `docker-compose ps -q | xargs docker inspect -f '{{ .Name }} {{ .State.ExitCode }}' | grep deploy | cut -d' ' -f 2` = 0


> @aragon/[email protected] docker:build /Users/xxx/xxx/dao-kits/kits/beta
> docker build -t aragon/templates-beta -f Dockerfile ../..


    at Promise.all.then.arr (/Users/xxx/xxx/dao-kits/node_modules/execa/index.js:236:11)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
  code: 1,
  killed: false,
  stdout: '\n> @aragon/[email protected] test /Users/xxx/xxx/dao-kits/kits/beta\n> npm run docker:build && npm run docker:run && test `docker-compose ps -q | xargs docker inspect -f \'{{ .Name }} {{ .State.ExitCode }}\' | grep deploy | cut -d\' \' -f 2` = 0\n\n\n> @aragon/[email protected] docker:build /Users/xxx/xxx/dao-kits/kits/beta\n> docker build -t aragon/templates-beta -f Dockerfile ../..\n\n',
  stderr: 'time="2018-08-07T13:08:01+07:00" level=error msg="failed to dial gRPC: cannot connect to the Docker daemon. Is \'docker daemon\' running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory" \ncontext canceled\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! @aragon/[email protected] docker:build: `docker build -t aragon/templates-beta -f Dockerfile ../..`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the @aragon/[email protected] docker:build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /Users/tom/.npm/_logs/2018-08-07T06_08_01_382Z-debug.log\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 1\nnpm ERR! @aragon/[email protected] test: `npm run docker:build && npm run docker:run && test `docker-compose ps -q | xargs docker inspect -f \'{{ .Name }} {{ .State.ExitCode }}\' | grep deploy | cut -d\' \' -f 2` = 0`\nnpm ERR! Exit status 1\nnpm ERR! \nnpm ERR! Failed at the @aragon/[email protected] test script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /Users/tom/.npm/_logs/2018-08-07T06_08_01_414Z-debug.log\n',
  failed: true,
  signal: null,
  cmd: 'npm run test',
  timedOut: false,
  exitCode: 1 }
npm ERR! Test failed.  See above for more details.

Truffle.js not found

Trying to run npm run deploy:devnet i am getting the following error :
Error: Cannot find module '@aragon/templates-shared/truffle.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function.Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:690:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/Users/rodrigoperez/Development/1Hive/dandelion-org/truffle.js:1:18) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleLoad (internal/modules/cjs/loader.js:593:12) at Function.Module._load (internal/modules/cjs/loader.js:585:3)

I think that the truffle.js is not being published

Improve multisig tests

Current multisig template tests can only be run with geth. We should provide support for ganache as well. Additionally, there are multiple steps along the suite that can be simplified using some of the helpers provided in test-helpers and templates-shared.

shared: TemplatesDeployer should not assume template constructor params

The TemplatesDeployer currently hardcodes four parameters as the constructor parameters to each template.

We should loosen this to allow a user to describe their templates' own constructor parameters. For contracts that we deploy, like the test ENS and aragonID, we can export symbols and check for them.

[Meta] DAO Kit -> template

We decided to rename "DAO kit" to "template" so we can call them "Aragon templates", "organization templates", or simply, "templates".

Upgrade test-token-deployer

Would be nice to have it in a state where it's also updated to pragma 0.4.24. I don't think a redeployment on rinkeby is necessary though.

Reputation template

  • Tokens
    • Non-changeable defaults: Non-transferable, uncapped, 18 decimals
  • Voting
    • Non-changeable default: Controls minting and burning tokens
    • Changeable defaults: 50% relative support, 0% absolute support, 7 day duration
  • Finance
    • Non-changeable defaults: 30 day budget duration
  • Payroll: Enable opting out of its installation
    • Changeable defaults: Dai as denomination token (not changeable after initialization)

Allow toggling between a Vault or Agent app

New templates introduce the usage of the Agent app in favor of the Vault app. We should allow the user to stay with the Vault app. We can introduce a new boolean to the templates interface to decide whether to install a Vault or an Agent app

Silent failure while validating multi-component parameters

There might be a problem when checking for multi-component parameters such as votingSettings in templates like company: https://github.com/aragon/dao-templates/blob/master/templates/company/contracts/CompanyTemplate.sol#L197

I believe that Web3 is always setting the length to 3 and filling it with zeroes, or something like that. To demonstrate, I set up an example, in which the last 2 tests fail: https://github.com/ajsantander/arraylen/blob/master/test/arraylen.test.js#L15

KitBase: fetch DAOFactory from aragonPM

Seems like it could be a good way to avoid having to recreate kits if the DAOFactory changes over time.

Could be done in a similar manner to how the apps in the beta kits are fetched through aragonPM.

Vuejs Demo App

Hello,
Do you plan to create a template which can be started via the Aragon CLI to create Vuejs boilerplate application?

Membership Template Hangs After creating DAO.

Membership template hangs after I create a DAO. It gets stuck on the "Launching your organization" screen. I am new to the project so I am not sure how to begin troubleshooting this issue.

image

Change default permissions so that only an account who belongs to an organisation can create new votes.

Anyone who knows the URL of my organisation (it's blockchain so it's probably publicly visible) can create new votes.

These are the default settings:

image

I suggest only an account who owns a token in the organisation can create votes.


How did I discovered this issue?

I was testing the app and wanted to onboard some friends. Gave them instructions:

Visit: https://rinkeby.aragon.org
Open an existing organisation: foobar

I was planning to ask them for ETH address so that I could assign them tokens.

Realised that they can create an assignment themselves.

The process feels weird.

Real life analogy:
Onboarding at a company, it's the admin who creates [email protected]

Or is it me filling the form to HR?

What if HR is publicly open and anyone can submit the form?

Provide helpers to mint tokens

All the templates we're providing implement this logic, we should be able to provide that from the BaseTemplate contract

Add demo survey kit

Add some mock data so we can start testing the background script and integration with frontend.

Parameterize new templates app settings

New templates (reputation, membership, and both company templates) do not allow the user to specify some variables that should be customizable. These are:

  • voting duration
  • voting support
  • voting acceptance
  • finance period duration (use 0 for 30 days default)
  • token name
  • token symbol

Fix test gas scripts

Both multisig and democracy templates have a test gas script that are broken, they are importing a relative file ../index_local.js that doesn't exist.

Improve geth dependency

Current templates are tested with a geth node, mainly used by the CI, using an Aragon's geth-devnet docker image. Tests are run relying on a previous step that basically waits until the gas limit of the node has increased to 8M gas. To avoid waiting time for that, we are committing the ethereum-data dir within the shared sub-repo. This dir will hold all the information related to the geth instance being run, thus files will be changing and git will keep tracking them.

We should improve this flow, either updating our geth image or exploring a painless way to deal with ethereum-data

Optimize apps installation

Current BaseTemplate contract installs applications performing 2 transactions, one for the installation per se and another one to initialize the new app. We could leverage the install + initialization function of the Kernel to reduce gas costs

Document new templates architecture and functionality

Current architecture lacks documentation, we should add/improve documentation of:

  • Contracts inline documentation
  • Helpers
  • Deployment scripts
  • Shared components
  • Readme basic instructions (deploying templates, creating DAOs, publishing, etc)

Improve democracy template tests

Current democracy template tests can only be run with geth. We should provide support for ganache as well. Additionally, there are multiple steps along the suite that can be simplified using some of the helpers provided in test-helpers and templates-shared.

Startup template

  • Tokens
    • Non-changeable defaults: Transferable, uncapped, 18 decimals
  • Voting
    • Changeable defaults: 50% relative support, 0% absolute support, 7 day duration
  • Finance
    • Non-changeable defaults: 30 day budget duration
  • Payroll: Enable opting out of its installation
    • Changeable defaults: Dai as denomination token (not changeable after initialization)

Tests preparing for the Istanbul hard fork

Run the tests against a client with the EVM under Istanbul consensus rules with an 8m gas limit to ensure that the templates will keep running as expected (everything that can be done in one transaction can still be done in one transaction)

Add scripts to run tests with ganache

Currently, it is possible to run tests against a ganache node, but you have to do all the set up manually. We can provide scripts to start a ganache node, deploy the template being tested, run the tests, and cleanup everything at the end.

Membership template

  • Tokens
    • Non-changeable defaults: Non-transferable, capped to 1 per address, 18 decimals
  • Voting
    • Non-changeable default: Controls minting and burning tokens
    • Changeable defaults: 50% relative support, 0% absolute support, 7 day duration
  • Finance
    • Non-changeable defaults: 30 day budget duration
  • Payroll: Enable opting out of its installation
    • Changeable defaults: Dai as denomination token (not changeable after initialization)

Iterate on deployment script to prevent registering non existent repos

The script currently registers each repo involved in the deployment process that was not already registered on the aragonPM registry by default. The particular line of code that does that: here

This is an issue cause the registration data is malformed and provoke the following RPC error: Error: Invalid JSON RPC response: ""

Create permissions for EVMScriptRegistry roles in all kits

aragon/aragonOS#392 splits the roles of EVMScriptRegistry into two: REGISTRY_ADD_EXECUTOR_ROLE and REGISTRY_MANAGER_ROLE.

Now EVMScriptRegistryFactory completely removes permissions after setting it up. These permissions are too dangerous to leave uninitialized as anyone with the CREATE_PERMISSIONS_ROLE could create them at any time.

Kits should create the permissions for both roles and assign them to an entity with significant power (for beta kits, that would be the Voting app)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.