ERC-1417 ERC-1417 Poll Voting Standard (Poll Standard)

Stagnant · Other · created 2018-09-16

On Ethereum, voting eligibility, vote weight calculation, result processing, and tallying are split into four independent modules, allowing various kinds of voting contracts to be implemented and queried through a single standard interface.

Why it is needed

Until now, whenever consensus or opinion gathering was needed on a blockchain, someone would deploy an arbitrary voting contract, but there was no standard way to query or verify that contract. As a result, even though voting data remained transparently on-chain, it felt completely opaque to non-developer end users. Abyss, the first DAICO, also suffered from poor user experience and transparency. In addition, eligibility to vote was often limited to token holdings alone, making flexible governance design difficult, and there was no standard event log to audit after the fact whether an admin had secretly added or removed voters, making manipulation hard to trace.

What to implement

In depth

Four-module structure

ERC-1417 splits a poll into four modules: determining voter eligibility (voterbase), calculating vote weight (vote weight), processing the side effects of voting (consequence), and tallying votes (tally). Each module can be swapped independently, allowing different voting methods such as one person one vote, token-proportional voting, capped token-proportional voting, liquid democracy, reputation-based voting, and quadratic voting to be implemented on top of the same interface.

Voting and revocation

vote(_proposalId) takes the index of the proposal to vote for from the proposals array, records the vote, and stores that proposal ID together with the voter's address to allow later revocation. revokeVote() takes no arguments and revokes the previous vote. Since the proposal index is uint8 and, for practical reasons in implementations such as getProposals and winningProposal, it is recommended to limit the number of proposals to 32, for/while loops should be avoided if more proposals are needed.

Voting eligibility checks and the TriedToVote event

canVote(_to) determines whether the given address can vote, and in an EIP-1261 based implementation, logic can be added to check attributes using the entity addresses returned by getProtocolAddresses and the IERC1261 interface. If someone without eligibility attempts to vote, only a TriedToVote event is recorded instead of CastVote, allowing an admin's later unjust addition or removal of voters to be audited off-chain.

Vote weight calculation

calculateVoteWeight(_to) calculates and returns the vote weight held by the given address. Depending on the implementation, this can be one person one vote (weight 1), weight proportional to ERC-20/ERC-777 token holdings, weight proportional only up to a certain cap, weight that sums delegated votes, weight that sums reputation received from other voters, or quadratic weight corresponding to the square root of the fee paid when voting, among other methods.

Tally query functions

getVoteTally and getVoterCount return the accumulated voting power and the number of voters (NoV) for a specific proposal respectively, while getVoteTallies and getVoterCounts return the lists for all proposals. winningProposal returns the index of the currently leading proposal, and getVoterBaseDenominator returns the total number of voters for single-proposal polls or the total sum of voting power for multi-proposal polls, used for ratio calculations. Recording NoV separately from total voting power is designed to reveal the extent to which a small number of voters monopolize voting power in weighted voting.

Querying poll metadata

getName, getPollType, and getVoterBaseLogic return the poll's name, type, and description of the voter eligibility logic as set in the constructor. getStartTime and getEndTime return the poll's start and end times as Unix time, and getProtocolAddresses returns the list of entity contract addresses used in EIP-1261 based eligibility determination.

No end trigger, indefinite polls allowed

ERC-1417 does not include in the standard any logic that automatically executes when a poll ends. This is because such behavior fits the modularity intent better as a separate contract that reads the poll result, and because it cannot be applied when combining results from multiple polls or to polls with no end time. For the same reason, ERC-1417 also allows indefinite polls with no end time, so they can be used together with an action contract that reacts whenever a certain threshold is reached.

Proposal status: Stagnant

This proposal is currently in Stagnant status, meaning it is no longer being actively discussed or progressed and has stalled.

Original ERC · ← ERCs