2

An individual has stated in The DAO Forum thread Has the voting began that they have been able to vote more than once on a proposal.

Can I vote more than once on each The DAO proposal?

2

Following is the vote() function from The DAO's source code.

function vote(
    uint _proposalID,
    bool _supportsProposal
) onlyTokenholders noEther returns (uint _voteID) {

    Proposal p = proposals[_proposalID];
    if (p.votedYes[msg.sender]
        || p.votedNo[msg.sender]
        || now >= p.votingDeadline) {

        throw;
    }

    if (_supportsProposal) {
        p.yea += balances[msg.sender];
        p.votedYes[msg.sender] = true;
    } else {
        p.nay += balances[msg.sender];
        p.votedNo[msg.sender] = true;
    }

    if (blocked[msg.sender] == 0) {
        blocked[msg.sender] = _proposalID;
    } else if (p.votingDeadline > proposals[blocked[msg.sender]].votingDeadline) {
        // this proposal's voting deadline is further into the future than
        // the proposal that blocks the sender so make it the blocker
        blocked[msg.sender] = _proposalID;
    }

    Voted(_proposalID, _supportsProposal, msg.sender);
}

The first conditional statement in the vote() function:

if (p.votedYes[msg.sender]
    || p.votedNo[msg.sender]
    || now >= p.votingDeadline) {

    throw;
}

will cancel your transaction (throw) if your account has already voted Yes (p.votedYes[msg.sender]) or voted No (p.votedNo[msg.sender]) on a proposal.

Your transaction will also be cancelled if you are voting past the proposal voting deadline (now >= p.votingDeadline).

A little bit of gas (ether) will be used up when your transaction is cancelled.



Testing My Hypothesis

Here are two transactions sending votes for the same proposal from the same account:

These two transactions are both calls to the vote() function as the signature using web3.sha3('vote(uint256,bool)').substr(0, 10) produces the result 0xc9d27afe that matches the start of the Input Data in both transactions.

And here is the second transaction showing the cancellation of the transaction. enter image description here

The first transaction fee was 0.001489425 ether, and the second cancelled transaction fee was 0.00315 ether. Note that the second cancelled transaction costed more than the first successful transaction.



MyEtherWallet Vs Ethereum Wallet (Mist)

Results update from an anonymous helpful DAOHub Forum user:

  • MyEtherWallet will currently allow you to vote more than once on the same proposal from the same account.
  • Ethereum Wallet (Mist) will inform you after your first vote that the account is locked. If you choose to proceed, it show you a message "Data can't be executed, so it will use all provided gas" before executing the transaction.
  • 2
    "MyEtherWallet will currently allow you to vote more than once on the same proposal from the same account." <- Working on how to fix this. It's a fun solution that might interest you: call vote function with the estimateGas() Function. If all the gas is used, it means a Exception would be thrown, so the user has already voted or the user is not allowed or the end of the debate-period is reached. – tayvano May 29 '16 at 6:58
  • 1
    You are right that estimateGas() might interest me (am I that predictable?). I've now created a Perl script to list proposals, list the voting status of each account against the proposals and vote on the proposals - from the command line. Using the estimateGas() method to check on the voting status. See github.com/bokkypoobah/TheDAOVoter/blob/master/theDAOVoter . Thanks @tayvano. – Bokky WeAreAllAssange PooBah Jun 2 '16 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.