Skip to content
Permalink
Browse files

Migrate 0.4.0 to 0.4.23

  • Loading branch information...
kkdai committed Apr 22, 2019
1 parent 9f72763 commit cc23ca5d97ecef48921c3b83c66a0763e7e43edc
Showing with 8 additions and 3 deletions.
  1. +8 −3 contracts/Ballot.sol
@@ -1,4 +1,5 @@
pragma solidity ^0.4.0;
pragma solidity >=0.4.23 <0.6.0;

contract Ballot {

struct Voter {
@@ -17,7 +18,7 @@ contract Ballot {


/// Create a new ballot with $(_numProposals) different proposals.
function Ballot(uint8 _numProposals) public {
constructor(uint8 _numProposals) public {
chairperson = msg.sender;
voters[chairperson].weight = 2;
proposals.length = _numProposals;
@@ -40,7 +41,10 @@ contract Ballot {
proposals[toProposal].voteCount += sender.weight;
}

function winningProposal() public constant returns (uint8 _winningProposal) {
function winningProposal()
public
view
returns (uint8 _winningProposal) {
uint256 winningVoteCount = 0;
for (uint8 prop = 0; prop < proposals.length; prop++)
if (proposals[prop].voteCount > winningVoteCount) {
@@ -49,3 +53,4 @@ contract Ballot {
}
}
}

0 comments on commit cc23ca5

Please sign in to comment.
You can’t perform that action at this time.