Is it possible to implement a DAO (Decentralized Autonomous Organization) with Ethereum? If so, has it been done in an effective way? Are there any examples?
A nice and simple DAO example is right on the Ethereum Wallet download page: (scroll down on the page to see it) https://github.com/ethereum/mist/releases
You can test a complete DAO with these contracts, by following these steps:
- Get the code to create a Custom Token: go to contracts > deploy new contract
- Use 10000 as the
_supply, 2 as
%as the symbol. Click deploy and wait a few seconds for your code to be picked up.
- Now go to the contract page (its on the "latest transaction" table on the dashboard or on the Contracts page) and click "copy address to clipboard". Save that somewhere.
- Get the code to create a DAO: and paste it on the contracts > deploy new contract page.
- Use the address you saved earlier as the
sharesAddress, put 1000 on
minimumSharesForVotingto reject any proposal that doesn't have at least 10% of shares behind it and put any number you want on
minutesForDebate. If you just want to do a quick test, use a small amount like 5-30, but if you actually want it at least a week of full debates before any proposal can be executed, then put 10000 or more.
- Click deploy and wait a few seconds for the transaction to be picked up
- Go to the contract page and click "show contract info". You can read all the information about the contract on the left column.
newProposal. Add the recipient you want to receive the ether, the amount and a string. If you want it to execute some code, add the contract data on the last box. Click "execute".
- Pick vote. Select the user that you want to vote with, the proposal number and click "YES" if you support the proposal.
executeProposal. Proposals can only be executed if the minimum amount of time to vote has passed and if enough users have voted to surpass the minimum quorum. Choose the proposal number, click "execute" and it will count up the votes. If it passes it will send the amount asked and execute the code.
You can find the details here in the official website
as in the docs
Take a moment to dream about the revolutionary possibilities this would allow, and now you can do it yourself, in under a 100 lines of code:
Its the easiest way that it ever possible
Yes it can be done and yes it has been done :)
There is a DAO for the Dogecoin-Ethereum Connection Bounty.
EDIT: Providing more details.
The DAO contract used was written by Alex Van De Sande and is located here. The contract provides a methods to add DAO members, remove members, add proposals, vote on proposals, execute proposals, and set the specific rules for the DAO/proposals (such as minimum quorum).
executeProposal function is very interesting because proposals are executed using actual Ethereum bytecode. The contract compares the Keccak hash of the proposal bytecode and if enough votes occur to perform execution it will compare the hash of the proposal bytecode to the execution bytecode. If the hash comparison is true, the bytecode is ran using this line:
Anyone can monitor and interact with the contract by following these instructions.
One of the best examples of a DAO I've seen on Ethereum right now is being made by the Boardroom project.
This is more than just a simple single DAO voting contract. This is a collection of 13 solidity contracts and a frontend that can manage a small group. Boardroom is one of the ConsenSys projects. I only wish they were compatible with Mist. (They are still in Alpha, so you'd likely want to read through everything very carefully first.)