#Ether 7: Video walkthrough of DAO simple proposal tutorial

makoto_inoue
Apr 2, 2016 · 2 min read

When you send money from one account to another, you are interacting with human. In the world of Ethereum that may not be the case.
Decentralized Autonomous Organization(DAO) sounds very complex and difficult but it’s basically like a bot on a chat system.

Example requesting hubot chat bot (https://github.com/shokai/hubot-rss-reader) to get rss list

A bot reacts to your request based on the certain predefined rules. In case of Ethereum, it enables you to interact with the DAO contract with money (with their own currency Ether). You can deposit pool of money and each member of DAO can propose and vote how the money should be spend. You can code your contract to make the decision in the democratic manner without human intervention. This may open up a lot of possibility and I am super excited to be bale to experience how it works.

In this video walk through of the Ethereum’s DAO tutorial, we only cover the basic proposals as follows.

1. Create a ‘Congress’ contract (just like you created the token contract)
2. Watch someone else’s contract using ‘interface file’ and ‘address’.
3. Add a member to the contract.
4. Send some money to the `Congress` account as deposit.
5. Propose to send some of the deposit to another account.
6. A member vote for the proposal.
7. Once the deadline is passed, the proposal can be executed.

There are a couple of things I learnt while going through the tutorial.

8. An error is raised when non member tries to vote. The rule is enforced because it goes through onlyMembers modifier as part of newProposal function.

function newProposal(
// some arguments
)
onlyMembers
returns (uint proposalID)
{
// some code
}

If you look into the onlyMembers code, you can see that it throw if msg.sender is not the member.

/* modifier that allows only shareholders to vote and create new proposals */
modifier onlyMembers {
if (memberId[msg.sender] == 0
|| !members[memberId[msg.sender]].canVote)
throw;
_
}

It is very powerful to be able to write a code that allows you to pool and distribute money with total strangers without any authorities. At the same time, I think there are possibilities (or you may call bugs) when a contract goes into unexpected deadlock scenario and money cannot be taken out from the contract at all.

makoto_inoue

Written by

http://makoto.github.io/me

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade