-
Notifications
You must be signed in to change notification settings - Fork 497
Understanding the DAO accounting
Author: Jordi Baylina
## Introduction
I wrote this guide after spending lots of hours trying to understand the DAO accounting system. Hope that this guide helps any one that’s studying the DAO contract at https://github.com/slockit/DAO or simply wants to deep in how the accounting is carried inside the DAO contract.
DAO tokens ( Ð ) represents the ownership of the DAO. If you have Ð then you are member (aka. DTH) of the “The DAO”,
The ownership percentage is calculated as:
Where totalSupply is the total number of DAO tokens that exist. The totalSupply is fixed after the Creation phase, and only decreases as a result of splits. The act of splitting burns DAO tokens.
Every time that a proposal is executed and some money gets out of the DAO all the DTH (Dao Token Holders) receive reward tokens. Theses reward tokens represent the ownership of the investment made by the DAO
For each Ether that gets out of the DAO, 1RT is generated. The ownership of this RT is the whole DAO.
For example if a DAO invest 140Ξ in a proposal, the DAO will generate and hold 140RT. If Alice owns 10% of the DAO tokens, we can say that Alice owns 14RT implicitly. As the DAO Tokens are backed by RT and Ξ that are held by the DAO.
What’s important to understand here is that the DAO never just spends money, it only supports projects. The ownership of all the returns the projects provide is determined by the reward token holders.
What’s interesting here is that when somebody splits, they still keep the rewardTokens accumulated until the split. They do not lose the ownership of the investment! Of course, after the split, They will not receive any more reward tokens in the following DAO investments but they have the rights to receive the return of the investment proportionally to their accumulated rewardsTokens until the split.
Here **totalRewardToken **is the total investment made by the DAO in its history. This number increases on each investment but never decreases.
The ether inside the DAO can reside in the main contract or in some child contracts called Managed Accounts.
A managed account is a different contract than the main DAO contract but controlled absolutely from the main DAO contract. That means that only the DAO contract can payOut money from a managedAccount.
Like any other contract, the DAO contract can hold ether by itself. This is the default place where ether resides.
The ownership of the money in this account is determined by DAO tokens . Each one with the proportion of their tokens.
During the Creation phase, the price of the DAO Token is not the same. At the beginning of the process, 100Ð cost 1Ξ. But at the end to the process 100Ð costs 1.5Ξ.
There is a simple attack that consists of buying tokens at price 1 and then split immediately after the creation process ends. In this case, the attacker would get more than 1Ξ for each Ξ invested if there are people buying Ð at more than 1Ξ/100Ð.
To solve that, developers created the extraBalance account. This account stores the extra money that the DAO gets in the final phases above 1Ξ/100Ð.
For example, if you buy 100Ð for 1.5Ξ just before the Creation phase ends, then there will be 1Ξ that will go to the main DAO account and 0.5Ξ that will go to the extraBalance account.
In this case, all the splits that go immediately after the Creation phase closes will get exactly 1Ξ/100Ð regardless what he Paid for each Ð.
The ether in the extraBalance account will go to the main DAO account when a proposal is approved and at least the same amount of ether that the extraBalance account has been sent to regular proposals.
The DAO, like any other “for profit” organisation is created because there are people (DAO Token Holders) that expect that sooner or later will receive rewards from their investment into projects
When the DAO approves to pay rewards to their tokenHolders via a proposal, what it does is transfer the total amount of Ethers that wants to pay to the rewardAccount.
Once the Ether is in this account, the tokenHolders can take the Ether that corresponds according to the Ð that holds.
The DAO will invest in some proposals. Those investments, directly or indirectly should return the investment to the DAO. For example, the DAO% will be send to this account.
The owner of the Ether in this account belongs to any body that pay the investments, and that is not only the current DAO token holders, They are also all the child DAO’s that split some day and holds reward tokens.
So, the ether on this account should be distributed according the RewardTokens that the DAO and each child DAO holds.
When there is some Ether in this account, the DAO will probably approve a proposal to takes all the Ether that belongs to it and transfer it to the main DAO account. (It can also opt to transfer the Ether directly to the rewards account).
The split DAOs will do exactly the same when there is some money in his parent DAO DAOrewardAccount that belongs to it because of rewardTokens of the parent DAO before the split.
During the Creation phase, all the Ether will go to the main DAO account and to the Extra Balance.
Concretely, in the phase of rate 1 (before two weeks prior to the Creation phase ends), the Ether will go entirely to the main DAO account.
When the rate increases to more than 1, the extra money because of the increase of the DAO token price, is stored in the extraBalance.
The money in the extraBalance will stay there until at least the same amount of money in the extraBalance is invested in regular proposals.
When a proposal is approved, the amount of money approved is sent from the DAO to the recipient of the proposal.
As a side note, I would like to remember here that it is possible to send the approved amount to a regular account or to a contract. In the last case, the proposal can specify with which methods and with which parameters the DAO contract will call if the proposal is approved.
When a proposal is executed, all the DAO token holders will receive the rewardToken holders. 1RT is equivalent to 1Ξ invested.
For example if Alice owns 10% of the DAO Tokens and 150Ξ are Invested in a proposal, the DAO will generate 150RT of which 15 belongs to Alice.
When an investment pays the DAO, it should do it in the DAOrewardAccount. The most typical example is the DAO% of the Ethereum computer.
When an ethereum computer is installed, an amount of ether (DAO%) will be returned to the DAO via the DAOrewardAccount.
Ether in this account belongs to the reward Token Holders. That is the Main DAO and all split DAO’s in the history.
Ether in DAOrewardAccount will be sent to the main DAO and to all the child splitDAO’s. Each one in proportion to the rewardTokens that hold.
This is done by a proposal in each DAO (including the main DAO) The proposal says to execute the main DAO method retrieveDAOReward().
The ether can be send directly to the main DAO account of the calling DAO or to the rewardAccount if they approve to distribute the rewards to their DAO token holders.
Finally, when some day the DAO wants to distribute dividends to their DAO token holders, the DAO will approve a proposal to send the total amount that wants to be distributed into the rewardAccount.
Once the Ether in this account, the DAO token Holders can call the getMyReward() method to get the portion of ether that belongs to each tokenHolder according to the DAO tokens that each one holds.
- Alice buys 10 Tokens at 1Ξ/100Ð (10Ξ)
- Bob buys 20 Tokens at 1Ξ/100Ð (20Ξ)
- Charlie buys 30 Tokens at 1.2Ξ/100Ð (36Ξ)
- Dave buys 40 Tokens at 1.5Ξ/100Ð (60Ξ)
If the DAO is not fueled, Each tokenHolder recovers the exact money they invest.
The proposal approved is to send 30Ξ to company S to manufacture an ethereum lamp. This lamps will send 1Ξ to the DAOrewardAccount when the end user turn on the lamp the first time.
Ethers Distribution:
Method: executeProposal()
(*) a/b in the account means: a -> ethers in the account actually b -> total ethers sent to this account in its history.
Method: retrieveDAOreward(false)
Method: executeProposal()
Method: transfer()
Method: getMyReward()
Method: getMyReward()
Method: splitDAO()
During the split happen all this thigs.
- Alice gets all penndig rewards (1Ξ)
- A new DAO is created: DAOAl
- The 30 RewardTokens generated until now are divided 3 to DAOAl and 27 to the old DAO.
- DAOreward paid is also split. 10 -> 9 and 1.
- Alice DAO tokens are burned.
Method: splitDAO()
Method: retrieveDAOreward()
The DAOAl main account will increase by 2Ξ more.
Method: retrieveDAOreward(true)
Method: retrieveDAOreward(true)
STEP 13: A new investment is approved for an Ethereum router of 40Ξ to company T 2Ξ will be sent to the DAOrewardAcc when each router is sold.
Method: executeProposal(true)
- Table of Contents
- Wiki Home
- View The DAO on the Ethereum Wallet
- DAO v1.0 Verification and JSON
- DAO Deployment
- The DAO Accounting
- Proposal Creation
- Token Creation and Transfer
- Proposal Voting and Executing
- DAO Splits
- Why Stalking Solo Splitters Makes No Sense
- Turn the Ethereum Wallet into a Mist Browser to Vote
- Proposal Framework Explanation
- PFOffer Workflow
- DAO-Improvement-Requests