Only this pageAll pages
Powered by GitBook
1 of 9

clrfund for everyone

Loading...

Networks

Loading...

Loading...

Loading...

Coordinator Guide

Loading...

Loading...

Loading...

xDAI

Chain Id: 100

Libraries

Library

Contract Address

PoseidonT3

0xB00491C784aB8121C9B5485Fe2ec5f63c923ce89

PoseidonT6

0xa42F9FC8B41e168354fc84e7942f723afa1797BD

QuadVoteTallyVerifier

0x37B3C66304C80Ab08Ec40255703297d4FE548ad4

BatchUSTVerifier

0xBEB68DaA7A4f870d819BbBA4983dc76084EACA64

Clr.fund Instances

DEV Instance

Instance

Detail

URL

Funding Factory

0xD6F68b2b71Fafaa44B9d8c1d614F85E69088f959

MACI Factory

0x2665e2322F4590604E3161044e6b0Ab7700b23D0

Recipient Registry

0xa813ab52eb61A2a472c56fEBDFFBB6C0F483885d

User Registry

0x6933C3b43663E4e595D71aEb4C07282EBFA0a254

PROD Instance

Instance

Detail

URL

Funding Factory

MACI Factory

Recipient Registry

User Registry

Deployer: Hash:

Subgraph:

Test UI: Hash:

clrfund-xdai.on.fleek.co/#/
QmR7Zz5eMkoNPV89M3osA5jf1czMdQNoFEbHJL3MBM4hB6
thegraph.com/legacy-explorer/subgraph/daodesigner/clrfund-xdai
clrfund-xdai-ui.on.fleek.co
QmdqXA8W8goHK2izW7jVgsSbYNDc2MGqvGKwAsPJmAk1yA
clrfund-xdai-ui.on.fleek.co

Introduction

Clr.fund for everyone is a suite of products that is designed to Fund your community’s public goods with provably fair, collusion-resistant quadratic funding.

You can use the Clr.Fund Deployer to deploy your own quadratic funding application. Empower your community to choose and fund its future, in a fully decentralized manner.

Getting Started

Clrfund For Everyone is currently in development, our alpha versions of the application are available in the following networks.

Clrfund For Everyone

xDAI
Rinkeby
Arbitrium

Arbitrium

Chain Id: 421611

Libraries

Library

Contract Address

PoseidonT3

0xc9123d08eedc2f6f09f6005ebb36a0556c9141f4

PoseidonT6

0x073A0B9136E96325d95DF5b77775B15c707Eb5E1

QuadVoteTallyVerifier

0x48C5BE19100c8f2f9563878214DD90B23697941b

BatchUSTVerifier

0xCaaad21Ca0e7733347ca7Ac414b149B7583e54b7

Clr.fund Instances

DEV Instance

Instance

Detail

Funding Factory

0x6318c345d0338C4BB240296E295f62748dbcA269

MACI Factory

0xc15A34bD7Ef55361414A7c2a0b010e326a3CAA7C

Recipient Registry

0x1c5e8F54c6B677A7d9B93ED27d4E14386E6a0f64

User Registry

0xF04B6698D3a947bE87967e077a0117F42951672D

Deployer: Hash:

Subgraph:

Test UI: Hash:

https://clrfund-arbitrum.on.fleek.co
QmZaSu3zXfJEkJugqh8D8E7o5VbSgScbX6doF8QF8iQCF8
https://thegraph.com/legacy-explorer/subgraph/daodesigner/clrfund-arbitrum/
clrfund-arbitrum-ui.on.fleek.co
QmSbzHgFuj2Zi9KWecB6x4TLDH59Xqa8PGVFuRS6zEZScJ

FAQ

User interface

User interface deployer is in development. Please contact designerdao.eth@gmail.com for help on launching a user interface for your contracts.

Running the funding round

Administrator of clr.fund instance should set parameters before starting the funding round. Once the round has started, it is mostly autonomous and its parameters can not be changed. It can only be finalized (allowing recipients to claim allocated funding) or cancelled (allowing contributors can withdraw their funds).

  • total-spent value can be found by key totalVoiceCredits.spent.

  • total-spent-salt value can be found by key totalVoiceCredits.salt.

Providing matching funds

To become a funding source the address should be added the list of funding sources by clr.fund administrator. At the end of each funding round clr.fund checks token allowance for the FundingRoundFactory contract address and transfers allowed amount of tokens to the matching pool.

The arguments for transferMatchingFunds method should be taken from tally.json file published by the :

The funding source is an ethereum address from which clr.fund can receive matching funding using the . It could be an externally owned account or a contract (such as DAO).

coordinator
allowance mechanism

Trusted Ceremony Params

Coordinator

Coordinator manual

Coordinate using MACI CLI

git clone https://github.com/appliedzkp/maci.git
cd maci/
git checkout v0.9.4

Follow instructions in README.md to install necessary dependencies.

Medium Circuits

cd circuits
./scripts/buildSnarksMedium.sh

x32 Circuits

cd circuits
./scripts/buildSnarks32.sh

Recompile the contracts:

cd ../contracts
npm run compileSol

Generate coordinator key

cd ../cli
node build/index.js genMaciKeypair

A single key can be used to coordinate multiple rounds.

Tally votes

Decrypt messages and tally the votes:

cd ../cli
node build/index.js genProofs \
    --eth-provider <json-rpc-api-url> \
    --contract <maci-address> \
    --privkey <coordinator-private-key> \
    --output proofs.json \
    --tally-file tally.json

Coordinator private key must be in MACI key format (starts with macisk). Ethereum private key can be any private key that controls the necessary amount of ETH to pay for gas.

The genProofs command will create two files: proofs.json and tally.json. The proofs.json file will be needed to run the next command which submits proofs to MACI contract:

node build/index.js proveOnChain \
    --eth-provider <json-rpc-api-url> \
    --contract <maci-address> \
    --privkey <coordinator-private-key> \
    --eth-privkey <eth-private-key> \
    --proof-file proofs.json

The process may take several hours. Results can be found in tally.json file, which must then be published via IPFS.

await fundingRound.publishTallyHash('<CID>')

Coordinate using clrfund scripts

Generate coordinator key

cd contracts/
yarn ts-node scripts/generate-key.ts

A single key can be used to coordinate multiple rounds.

Tally votes

Switch to contracts directory:

cd contracts/
ipfs get --output snark-params QmRzp3vkFPNHPpXiu7iKpPqVnZB97wq7gyih2mp6pa5bmD

Set the path to downloaded parameter files and also the path to zkutil binary (if needed):

export NODE_CONFIG='{"snarkParamsPath": "../../../contracts/snark-params/", "zkutil_bin": "/usr/bin/zkutil"}'

Decrypt messages and tally the votes:

COORDINATOR_PK=<coordinator-private-key> COORDINATOR_ETH_PK=<eth-private-key> ROUND_ADDRESS=<funding-round-address> yarn hardhat run --network xdai scripts/tally.ts

Result will be saved to tally.json file, which must then be published via IPFS.

Circuits

Parameters

x32 Circuits

medium

Clone the and switch to version v0.9.4:

Download for 'medium' circuits into circuits/params/ directory and rebuild the keys:

Download for 'x32' circuits into circuits/params/ directory and rebuild the keys:

Finally, the of tally file must be submitted to FundingRound contract:

Install (see instructions in ).

Download for 'medium' circuits to snark-params directory. Example:

MACI repo
zkSNARK parameters
zkSNARK parameters
CID
zkutil
MACI readme
zkSNARK parameters
zkSNARK parameters
zkSNARK parameters

Rinkeby

Chain Id: 4

Libraries

Library

Contract Address

PoseidonT3

0x2cfb1ab10ee9a8fb4cb95f9c8dd88a44af6948fd

PoseidonT6

0xab0980134ed24e9621559b7e761db7384Ed3fc29

QuadVoteTallyVerifier

0x7D564C9A8bA6268D035397eb0f1fC5D891D110BF

BatchUSTVerifier

0x0972D68Cbe2437C7227840F86d8F00D9FCcE4364

Clr.fund Instances

DEV Instance

Instance

Detail

Funding Factory

0x5306446A91e55Fa42a1B58763B7E1618cD8341AB

MACI Factory

0x947157a5E0afa0F5dF61a1D83B4a525e79E00725

Recipient Registry

0xeE0a0e99D6167954C02FE28763eF3E9163080d2C

User Registry

0xE9927F0ec5cCfDDBad23268A742A404cc87CC58a

Deployer: Hash:

Subgraph:

Test UI: Hash:

https://clrfund-rinkeby.on.fleek.co/#/
QmeR6ho2WJKiBhcxRjV77qWDYTi8szK5CyS7RnRAXEEJqN
https://thegraph.com/legacy-explorer/subgraph/daodesigner/clrfund-rinkeby
clrfund-rinkeby-ui.on.fleek.co/#/
Qmc9uRCUXTQq66YkYXW4Eec2ZiYU3qJ27nF9eCdDKuS8rz