Back to Home

Association

Utility
0xfab9417a7d53...ae84e09b338f
FrontierContract #6,370Source VerifiedEdit this contract
Deployed January 12, 2016 (10 years ago)Block 834,943

The ethereum.org democracy tutorial: token holders propose a transaction, vote on it for a fixed period, and the contract sends it if it passes.

Frontier EraVerified Source

Historical Significance

This is the pattern The DAO was built on, reduced to something one person could deploy: votes weighted by token balance, a fixed debating period, and a passing proposal that executes as a raw call from the treasury. The tutorial also shows the defence that mattered, committing to a hash of the transaction when the proposal opens so that voters and executor cannot be shown different code. Weighing votes at execution time rather than at voting time is the flaw it kept: a voter can sell their shares and their vote still counts.

Context

The democracy tutorial sat on ethereum.org beside the token and crowdsale tutorials and was revised repeatedly through 2016. Copies of it were deployed both before and after The DAO was drained in June 2016, which suggests it was read as a worked example of shareholder voting rather than as a warning.

Key Facts
Deployment Block
834,943
Deployment Date
Jan 12, 2016, 02:43 AM
Code Size
3.4 KB
Gas at Deploy
960,170
Transactions by Year
20161

Description

The democracy contract from the ethereum.org tutorial: an association whose members are whoever holds a balance in a separate token, and whose decisions are transactions the association itself sends.

Any holder may open a proposal naming a recipient, an amount in whole ether, a text description and the bytecode of the transaction to send. What is stored is a hash of the recipient, the amount and that bytecode, so the exact transaction being voted on is committed in advance and cannot be swapped afterwards. Holders then vote for or against until the debating period expires, and each address may vote once.

After the deadline anyone may execute the proposal, supplying the bytecode again for the contract to check against the stored hash. Votes are weighed by the token balance each voter holds at that moment, not at the time they voted, and the tally has to clear a minimum quorum measured in shares before it counts. If more weight is in favour than against, the association makes the call with the proposed value attached.

This one takes its shares from the token at 0x5e8d6d89fc570e6e1906377c696204d8a7de3086, requires 100 shares of weight for a vote to count, and gives each proposal 10 minutes of debate.

Heuristic Analysis

The following characteristics were detected through bytecode analysis and may not be accurate.

Detected Type: Utility

Bytecode Overview

Opcodes3,467
Unique Opcodes189
Jump Instructions133
Storage Operations110

External Links

Related contracts