Giter Club home page Giter Club logo

aragraph's Introduction

get in touch with Consensys Diligence
[ ๐ŸŒ ๐Ÿ“ฉ ๐Ÿ”ฅ ]

aragraph-logo

AraGraph

This blog post is a good introduction to AraGraph.

AraGraph is a tool to generate nice looking permission graphs for Aragon DAOs. It can take the following inputs:

  • The address and chain-ID of a live DAO.
  • A DAO template description file (yaml).
  • A specification in Markdown table format.

The tool generates an UML description for the DAO. Use Plantuml to render it.

aragraph

install

$ npm install -g aragraph

CLI

generate for a live DAO on mainnet

$ aragraph 0x2dE83b50Af29678774D5AbC4a7Cb2a588762f28C --chain-id 1 > dao.plantuml

generate from yaml description

$ aragraph ./examples/company.yaml > dao.plantuml

generate from markdown

$ aragraph ./examples/aragon_company_README.md > dao.plantuml

Render

$ java -jar plantuml.jar dao.plantuml

or open with vscode-PlantUML

Config / Templating

AraGraph allows you to template certain apps to enrich them with even more context like available Roles, Methods, static security information. See templates/config.json for details.

You can either provide you own config.json:

$ aragraph 0x2dE83b50Af29678774D5AbC4a7Cb2a588762f28C --config config.json

Or use the config.json provided with this package:

$ aragraph 0x2dE83b50Af29678774D5AbC4a7Cb2a588762f28C --default-config

Library

for a live DAO on mainnet

Example: DAO-Kernel on mainnet

fromDAO

new AragonPermissions().fromDAO(address, chainId).then((aragaph) => {
        console.log(aragaph.uml())
        process.exit(0)
})

from DAO description files (yaml)

Specification: DAO-Templates/Descriptor

Example: Company.yaml

fromYaml

const AragonPermissions = require("./AragonPermissions.js");
console.log(new AragonPermissions().fromYaml('./examples/company.yaml').uml())

from markdown table

Example: Readme.md

image

const AragonPermissions = require("./AragonPermissions.js");
const input = `

| App               | Permission            | Grantee       | Manager |
|-------------------|-----------------------|---------------|---------|
| Kernel            | APP_MANAGER           | Voting        | Voting  |
| ACL               | CREATE_PERMISSIONS    | Voting        | Voting  |
| EVMScriptRegistry | REGISTRY_MANAGER      | Voting        | Voting  |
| EVMScriptRegistry | REGISTRY_ADD_EXECUTOR | Voting        | Voting  |
| Voting            | CREATE_VOTES          | Token Manager | Voting  |
| Voting            | MODIFY_QUORUM         | Voting        | Voting  |
| Voting            | MODIFY_SUPPORT        | Voting        | Voting  |
| Agent or Vault    | TRANSFER              | Finance       | Voting  |
| Finance           | CREATE_PAYMENTS       | Voting        | Voting  |
| Finance           | EXECUTE_PAYMENTS      | Voting        | Voting  |
| Finance           | MANAGE_PAYMENTS       | Voting        | Voting  |
| Token Manager     | MINT                  | Voting        | Voting  |
| Token Manager     | BURN                  | Voting        | Voting  |
| Agent             | RUN_SCRIPT            | Voting        | Voting  |
| Agent             | EXECUTE               | Voting        | Voting  |
| Finance             | CREATE_PAYMENTS            | Payroll             | Voting        |
| Payroll             | ADD_BONUS_ROLE             | EOA or Voting       | Voting        |
| Payroll             | ADD_EMPLOYEE_ROLE          | EOA or Voting       | Voting        |
| Payroll             | ADD_REIMBURSEMENT_ROLE     | EOA or Voting       | Voting        |
| Payroll             | TERMINATE_EMPLOYEE_ROLE    | EOA or Voting       | Voting        |
| Payroll             | SET_EMPLOYEE_SALARY_ROLE   | EOA or voting       | Voting        |
| Payroll             | MODIFY_PRICE_FEED_ROLE     | Voting              | Voting        |
| Payroll             | MODIFY_RATE_EXPIRY_ROLE    | Voting              | Voting        |
| Payroll             | MANAGE_ALLOWED_TOKENS_ROLE | Voting              | Voting        |
`;

console.log(new AragonPermissions().fromMarkdownTable(input).uml())

Contributors ๐Ÿค—

aragraph's People

Contributors

dependabot[bot] avatar ensbot avatar tintinweb avatar xuhcc 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

Watchers

 avatar  avatar  avatar  avatar  avatar

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.