npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

qv-contracts

v0.0.2

Published

Quadratic Voting contracts

Downloads

1

Readme

Quadratic Voting Contracts

This project is about Ethereum smart contracts for running quadratic voting (QV). It can also be used as a starter to build more complicated QV applications with minimal anti-collusion infrastructure (MACI).

Getting started

Run tests

  • Run yarn to install the dependencies
  • Run yarn build to compile the contracts and generate typechain files.
  • Run yarn run test test/QuadraticVoting.ts to run the tests.

Run scripts

  • Run yarn start to start localhost network.
  • Run yarn hardhat run scripts/maci-cycle/0-deploy.ts --network localhost to deploy contracts.
  • Run yarn hardhat run scripts/maci-cycle/6-genProofs.ts --network localhost to generate proofs with docker-compose. (Note that you should have this maci docker image and the generated zkeys and witnesses.)
  • Run ./test/runScripts0-8.sh to run through the cycle of maci.

How to design a QV application?

Quadratic voting is a way of making collective decisions, also a tool to elicit individual preferences over a given set of alternatives.

The idea is to associate a cost with a vote. Voters buy as many votes as they wish by paying the square of the votes they buy using some currency which is called “voice credit”. Each voter pays some voice credits for her votes, and a vote pricing rule is a quadratic function:

Cost to the voter = (Number of votes)^2

The cost to the voter, which is the the payment for votes, may be through either an artificial currency or real money. So our degree of freedom is the design of the voice credit and the way of applying the voting results.

There are two main considerations in designing a QV app:

  1. What's a unit of voice credit, how to distribute voice credits to the voters, and whether voters can retain voice credits for future votes?
  2. What functions do you want to execute according to the voting results?

Application: Quadratic Hackathon [WIP]

The prize pool will be split among winners pro-rata to the number of votes they received.

Inspirations