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.
Historical Significance
This is the pattern The DAO was built on, reduced to something one person could deploy: votes weighted by a 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
Homestead arrived in March 2016 and the ethereum.org tutorials were rewritten around the transfer and balanceOf names that ERC-20 was standardising. Deploying a token or an organisation had become a matter of filling in constructor arguments, and most of what went on chain in this period is exactly that.
Key Facts
Description
The democracy contract from the ethereum.org tutorial: an association whose members are whoever holds a balance in a separate shares contract, and whose decisions are transactions the association itself sends.
Any holder may open a proposal naming a recipient, an amount in whole ether, a 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 vote for or against until the debating period expires, one vote each.
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 balance each voter holds at that moment rather than when they voted, and the tally has to clear a minimum quorum before it counts.
Heuristic Analysis
The following characteristics were detected through bytecode analysis and may not be accurate.
Homestead Era
The first planned hard fork. Removed the canary contract, adjusted gas costs.
Bytecode Overview
External Links
Related contracts
token
Same deployerA shares contract that reports every balance as zero until three rounds of delegation have run, then answers with the delegated weight.
0xe81537...03263bMarch 26, 2016Association
Same eraThe ethereum.org democracy tutorial: token holders propose a transaction, vote on it for a fixed period, and the contract sends it if it passes.
0x8bfd7f...2aea40March 16, 2016Crowdsale
Same eraThe ethereum.org crowdsale tutorial: contributions run to a deadline against a goal, pay out a separate reward token, and are refunded if the goal is missed.
0x9af2b1...3a4858March 17, 2016Crowdsale
Same eraThe ethereum.org crowdsale tutorial: contributions run to a deadline against a goal, pay out a separate reward token, and are refunded if the goal is missed.
0xb83820...872c31March 24, 2016Contract 0xdbbf29...30cace
Same eraBlock-height timelock (Homestead, Apr 2016) that releases its full ETH balance to a fixed beneficiary at releaseBlock, self-scheduling a wake-up via Piper Merri
0xdbbf29...30caceApril 4, 2016Contract 0x118a31...f45f0a
Same eraBlock-height timelock (Homestead, Apr 2016) that releases its full ETH balance to a fixed beneficiary at releaseBlock, self-scheduling a wake-up via Piper Merri
0x118a31...f45f0aApril 4, 2016