2017-12-19 08:53:51 -08:00
|
|
|
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})
|
|
|
|
}
|
|
|
|
|
2017-12-25 04:18:37 -08:00
|
|
|
finalize(id, sender) {
|
|
|
|
return this.votingToChangeMinThresholdInstance.methods.finalize(id).send({from: sender})
|
2017-12-18 07:22:19 -08:00
|
|
|
}
|
|
|
|
}
|