Skip to content

How to deploy a DAO

Griff Green edited this page Apr 19, 2016 · 9 revisions

With great power comes great responsibility - Peter Parker's Uncle Ben

Deploying a DAO can seem very technical, and without a tutorial, it would be very difficult for a non-Dev to accomplish. This tutorial will walk you through the steps required to deploy your own DAO. If you run into complications, please add a short description of your issue at the end of this wiki so that we can help solve your problem and prevent others from getting stuck in the same way. Remember this is a WIKI, feel free to edit anything you think could be said more clearly!

Together we can DAO-ify the world.

Pre-requisites:

Understand how to work with the Ethereum Wallet on the Testnet and understand how to work with DAOs. It is HIGHLY recommended that you begin with this blog post and at least get to "The WORK!" section.

Other blog posts that will help you understand the inner workings of the DAO are here, here, and here, and having Christoph Jentzsch's White Paper available for reference will be incredibly helpful.

##1. Gather the information you will need to Deploy your DAO.

For your first DAO, it is always best to practice on the testnet, but ether way, if you are deploying a practice DAO for fun or a DAO to start your own country, you will need to decide the following instantiating inputs for your DAO before you begin.

  1. curator The Ethereum address of the Curator for your DAO (typically a multisig wallet contract)
  2. proposal deposit The amount (in wei) to be paid as a deposit for a proposal. After a vote in the community Slack channel, it was decided that 2 Ether (2 * 10^18 wei) would be a reasonable number to start with, this can be changed by the DAO later through a proposal.
  3. min tokens to create The minimum number of DAO tokens (in its base unit) which need to be created during the Creation phase (e.g. 5.000.000 DAO = 5 * 10^22 base unit DAO)
  4. closing time The Unix time at which the creation phase ends, use http://www.unixtimestamp.com/ to determine this integer.
  5. private creation The only address which is allowed to create tokens. For a public DAO Creation, this field is left empty.

##2. Create a Text file of the applicable smart contracts.

There are 4 smart contract files that make up the DAO. It will be necessary to comment out or delete the "import" lines in the contracts. Merge these files together in this order:

  1. ManagedAccount.sol (https://github.com/slockit/DAO/blob/master/ManagedAccount.sol)
  2. Token.sol (https://github.com/slockit/DAO/blob/master/Token.sol)
  3. TokenCreation.sol (https://github.com/slockit/DAO/blob/master/TokenCreation.sol)
  4. DAO.sol (https://github.com/slockit/DAO/blob/master/DAO.sol)

Save this text file as a .sol extension type and if you want to edit the rules of your DAO, this is where you would do it.

##3. Compile your DAO

Technically, the DAO's smart contracts need to be compiled using a Solidity Compiler. The resulting bytecode, appended with the construction parameters using the Ethereum Contract ABI (also known as a JSON interface), needs to be set as the data field of a transaction with no receiver specified (empty array, not zero), which needs to be sent to the Ethereum network. There are many complicated ways to do this, and if you are an Ethereum developer, that is all you need to know.

If you didn't understand any of the above paragraph, that's ok! If you are a non-dev it is actually very easy to do the above steps thanks to Fabian Vogelsteller and Alex an de Sande's Ethereum Wallet. Once it is installed and synced, go to "Contracts" on the top right side and choose "Deploy New Contract".

There you can delete the default "MyContract" code in the "Solidity contract source code" field and paste in your text file created in Step 2. Scroll to the bottom of the wallet and click the blue "Deploy" button to allow the Ethereum Wallet to do all the hard work for you.

You do not have to send any ETH when deploying the contract, gas will be taken from your account automatically when you input your password to decrypt your private key.

##4. Deploy the DAO_Creator Contract

In step 3, the Ethereum Wallet compiled your DAO contract, but your DAO is not yet deployed. To store the code you created in step 2 immutably for the rest of time on a blockchain you will have to use the helper contract DAO_Creator.

On the right side you can pick a contract to be deployed. Choose DAO_Creator and again click the "Deploy" button. This will deploy the DAO_Creator contract to the blockchain. After the block with this transaction is mined, the address of the contract can be seen as the receiver in the "latest transaction" list (by clicking on the identicon of the address). Please copy this address and store it.

##5. Repeat Step 3.

Now that your customized DAO_Creator helper contract has been deployed on the blockchain, you can deploy your DAO. To do that you again need to compile your text file created in Step 2.

Go to "Contracts" on the top right side and choose "Deploy New Contract". There you can delete the default "MyContract" code in the "Solidity contract source code" field, paste in your text file, and scroll to the bottom of the wallet and click the blue "Deploy" button.

##6. Deploy the DAO Now we can go through the same steps as in Step 4 but instead of picking the DAO_Creator we pick the DAO contract. This contract need to be deployed with several constructor parameters which need to be set as mentioned in Step 1 with one addition:

  • curator The Ethereum address of the Curator for your DAO (typically a multisig wallet contract)
  • dao creator Address of the DAO creator which was just created in the previous step
  • proposal deposit The amount (in wei) to be paid as a deposit for a proposal. After a vote in the community Slack channel, it was decided that 2 Ether (2 * 10^18 wei) would be a reasonable number to start with, this can be changed by the DAO later through a proposal.
  • min tokens to create The minimum number of DAO tokens (in its base unit) which need to be created during the Creation phase (e.g. 5.000.000 DAO = 5 * 10^22 base unit DAO)
  • closing time The Unix time at which the creation phase ends, use http://www.unixtimestamp.com/ to determine this integer.
  • private creation The only address which is allowed to create tokens. For a public DAO Creation, this field is left empty.

After every value is set, the DAO can be deployed and the address can be retrieved in the same manner as explained above for the DAO_Creator contract. The address of the contract will be seen as the receiver in the "latest transaction" list (by clicking on the identicon of the address).

Congratulations. If you were able to complete these steps, the DAO you created is now in it's Creation phase.

If you had issues, please state them below.

##Can't get contract to compile

"delete or comment out the 'import' lines" solved my issue.

Clone this wiki locally