Skip to content

Commit

Permalink
Create IssueElection contract
Browse files Browse the repository at this point in the history
  • Loading branch information
hedgepigdaniel committed Oct 13, 2017
1 parent 5068c24 commit 4004350
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
33 changes: 33 additions & 0 deletions src/contracts/IssueElection.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
pragma solidity ^0.4.17;

contract IssueElection {
uint num_votes_required;
uint num_votes_cast;
string label;
string description;

function reset() private {
num_votes_cast = 0;
num_votes_required = 0;
label = "";
description = "";
}

function castVote() public {
num_votes_cast += 1;
}

function setLabel(string newLabel) public {
reset();
label = newLabel;
}

function setDescription(string newDesccription) public {
reset();
description = newDesccription;
}

function setNumVotesRequired(uint newRequirement) public {
num_votes_required = newRequirement;
}
}
2 changes: 2 additions & 0 deletions src/reducers/issues.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { fromJS } from 'immutable'

import IssueElection from '../contracts/IssueElection.sol'

const updaters = new Map([
['@@redux/INIT', state => fromJS(state)],
['@@INIT', state => fromJS(state)],
Expand Down

0 comments on commit 4004350

Please sign in to comment.