Decentralized Autonomous Organization - DAO

By @xourse3/17/2018dao

This is the first of two articles related to the DAO. In the second one we will be presenting the steps to deploy the DAO Solidity Smart Contract. It's IMPORTANT to note that this is for LEARNING purposes only. This code is not intended to be used in production. Use at your own discretion.

If you don´t have a Steemit account we recommend you create one and try the platform out since you can get paid for your content and curating. Also follow us on Medium https://medium.com/@Xourse

For an introduction to Solidity look at our original introductory post: https://steemit.com/solidity/@xourse/solidity-for-beginners

A DAO is an organization which main objective is to provide a new decentralized business model for organizing both commercial and non-profit enterprises, through rules encoded as computer programs called smart contracts. The code of the first DAO is open-source and it can be used by anyone but it doesn’t provide any warranty so it needs to be set up carefully. The DAO was first instantiated on the Ethereum block chain, and had no conventional management structure.

Our forked code from the DAO: https://github.com/Xourse/Dao

Roles

Owner, this role is responsible for managing the contract, it can execute functions like add and delete members of the organization and transfer the contract ownership which means it can delegate its position to another member and set up the voting rules.
Member, this role is for a person that is part of an organization, its main function is voting for a proposal in support or against, also it can create its own proposals and buy tokens.

Contract Funtions

DAO function: smart contract constructor function that contains the following parameters to set the curator and the address for the contract and can create another contract from it.
_curator The Curator
_daoCreator the contract able to (re)create this DAO
_proposalDeposit the deposit to be paid for a regular proposal
_minTokensToCreate Minimum required wei-equivalent tokens to be created for a successful DAO Token Creation
_closingTime Date (in Unix time) of the end of the DAO Token Creation
_parentDAO If zero the DAO Token Creation is open to public, a non-zero address represents the parentDAO that can buy tokens in the phase.
_tokenName the name that the DAO's token will have
_tokenSymbol the ticker symbol that this DAO token should have
_decimalPlaces the number of decimal places that the token is counted from.

newProposal function: This function is a way to send ether to a specific address and uses the following parameters:
_recipient the recipient of the proposed transaction.
_amount the amount of wei to be sent in the proposed transaction.
_description the proposal description.
_transactionData the data of the proposed transaction.
_debatingPeriod how much time we will set to evaluate the proposal defined as seconds.
checkProposalCode function: evaluate the proposal code
_proposalID the proposal ID
_recipient the recipient of the proposal
_amount of ether involved in the transaction
_transactionData Transaction data
_supportsProposal Save the voting answer Yes if the member support the proposal or No if it doesn’t support it.
Vote function: this function could be considered as the main reason of a smart contract creation, it would allow us to decide which proposal we want to support or not.
_transactionData has been voted for or rejected, and executes the transaction in the case it has been voted for.
_proposalID the proposal ID
_transactionData the data of the proposed transaction
executeProposal: If the proposal is supported this function will be call executed, it handles the following parameters:
_proposalID the proposal ID
_transactionData the transaction data

The DAO Workflow

The following diagram shows the sequence of actions that can be taken once the DAO contract has been deployed.

Xourse: A software development studio for blockchain, machine learning and your enterprise systems. Located at the rising technology hub of Costa Rica. Contact us at [email protected]

2

comments