DAOhaus
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Write
        • Owners
        • Signed-in users
        • Everyone
        Owners Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Help
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Write
Owners
  • Owners
  • Signed-in users
  • Everyone
Owners Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    --- title: DAOhaus Dev Docs Cleanup tags: devrel --- # DAOhaus Dev Docs Cleanup ``` │ Overview (NEW - Refer to section 1) │ └─── Concepts (NEW - Refer to section 2) │ Proposals (NEW) │ Safe & Minions (NEW) │ Boosts (NEW) └─── DAOhaus App (RENAMED) │ Client Overview (EDITED, fka Code Legos/overview - Refer to section 3) └─── Code Legos | Transaction Lego | Field Lego | Contract Lego | Form Lego | Contexts │ Activity Feeds | Contract Services | TX Polling Service | Boosts (FUTURE) | Summoning DAOs | Common Utilities & Patterns └───Tutorials (NEW) │ How to Build a Boost (NEW - Refer to other HackMD) | ... (FUTURE: Subgraph Queries) └───Contributing Guidelines (RENAMED, fka JS Code Review) │ Overview │ Code Review Process │ Javascript Rules │ Async Rules │ Caching Rules │ React/Structure │ React/Components │ React/useEffect | React/JSX | Component Layout ``` # 1. Overview Today, the DAOhaus app empowers any community to summon a Moloch DAO and coordinate with a human-friendly interface. The three following components enable the DAOhaus app to function smoothly. * **Smart Contracts (Moloch)**: DAOhaus uses Moloch DAO's smart contracts to facilitate on-chain DAO functionalities (e.g. permissioned membership via loot/share, proposals, treasury & minions, ragequit, etc.) * **Subgraphs:** DAOhaus uses subgraphs from The Graph to ensure that on-chain data is indexed and available for querying. * **Client:** The DAOhaus app is built on React. When a user interacts with DAOhaus, he/she is using a client that references on-chain data from Subgraphs, as well as on-chain functionality from Moloch smart contracts. Today, DAOhaus is largely open source on Github. There are some services (e.g. data middleware) that are managed by the DAOhaus core team. We are currently exploring more open source and decentralized alternatives. ## Smart Contracts (Moloch, Baal) (current: [/docs/devs](https://daohaus.club/docs/devs)) As a no-code platform for Moloch DAOs, the DAOhaus app interfaces with Moloch contracts for all on-chain actions and features. Currently, the DAOhaus app supports Moloch v2 DAOs using the following contracts: * Moloch v2.1 (see repository [here](https://github.com/HausDAO/Molochv2.1)): All Moloch v2 functions with multi-summoner capabilities, plus register function for metadata & EIP-1167 proxy pattern to reduce gas costs during summoning * Moloch 2.5 (see repository [here](https://github.com/HausDAO/Moloch2.5)): All Moloch v2.1 functions with Shamans support * Minion (see repository [here](https://github.com/HausDAO/MinionSummonerV2)): All Minion functions with the ability for the DAO to intract with smart contracts while keeping funds safe in a Gnosis Safe Moving forward, the DAOhaus app will be using Moloch v3 (Baal). For more information on Moloch V3 (Baal), refer to the [official Baal documentation here ](https://baal-docs.vercel.app/) ## Subgraphs (current: [/docs/devs/subgraphs](https://daohaus.club/docs/devs/subgraphs)) > Note: Nothing much to change here. Pretty much copied the entire thing over ### What is TheGraph? The Graph is an indexing protocol that incentivizes and coordinates indexing of public blockchain data. The Graph provides queryable data using GraphQL for your API to plug into. By indexing Moloch contracts with The Graph any user with an access to TheGraph can find data on all compatible DAOs instantly. ### Subgraphs The primary DAOhaus Subgraph tracks the primary entities of DAOs: members, proposals, votes, and tokens. #### DAOhaus Subgraph Explorers - [Mainnet](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus) - [Kovan](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-kovan) - [Rinkeby](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-rinkeby) - [Gnosis Chain](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-xdai) - [Polygon](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-matic) - [Optimism](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-optimism) - [Arbitrum](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-arbitrum) - [Celo](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-celo) #### Stats Subgraph Explorers The DAOhaus Stats Subgraph provides aggregated statistics and metrics for users and communities across the platform. - [Mainnet](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats) - [Kovan](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-kovan) - [Rinkeby](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-rinkeby) - [Gnosis Chain](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-xdai) - [Polygon](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-matic) - [Optimism](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-optimism) - [Arbitrum](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-arbitrum) - [Celo](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-stats-celo) #### Boosts Subgraph Explorers The DAOhaus Boosts Subgraph provides aggregated statistics and metrics for boosts across the platform. - [Mainnet](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts) - [Kovan](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-kovan) - [Rinkeby](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-rinkeby) - [Gnosis Chain](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-xdai) - [Polygon](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-matic) - [Optimism](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-optimism) - [Arbitrum](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-arbitrum) - [Celo](https://thegraph.com/hosted-service/subgraph/odyssy-automaton/daohaus-boosts-celo) ## Client (current: [docs/devs/legos/overview](https://daohaus.club/docs/devs/legos/overview)) The DAOhaus frontend is built using React. For greater ease of development, we will be releasing component libraries shortly. For more information on the DAOhaus Client, please refer to [Working with the DAOhaus app]() # 2. Concepts As a no-code platform for Moloch DAOs, most of DAOhaus' concepts and functionality originate from the functionalities of a Moloch DAO. If you are new to Moloch DAOs, refer to this [Mirror article](https://daohaus.mirror.xyz/U_JQtheSzdpRFqQwf9Ow3LgLNG0WMZ6ibAyrjWDu_fc) for an introduction to Moloch DAOs. ## Proposals (current: [/docs/devs/proposals](https://daohaus.club/docs/devs/proposals)) > If you are new to Proposals in Moloch DAOs, refer to [Introduction to Proposals](https://daohaus.club/docs/proposals). Proposals are the mechanism which all Moloch DAOs use to take any action, from issuing shares to members to sending funds to addresses or interacting with smart contracts. Before a proposal can be executed, it has to go through the 6 lifecycle stages: Submission, Sponsorship, Voting Period, Grace Period, Processing, Execution ![](https://i.imgur.com/arVqE4x.png) **Default Proposal Types** Every DAO comes with default proposal types which enable the core functions of Moloch DAOs such as Membership, Funding, GuildKick, etc. These proposal types come with field inputs that are necessary for their respective functions. For instance, a **New Member Proposal** is a proposal that allows new members to join a DAO by requesting shares and providing tribute. This Proposal Type contains the default fields ("Title", "Description" & "Link") as well as custom fields like "Shares Requested" and "Token Tribute". ![Member Proposal Fields](https://daohaus.club/img/member_proposal.png) Another example is **Funding Proposal** that allows members to request funds from the DAO. Apart from default fields ("Title", "Description" & "Link"), the Proposal has fields such as "Applicant" and "Payment Requested". ![Funding Proposal Fields](https://daohaus.club/img/funding_proposal.png) ==Follow with a link to a complete list of the default proposals, or cover them all here== **Custom Proposals (Boosts)** DAOHaus is designed to be extended by external developers. By working with our proposal "code legos" developers can create "Boosts" to extend DAOhaus functionality. A Boost can include custom fields, inputs and layouts to build new proposal types. ==[Building Boosts on the DAOhaus platform]()== ## Treasury, Minions & Safes **Treasury** (current: [docs/devs/bank](https://daohaus.club/docs/devs/bank)) A Moloch DAO is able to hold ERC-20 and ERC-721 assets. Members of a DAO can withdraw their their proportional ownership of the treasury using the ragequit feature. > If you are new to Treasury in Moloch DAOs, refer to [Treasury Introduction](https://daohaus.club/docs/users/bank). The DAOhaus app displays token balances and prices from the DAO treasury. ERC-20 token prices are fetched from Coingecko's price APIs, whereas the token icons are fetched from TrustWallet's repository . ==Anything else to add?== **Minions** A minion is a smart contract that enables the DAO to make arbitrary calls to external smart contracts. A minion is also able to hold ERC-20 and ERC-721 tokens within the internal balance, but these funds are not ragequittable by DAO members. When a Minion Proposal is submitted, voted on and passed, the Minion will execute the instructions contained in the Minion Proposal, enabling trustless voting and execution. > If you are new to Minions in Moloch DAOs, refer to [Minions Introduction](https://daohaus.club/docs/users/minion). ==Anything to add here?== **Safe Minions** DAOhaus has integrated with the Gnosis Zodiac framework to create the Safe Minion, where a DAO can store funds in a Gnosis Safe but use the Minion to control the Safe through proposals. The Minion inherits the `Module.sol` contract from the Zodiac library. When a Minion Propsal is passed and executed, the Minion uses the Module’s `exec` function to execute arbitrary external calls on behalf of the Safe. ==We link to the minion page, so maybe put this Safe Minion detail there?== ## Boosts (current: [docs/devs/boosts](https://daohaus.club/docs/devs/boosts)) Boosts are functionality added by developers to expand functionality beyond the default. > If you are new to Boosts, please refer to the [Boosts 101](https://daohaus.club/docs/users/boosts/boosts) The most common types of Boost are custom proposals forms. Custom field inputs, form layouts and transaction payloads introduce added functionalities to Moloch DAOs. These Boosts can interact with external smart contracts (via Minions) or off-chain APIs, allowing for a wide range of use cases to be built. Developers are able to publish these Boosts on the Boosts Marketplace for DAOs to install and access these functionality. Once a Boost is installed, the DAO is able to create, vote and execute the custom proposal based on the developer's customizations. # 3. DAOhaus App / Client Overview Built on React, the DAOhaus app uses **Code Legos** to create all its components and functionalities. Written in Javascript, these code legos are packets of static objects that contain instructions for the app to render UI or make calls to external smart contracts. Here are some examples of Code Legos and their purposes: 1. Field Legos: Instructs the app to render fields where they are needed 2. Form Legos: Instructs the app to render forms (i.e. collection of fields) for proposals 3. Transaction Legos: Provides the transaction schema & prepares the arguments for external smart contract calls 4. Contract Legos: Provides the contract addresses and ABIs required for external smart contract calls. These code legos work together to create UIs and interfaces such as Proposal Forms, Form fields and Contract interactions. We use Code Legos to ensure that Boost development is as easy as assembling the appropriate Legos from existing components to fit your use case. For more information about each type of Code Lego, refer to their individual pages. ## Code Legos in Action **Rendering UI** For instance, to render a Funding Proposal Form on the DAOhaus app, we will need to create a **Form Lego** which contains the UI (i.e. fields) functionalities of a Proposal. This Form UI can be further broken down into **Field Legos** for each field such as Payment Requested, etc. ![](https://i.imgur.com/YsiRhDQ.png) **Making External Contract Calls** For illustration, let's take the case of the Disperse Proposal (i.e. using disperse.app's contract to distribute tokens to a set of addresses). When a Disperse proposal has been voted on, the app will need to execute calls with the Disperse contract. The app will get the transaction schema from **Transaction Legos** and prepare the transaction arguments following the schema. Next, the app will make the smart contract call to the contract address in the **Contract Lego**. ![](https://i.imgur.com/bm02ba1.png) ## Why Code Legos - Speed up and simplify the flow of boost development. - Drastically reduce the amount of code the application needs to store. - Create building blocks that are composable with others. - Make the app more interopable with potential backend architecture (ex. DAOhaus Marketplace, DAOhaus API, Boost APIs). - Remove the need for community developers to alter the core application architecture. - Maintain consistent patterns and types across the app that can be easily tested and maintained. - Better tools for DAO devs so they can create better tools for DAO communities. --- # Appendix: All these can go into the individual lego pages **3 Entities Boost Developers should concern themselves with**: **1 Contract Legos** - contracts.js * Relatively Simple * Ties ABI to some sort of object * tells us where the contract address lives "local" or "fetch" * contractAddress: where in the application it lives. * dot notation * Sometimes we want to find it in chain.js **2 Form Legos** - forms.js > classics.js (forms holds indexes, classics holds metadata (probably others like classics.js)) * src/data/formLegos/ **3 Transaction Legos** - molochTX.js * src/data/txLegos/ * a way of describing an ethereum transaction in static data * Looking through the form or the application for certain values * It's like a query, but we're querying the application, not some server * Sort of the opposite of the ABI * ABI says what it needs, this says what ABI is getting * Lifecycle methods * Actions we can propose when the proposal passes * What poll we're using to update the UI (e.g. subgraph) * Display error messages etc

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully