poa-dapps-voting/src/contracts/VotingToChangeMinThreshold....

26 lines
1.0 KiB
JavaScript
Raw Normal View History

import votingToChangeMinThresholdABI from './votingToChangeMinThreshold.abi.json'
2017-12-18 07:22:19 -08:00
import Web3 from 'web3';
import {VOTING_TO_CHANGE_MIN_THRESHOLD} from './addresses'
console.log('VotingToChangeMinThreshold ', VOTING_TO_CHANGE_MIN_THRESHOLD)
export default class VotingToChangeMinThreshold {
constructor(){
if(window.web3.currentProvider){
let web3_10 = new Web3(window.web3.currentProvider);
this.votingToChangeMinThresholdInstance = new web3_10.eth.Contract(votingToChangeMinThresholdABI, VOTING_TO_CHANGE_MIN_THRESHOLD);
}
}
2017-12-25 02:10:35 -08:00
createBallotToChangeThreshold(startTime, endTime, proposedValue, sender) {
2017-12-18 07:22:19 -08:00
return this.votingToChangeMinThresholdInstance.methods.createBallotToChangeThreshold(startTime, endTime, proposedValue).send({from: sender})
}
2017-12-25 02:10:35 -08:00
vote(id, choice, sender) {
2017-12-18 07:22:19 -08:00
return this.votingToChangeMinThresholdInstance.methods.vote(id, choice).send({from: sender})
}
finalize(id, sender) {
return this.votingToChangeMinThresholdInstance.methods.finalize(id).send({from: sender})
2017-12-18 07:22:19 -08:00
}
}