How to vote and execute a proposal

DAO Wiki - Reliable
DAO Wiki - Reliable

Voting

投票

Every token holder can vote on a proposal by calling the vote function.
This function has 2 parameters:

  • proposalID The ID of the proposal.
  • supportsProposal A boolean (yes/no) on whether the voter supports the proposal or not.

每一個代幣持有者可以通過調用vote函數向提議投票。這個函數有兩個參數:

  • 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.

投票只能執行一次,不能被修改。在提議的討論期之后,將不能再對提議進行投票。另外,交易發送者的投票地址擁有的代幣將會被鎖定(不能被轉移或者分割),至到提議討論期結束,這樣是為了防止人們向提議投票然后又分割,而逃避投票后應該承擔的后果。

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.

** 警告: ** 在對提議投票前要格外注意。確保已經充分驗證了提議的投票終止日期,因為一旦你投票,你的代幣會鎖定而不能進行分割或者轉移到其他賬號,至到投票討論期結束。

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數組來查看??梢愿鶕嶙h的ID查看提議的參數。這些參數有:recipient, amount, description, votingDeadline, open, proposalPassed, proposalHash, proposalDeposit, newCurator, splitData, yea, nay, votedYes, votedNocreator。這些參數的定義可以在白皮書的6.3節中看到。

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:

  • proposalID
  • recipient
  • amount
  • transactionData

為了幫助投票者,提供了函數checkProposalCode。這個函數可以檢查某個提議的ID匹配某個交易。這個函數的參數有:

  • proposalID
  • recipient
  • amount
  • transactionData

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, amounttransactionData 匹配提議ID,這個函數會返回true,否則返回false(在錢包里用code checks out表示)。這個可以用來驗證提議ID是不是DAO代幣持有者想投的那個提議。

Executing

執行

在提議討論期結束后,任何一個人可以調用executeProposal函數。它的參數有:
After the debating period is over, everyone can call the function executeProposal. The parameters are:

  • proposalID
  • transactionData

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.

這個函數會檢查投票的終止日期是否已過,以及transactionData 是否匹配提議ID。然后它檢查法定人數是否滿足(參考minQuorum),以及投票是否獲得多數人同意。如果滿足以上條件,會執行提議并且返還提議的押金。如果法定人數滿足,但是提議被多數人拒絕,提議的押金會返還,提議會關閉。
如果是新的負責人的提議,函數什么也不做,除了在投票討論期結束后的27天后關閉提議。

Remark

備注

There are two possible reasons why it may be impossible to execute a proposal:

  1. 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.

  2. The function called by executing the proposed transaction throws an exception for whatever reason.

有時候或許無法執行提議,這里有兩個可能的原因:

  1. 押金不能被返還,因為提議的創建者是一個合約,它的回調函數需要消耗超過9000的gas。

  2. 調用執行提議的交易時可能因為各種原因拋出異常。

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.

代幣持有者不應該對有上述情況可能發生的提議進行投票。但是,如果一旦某人進行投票,提議會在executeProposal 調用后的投票的終止日期10天后關閉。

原文:How to vote and execute a proposal譯者:@rubyu2

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。
  • 序言:七十年代末,一起剝皮案震驚了整個濱河市,隨后出現的幾起案子,更是在濱河造成了極大的恐慌,老刑警劉巖,帶你破解...
    沈念sama閱讀 229,732評論 6 539
  • 序言:濱河連續發生了三起死亡事件,死亡現場離奇詭異,居然都是意外死亡,警方通過查閱死者的電腦和手機,發現死者居然都...
    沈念sama閱讀 99,214評論 3 426
  • 文/潘曉璐 我一進店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人,你說我怎么就攤上這事。” “怎么了?”我有些...
    開封第一講書人閱讀 177,781評論 0 382
  • 文/不壞的土叔 我叫張陵,是天一觀的道長。 經常有香客問我,道長,這世上最難降的妖魔是什么? 我笑而不...
    開封第一講書人閱讀 63,588評論 1 316
  • 正文 為了忘掉前任,我火速辦了婚禮,結果婚禮上,老公的妹妹穿的比我還像新娘。我一直安慰自己,他們只是感情好,可當我...
    茶點故事閱讀 72,315評論 6 410
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著,像睡著了一般。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發上,一...
    開封第一講書人閱讀 55,699評論 1 327
  • 那天,我揣著相機與錄音,去河邊找鬼。 笑死,一個胖子當著我的面吹牛,可吹牛的內容都是我干的。 我是一名探鬼主播,決...
    沈念sama閱讀 43,698評論 3 446
  • 文/蒼蘭香墨 我猛地睜開眼,長吁一口氣:“原來是場噩夢啊……” “哼!你這毒婦竟也來了?” 一聲冷哼從身側響起,我...
    開封第一講書人閱讀 42,882評論 0 289
  • 序言:老撾萬榮一對情侶失蹤,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后,有當地人在樹林里發現了一具尸體,經...
    沈念sama閱讀 49,441評論 1 335
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 41,189評論 3 356
  • 正文 我和宋清朗相戀三年,在試婚紗的時候發現自己被綠了。 大學時的朋友給我發了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 43,388評論 1 372
  • 序言:一個原本活蹦亂跳的男人離奇死亡,死狀恐怖,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情,我是刑警寧澤,帶...
    沈念sama閱讀 38,933評論 5 363
  • 正文 年R本政府宣布,位于F島的核電站,受9級特大地震影響,放射性物質發生泄漏。R本人自食惡果不足惜,卻給世界環境...
    茶點故事閱讀 44,613評論 3 348
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧,春花似錦、人聲如沸。這莊子的主人今日做“春日...
    開封第一講書人閱讀 35,023評論 0 28
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽。三九已至,卻和暖如春,著一層夾襖步出監牢的瞬間,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 36,310評論 1 293
  • 我被黑心中介騙來泰國打工, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留,地道東北人。 一個月前我還...
    沈念sama閱讀 52,112評論 3 398
  • 正文 我出身青樓,卻偏偏與公主長得像,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子,可洞房花燭夜當晚...
    茶點故事閱讀 48,334評論 2 377

推薦閱讀更多精彩內容