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数组来查看。可以根据提议的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阅读 159,716评论 4 364
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 67,558评论 1 294
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 109,431评论 0 244
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 44,127评论 0 209
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 52,511评论 3 287
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 40,692评论 1 222
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 31,915评论 2 313
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 30,664评论 0 202
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 34,412评论 1 246
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 30,616评论 2 245
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 32,105评论 1 260
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 28,424评论 2 254
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 33,098评论 3 238
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 26,096评论 0 8
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 26,869评论 0 197
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 35,748评论 2 276
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 35,641评论 2 271

推荐阅读更多精彩内容