Back to Home

Association

Utility
0x4e4ae7161c76...294ca08a2e3d
DAO ForkContract #22KSource VerifiedEdit this contract
Deployed August 5, 2016 (10 years ago)Block 2,011,922

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.

DAO Fork 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
2,011,922
Deployment Date
Aug 5, 2016, 12:34 AM
Code Size
3.4 KB
Gas at Deploy
1,080,904
Transactions by Year
20241

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 0x3d2ff34915a02e867dce19507d03712761a29cd1, requires 50 shares of weight for a vote to count, and gives each proposal 12 hours of debate.

Heuristic Analysis

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

Detected Type: Utility
Has ERC-20-like patterns

Bytecode Overview

Opcodes3,481
Unique Opcodes197
Jump Instructions148
Storage Operations108

External Links

Related contracts