marketDAO

MarketDAO

MarketDAO is a governance framework that brings market forces to bear on group decisions. The key innovation is a system where voting rights can be freely bought and sold during elections, allowing market forces to influence governance outcomes.

Core Concept

Unlike traditional DAOs where voting power is static, MarketDAO introduces tradable voting tokens for each election. This creates a dynamic where voters can:

Features

Implementation Details

Architecture

MarketDAO uses a flexible proposal execution model:

Lazy Token Distribution

To minimize gas costs when elections are triggered, voting tokens use a “lazy minting” approach:

Majority-Based Execution

To allow proposals with overwhelming support to execute immediately:

Join Request System

Non-token holders can request to join the DAO through a special mint proposal:

  1. Non-holder submits a join request (creates a GenericProposal to mint 1 token to themselves)
  2. The proposal enters the standard support phase
  3. Existing members add support if they approve
  4. If support threshold is reached, an election is triggered
  5. Members vote on the join request
  6. If approved, the new member receives 1 governance token and full DAO access
  7. If rejected, they remain a non-holder

Example: factory.createProposal("Join request", address(dao), 0, abi.encodeWithSelector(dao.mintGovernanceTokens.selector, requester, 1))

Lock-Based Voting Power

To enable unlimited scalability without gas limit concerns, MarketDAO uses a lock-based system instead of traditional snapshots:

This lock-based approach is more scalable than traditional snapshot mechanisms because it doesn’t require iterating through or storing individual holder balances.

GenericProposal

GenericProposal is the core execution primitive that enables flexible contract interactions:

Common use cases:

Parameter changes through GenericProposal support:

All parameter changes validate at execution time and require the standard proposal lifecycle.

Distribution Proposals (Proportional Distributions)

Distribution Proposals enable fair, proportional distributions of assets (ETH, ERC20, ERC1155) to all token holders:

Important: The amountPerGovernanceToken parameter is a TARGET, not a guarantee. Actual payouts are calculated pro-rata based on total registered shares vs actual pool balance.

Security & Scalability

MarketDAO has been audited by Hashlock Pty Ltd (January 2026). The audit has been completed and all findings have been addressed.

Security Features

Scalability Guarantees

Known Limitations (By Design)

Configuration

Flags Bitfield

The flags parameter controls optional features:

Common configurations:

Block-Based Durations

maxProposalAge, electionDuration, and vestingPeriod are all measured in block numbers, not wall-clock time. Block times vary significantly across EVM chains (Ethereum ~12s, some L2s sub-second or variable). Deployers must choose values appropriate for their target chain. For example, an electionDuration of 50 blocks is ~10 minutes on Ethereum mainnet but could be under a second on a fast L2.

Usage Flow

All operations can be performed through the web interface (see Frontend section above) or via direct contract interaction.

For New Members (Join Request):

  1. Connect wallet to the DAO interface (web UI or MetaMask)
  2. Submit join request with a description (web UI handles calldata generation)
  3. Wait for existing members to add support
  4. If threshold met, members vote on admission
  5. If approved, receive 1 governance token

For Token Holders (Standard Proposals):

  1. Create a proposal via web UI or factory.createProposal(description, target, value, data):
    • Resolution: Empty calldata for symbolic votes
    • Treasury transfers: Send ETH, ERC20, ERC721, or ERC1155 assets
    • Mint tokens: Add new members or increase holdings
    • Change parameters: Modify quorum, thresholds, durations, etc.
    • External calls: Interact with DeFi protocols, other DAOs, etc.
  2. Proposals need to reach support threshold to trigger an election
  3. When threshold is reached, an election period begins
  4. Claim voting tokens (1:1 with vested governance tokens)
  5. Cast votes by transferring voting tokens to YES/NO addresses
  6. Successful proposals execute automatically when majority reached

For Distribution Proposals:

  1. Create distribution proposal specifying asset type and target amount per token
  2. Members register during support/election phases to be included
  3. If approved, funds transfer to a DistributionRedemption contract
  4. Registered members claim their proportional share at any time after execution

Web Interface Workflow:

Frontend

A complete web interface for MarketDAO is included, built with VanJS - a lightweight 1KB reactive UI framework requiring no build tools.

Frontend Features

Frontend Tech Stack

Quick Start (Frontend)

  1. Start a local web server in the frontend/ directory:
    cd frontend
    python -m http.server 8080
    # OR: npx serve . -p 8080
    
  2. Deploy contracts to a local blockchain:
    # In project root
    anvil  # Start local blockchain in one terminal
    
    # In another terminal
    forge script script/Deploy.s.sol --broadcast --rpc-url http://localhost:8545
    
  3. Configure frontend - Edit frontend/js/config.js:
    const CONFIG = {
      network: {
        chainId: 31337,  // Anvil default
        name: 'Localhost',
        rpcUrl: 'http://localhost:8545'
      },
      contracts: {
        dao: '0x5fbdb2315678afecb367f032d93f642f64180aa3',  // Update from deploy
        factory: '0x0165878a594ca255338adfa4d48449f69242eb8f'  // Update from deploy
      }
    }
    
  4. Open browser to http://localhost:8080 and connect MetaMask

See frontend/README.md for detailed frontend documentation.

Development

Build & Test Commands

# Build the contracts
forge build

# Run all tests
forge test

# Run a single test
forge test --match-test testFunctionName

# Run tests in a specific file
forge test --match-path test/FileName.t.sol

# Format code
forge fmt

# Deploy to local blockchain
forge script script/Deploy.s.sol --rpc-url http://localhost:8545 --broadcast

# Deploy with controlled supply (flag bit 2)
forge script script/Deploy.controlled.s.sol --rpc-url http://localhost:8545 --broadcast

# Deploy with restricted purchases (flag bit 1)
forge script script/Deploy.private.s.sol --rpc-url http://localhost:8545 --broadcast

Future Possibilities

The GenericProposal architecture enables unlimited extensibility through external contracts:

The architecture is designed to support any future governance innovation without protocol changes.

License

MIT