Voting
投票
Every token holder can vote on a proposal by calling the vote function.
This function has 2 parameters:
-
proposalIDThe ID of the proposal. -
supportsProposalA boolean (yes/no) on whether the voter supports the proposal or not.
每一個代幣持有者可以通過調(diào)用vote函數(shù)向提議投票。這個函數(shù)有兩個參數(shù):
-
proposalID提議的ID。 -
supportsProposal布爾值(yes/no)表示投票者是否支持提議。
A vote can only be done once and cannot be changed. After the debating period of the proposal it is not possible to vote on it. Additionally the tokens belonging to the address of the sender of the transaction are blocked (cannot be transferred or split) until the end of the debating period to prevent people from voting on proposals and then splitting to not face the consequences of the vote.
投票只能執(zhí)行一次,不能被修改。在提議的討論期之后,將不能再對提議進(jìn)行投票。另外,交易發(fā)送者的投票地址擁有的代幣將會被鎖定(不能被轉(zhuǎn)移或者分割),至到提議討論期結(jié)束,這樣是為了防止人們向提議投票然后又分割,而逃避投票后應(yīng)該承擔(dān)的后果。
WARNING: Be very careful before voting on a proposal. Make sure to double check the proposal's voting deadline because once you vote, your tokens will be blocked from splitting or transferring to another account for the duration of the vote's debating period.
** 警告: ** 在對提議投票前要格外注意。確保已經(jīng)充分驗(yàn)證了提議的投票終止日期,因?yàn)橐坏┠阃镀?,你的代幣會鎖定而不能進(jìn)行分割或者轉(zhuǎn)移到其他賬號,至到投票討論期結(jié)束。
Proposal can be viewed using the public proposals array which is visualized in the Mist Wallet. There one can view the parameters of a given proposal by providing the proposal ID. Those parameters are: recipient, amount, description, votingDeadline, open, proposalPassed, proposalHash, proposalDeposit, newCurator, splitData, yea, nay, votedYes, votedNo and creator. The definition of those can be read in the white paper section 6.3.
提議可以,在Mist錢包,使用公共變量proposals數(shù)組來查看。可以根據(jù)提議的ID查看提議的參數(shù)。這些參數(shù)有:recipient, amount, description, votingDeadline, open, proposalPassed, proposalHash, proposalDeposit, newCurator, splitData, yea, nay, votedYes, votedNo和 creator。這些參數(shù)的定義可以在白皮書的6.3節(jié)中看到。
As a helper to the voter, there exist a function called checkProposalCode. This function is used to check that a certain proposal ID matches a certain transaction. The parameters of the function are:
proposalIDrecipientamounttransactionData
為了幫助投票者,提供了函數(shù)checkProposalCode。這個函數(shù)可以檢查某個提議的ID匹配某個交易。這個函數(shù)的參數(shù)有:
proposalIDrecipientamounttransactionData
If the recipient, the amount and the transactionData match the proposal ID, the function will return true, otherwise it will return false (in Mist this denoted with code checks out). This will be used to verify that the proposal ID matches what the DAO token holder thinks they are voting on.
如果 recipient, amount 和 transactionData 匹配提議ID,這個函數(shù)會返回true,否則返回false(在錢包里用code checks out表示)。這個可以用來驗(yàn)證提議ID是不是DAO代幣持有者想投的那個提議。
Executing
執(zhí)行
在提議討論期結(jié)束后,任何一個人可以調(diào)用executeProposal函數(shù)。它的參數(shù)有:
After the debating period is over, everyone can call the function executeProposal. The parameters are:
proposalIDtransactionData
The function checks whether the voting deadline has passed and that transactionData matches the proposal ID. Then it checks whether the quorum has been met (see Eq. (1) for minQuorum) and if the proposal had a majority of support. If this is the case, it executes the proposal and refunds the
proposal deposit. If the quorum has been achieved, but the proposal was declined by the majority of the voters, the proposal deposit is refunded and the proposal closes.
In the case of a new Curator proposal, it does nothing but closes the proposal when 27 days have passed after the end of the debating period.
這個函數(shù)會檢查投票的終止日期是否已過,以及transactionData 是否匹配提議ID。然后它檢查法定人數(shù)是否滿足(參考minQuorum),以及投票是否獲得多數(shù)人同意。如果滿足以上條件,會執(zhí)行提議并且返還提議的押金。如果法定人數(shù)滿足,但是提議被多數(shù)人拒絕,提議的押金會返還,提議會關(guān)閉。
如果是新的負(fù)責(zé)人的提議,函數(shù)什么也不做,除了在投票討論期結(jié)束后的27天后關(guān)閉提議。
Remark
備注
There are two possible reasons why it may be impossible to execute a proposal:
The deposit cannot be payed back, because the creator of the proposal is a contract with a fallback function that consumes more than 9000 gas.
The function called by executing the proposed transaction throws an exception for whatever reason.
有時候或許無法執(zhí)行提議,這里有兩個可能的原因:
押金不能被返還,因?yàn)樘嶙h的創(chuàng)建者是一個合約,它的回調(diào)函數(shù)需要消耗超過9000的gas。
調(diào)用執(zhí)行提議的交易時可能因?yàn)楦鞣N原因拋出異常。
Token holders should not vote on proposals where either of the above could happen. But in case one does, the proposal will close when executeProposal is called 10 days after the voting deadline.
代幣持有者不應(yīng)該對有上述情況可能發(fā)生的提議進(jìn)行投票。但是,如果一旦某人進(jìn)行投票,提議會在executeProposal 調(diào)用后的投票的終止日期10天后關(guān)閉。