Skip to content

Repository files navigation

Deliberate Contracts

A voting module for deliberative decision-making using argument trees.

Deliberate lets participants build a tree of pro/con arguments below a debate thesis, stake vote tokens on argument markets to rate them, and finally tally the tree to determine the outcome. The Deliberate contract is deployed once, has no owner, and is not upgradeable (ADR-0006); moderation happens through the rating markets themselves (ADR-0005).

Prerequisites

  1. Get an up-to-date version of Foundry with

    curl -L https://foundry.paradigm.xyz | sh
    foundryup
  2. Optionally, to lint the contracts, install solhint using a JS package manager such as Bun with

    curl -fsSL https://bun.sh/install | sh
    bun install
  3. Optionally, for static analysis, install Slither with

    python3 -m pip install slither-analyzer

Usage

Installation

Install the dependencies (managed with Soldeer) with

forge soldeer install

Build

To compile the contracts, run

forge build

Tests & Coverage

To run the tests, run

forge test

To show the coverage report, run

forge coverage

Linting & Static Analysis

To run the linter and static analyzer, run

bunx solhint --config .solhint.json 'src/**/*.sol' && \
bunx solhint --config .solhint.other.json 'script/**/*.sol' 'test/**/*.sol' && \
slither .

Deployment

Deliberate takes the address of an identity registry (IIdentityRegistry) as its only constructor argument — a personhood registry such as Proof of Humanity, or an adapter like EASIdentityRegistry (attestation-based, e.g. Coinbase Verifications on Base). Against a real registry:

forge script script/DeployDeliberate.s.sol:DeployDeliberate \
  --sig "run(address)" <IDENTITY_REGISTRY> \
  --rpc-url <network>

On test networks without a registry, runWithMockRegistry() deploys a MockIdentityRegistry (everyone counts as registered) alongside. For Base Sepolia, verified on Blockscout (keyless), with a funded keystore account (cast wallet import):

forge script script/DeployDeliberate.s.sol:DeployDeliberate \
  --sig "runWithMockRegistry()" \
  --rpc-url https://sepolia.base.org \
  --account <KEYSTORE_ACCOUNT> \
  --broadcast \
  --verify --verifier blockscout --verifier-url https://base-sepolia.blockscout.com/api/

The script prints both addresses; the deliberate address and its deployment block feed the indexer's config.base-sepolia.yaml and the frontend's VITE_DELIBERATE_ADDRESS (deployment pipeline: contracts -> indexer -> frontend).

Layout

src/        The Deliberate contracts, interfaces, types, and utilities.
test/       Foundry tests and mocks.
script/     Deployment scripts.

About

No description, website, or topics provided.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages