Skip to content

sim31/ordao

Repository files navigation

ORDAO

ORDAO (Optimistic Respect-based DAO) is a toolset for DAOs that use a non-transferrable reputation token (Respect). It provides smart contracts, a client library, a backend service, and a frontend — everything needed to run a DAO where proposals are voted on using reputation token and executed onchain via OREC.

For understanding of design philosophy and context, start with the OREC whitepaper.

Architecture

The codebase is inspired by principles of clean architecture. The smart contracts and shared type library (ortypes) form the innermost domain layer. The client library (orclient) and backend service (ornode) depend on ortypes but not on each other or on any UI. The frontend (gui) sits at the outermost layer and can be swapped without affecting the rest. See the ortypes README for more detail on how this design enables code reuse, keeps contracts simple, and makes the system independent of UI and storage choices.

Only proposal hashes are stored onchain — full proposal content and metadata lives on the ornode. Orclient abstracts this split: it translates user inputs into contract calls, uploads proposal data to the ornode, and merges onchain + offchain data into consistent reads. See the orclient README for more.

---
title: "Architecture layers (arrows = dependencies)"
---
flowchart TD
  subgraph apps["Apps"]
    gui[apps/gui]
    docs[apps/orclient-docs]
  end

  subgraph clientlibs["App-facing Libraries"]
    orclient[libs/orclient]
    privy[libs/privy-react-orclient]
  end

  subgraph domain["Domain Model"]
    ortypes[libs/ortypes]
    orec[contracts/orec]
    respect[contracts/respect1155]
  end

  subgraph backend["Backend"]
    ornode[services/ornode]
  end

  gui --> privy
  gui --> orclient
  gui --> ortypes
  docs --> orclient
  privy --> orclient
  orclient --> ortypes
  ortypes --> orec
  ortypes --> respect
  ornode --> ortypes
Loading

Components

  • OREC — Optimistic Respect-based Executive Contract. Enables DAOs to execute onchain actions democratically while avoiding voter-apathy through a low quorum + veto period design.
  • Respect1155 — ERC-1155 Respect token. Non-transferrable awards (NTTs) with a denomination that sums to a fungible Respect balance.
  • SolidRespect — ERC-20-compatible non-transferrable Respect token where the entire distribution is fixed at deployment.

Services

  • ornode — Backend API service that stores proposal content, attachments, votes, and Respect token metadata offchain. OREC only stores proposal hashes onchain; the ornode holds the full data.

Libraries

  • orclient — Client library for ORDAO apps. Handles proposal creation (translate → submit onchain → upload to ornode), voting, execution, and querying — abstracting the onchain/offchain split. (Full API docs)
  • privy-react-orclient — React hooks and context provider for integrating orclient with Privy authentication. Includes fallback to read-only mode when no wallet is connected.
  • ortypes — Shared domain model: TypeScript types, Zod validation schemas, and the translation layer between user inputs and contract calls. The core that all other components depend on.

Utility Libraries

  • ts-utils — Shared TypeScript utilities (serialization, object helpers, error handling).
  • zod-utils — Zod schema reflection and introspection utilities.
  • ethers-decode-error — Decode ethers.js smart contract errors into human-readable messages.

Apps

  • gui — ORDAO frontend built with React, Chakra UI, and TanStack Router. Currently implements breakout-result submission and proposal management for fractals.
  • orclient-docs — Generated API documentation site for orclient. (Live)

Documentation

  • OREC whitepaper — Design and specification of the Optimistic Respect-based Executive Contract.
  • Optimism Fractal update to ORDAO — Comparison with older Optimism Fractal software and the proposed upgrade path. Provides historical context for how ORDAO was created.
  • Upgrade path details - details of the upgrade procedure used by Optimism Fractal. A precedent for how communities can transition to ORDAO and how ORDAO can be renewed in the communities that already use it.

ORDAO Fractal Apps

ORDAO components combine to create apps for community DAOs. Several fractal communities are running ORDAO instances today:

Community ORDAO Instance Comments
Eden Fractal eden.frapps.xyz
Optimism Fractal optimism.frapps.xyz ORDAO originated as an upgrade to Optimism Fractal's older software. See the upgrade document for a comparison and migration path.
ZAO Fractal zao.frapps.xyz

Deploying Your Own

To deploy an ORDAO instance for your community, you can use the orfrapps repository. It provides configuration files, deployment scripts, and CLI tools for setting up and maintaining ORDAO instances for fractal communities. This repository (ordao) contains the source code and is included in orfrapps as a submodule.

Development

You can run individual ORDAO components or the whole ORDAO fractal app locally by using scripts in package.json. The project uses Lerna workspaces.

Local Dev Workflow

To run the full ORDAO stack locally against a local Hardhat chain:

  1. Start a local chain (keep running in its own terminal):

    npm run dev:chain
  2. Deploy contracts to the local chain:

    npm run dev:cdeploy

    Alternatives: dev:cdeploy:erc20 deploys with an ERC-20 parent Respect token.

  3. Start ornode (connects to local chain and local MongoDB):

    npm run dev:ornode-clean

    Use dev:ornode to keep existing data, or dev:ornode-erc20-clean / dev:ornode-erc20 for ERC-20 variants.

  4. Start the GUI dev server (keep running in its own terminal):

    npm run dev:gui

    Alternative: dev:gui-erc20 for the ERC-20 variant.

  5. Watch for code changes (optional, rebuilds libraries automatically):

    npm run dev:watch

    This watches all packages except the GUI and rebuilds dependents on change.

Developing Against Testnets

Scripts are also available for running against live testnets:

Ornode GUI Network
dev-op-sepolia:ornode dev-op-sepolia:gui OP Sepolia
dev-of2:ornode dev-of2:gui Optimism Fractal
dev-zaof:ornode dev-zaof:gui ZAO Fractal

Build

npm run build             # build all packages (via Lerna)
npm run build-no-ornode   # build all except ornode
npm run build-clean       # clean and rebuild all from scratch
npm run clean             # clean all build outputs

Other Useful Scripts

Command Description
npm test Run tests across all packages
npm run test-integration Run integration tests
npm run watch Watch all packages and rebuild on change (including dependents)
npm run gen-ornode-client Regenerate the ornode API client and copy it into orclient
npm run dev:orclient-docs Serve orclient-docs locally on port 5174

About

Toolset for DAOs using non-transferable reputation token (Respect)

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors