Add batch voting for proposals

The batchVote function accepts an array of proposal ids and votes for
every one.
Normally arrays without fix length are problematic and gas usage can not be
estimated really well. So we need to see how that works or what other
pattern could be used.
This commit is contained in:
bumi 2018-04-15 18:15:21 +02:00
parent 5235370960
commit e2e9cd5c3b

View File

@ -127,6 +127,12 @@ contract Operator is Upgradeable {
ProposalVoted(_pId, msg.sender, p.votesCount);
}
function batchVote(uint256[] _proposalIds) public coreOnly {
for (uint256 i = 0; i < _proposalIds.length; i++) {
vote(_proposalIds[i]);
}
}
function executeProposal(uint proposalId) private returns (bool) {
var p = proposals[proposalId];
require(!p.executed);