diff --git a/src/addresses.js b/src/addresses.js new file mode 100644 index 0000000..3c25836 --- /dev/null +++ b/src/addresses.js @@ -0,0 +1,5 @@ +module.exports = { + VOTING_TO_CHANGE_KEYS_ADDRESS: '0x49df4ec19243263e5db22da5865b4f482b8323a0', + VOTING_TO_CHANGE_MIN_THRESHOLD: '0x8829ebe113535826e8af17ed51f83755f675789a', + VOTING_TO_CHANGE_PROXY: '0x6b728399b41a38d4109f7af2213d4cc31ca87812' +} \ No newline at end of file diff --git a/src/votingToChangeKeys.js b/src/votingToChangeKeys.js new file mode 100644 index 0000000..10723b0 --- /dev/null +++ b/src/votingToChangeKeys.js @@ -0,0 +1,25 @@ +import votingToChangeKeysABI from './votingToChangeKeysABI.json' +import Web3 from 'web3'; +import {VOTING_TO_CHANGE_KEYS_ADDRESS} from './addresses' + +console.log('VotingToChangeKeys ', VOTING_TO_CHANGE_KEYS_ADDRESS) +export default class VotingToChangeKeys { + constructor(){ + if(window.web3.currentProvider){ + let web3_10 = new Web3(window.web3.currentProvider); + this.votingToChangeKeysInstance = new web3_10.eth.Contract(votingToChangeKeysABI, VOTING_TO_CHANGE_KEYS_ADDRESS); + } + } + + createVotingForKeys({startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType, sender}){ + return this.votingToChangeKeysInstance.methods.createVotingForKeys(startTime, endTime, affectedKey, affectedKeyType, miningKey, ballotType).send({from: sender}) + } + + vote({id, choice, sender}){ + return this.votingToChangeKeysInstance.methods.vote(id, choice).send({from: sender}) + } + + finalize({id, sender}){ + return this.votingToChangeKeysInstance.methods.finalize(id, id).send({from: sender}) + } +} diff --git a/src/votingToChangeKeysABI.json b/src/votingToChangeKeysABI.json new file mode 100644 index 0000000..ab6e95e --- /dev/null +++ b/src/votingToChangeKeysABI.json @@ -0,0 +1,746 @@ +[ + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "finalize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getIsFinalized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "isValidVote", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getMiningKey", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotsStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "activeBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getTotalVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "withinLimit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getAffectedKeyType", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "getMiningByVotingKey", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "activeBallotsLength", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_currentKey", + "type": "address" + }, + { + "name": "_affectedKey", + "type": "address" + } + ], + "name": "checkIfMiningExisted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "isActive", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_ballotType", + "type": "uint256" + }, + { + "name": "_affectedKey", + "type": "address" + }, + { + "name": "_affectedKeyType", + "type": "uint256" + }, + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "areBallotParamsValid", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_startTime", + "type": "uint256" + }, + { + "name": "_endTime", + "type": "uint256" + }, + { + "name": "_affectedKey", + "type": "address" + }, + { + "name": "_affectedKeyType", + "type": "uint256" + }, + { + "name": "_miningKey", + "type": "address" + }, + { + "name": "_ballotType", + "type": "uint256" + } + ], + "name": "createVotingForKeys", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getAffectedKey", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getEndTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_choice", + "type": "uint8" + } + ], + "name": "vote", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getKeysManager", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "proxyStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxOldMiningKeysDeepCheck", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getStartTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "hasAlreadyVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getGlobalMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "areOldMiningKeysVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getBallotType", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nextBallotId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getProgress", + "outputs": [ + { + "name": "", + "type": "int256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "validatorActiveBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotLimitPerValidator", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "votingState", + "outputs": [ + { + "name": "startTime", + "type": "uint256" + }, + { + "name": "endTime", + "type": "uint256" + }, + { + "name": "affectedKey", + "type": "address" + }, + { + "name": "affectedKeyType", + "type": "uint256" + }, + { + "name": "miningKey", + "type": "address" + }, + { + "name": "totalVoters", + "type": "uint256" + }, + { + "name": "progress", + "type": "int256" + }, + { + "name": "isFinalized", + "type": "bool" + }, + { + "name": "quorumState", + "type": "uint8" + }, + { + "name": "ballotType", + "type": "uint256" + }, + { + "name": "index", + "type": "uint256" + }, + { + "name": "minThresholdOfVoters", + "type": "uint256" + }, + { + "name": "creator", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_proxyStorage", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "name": "decision", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "name": "time", + "type": "uint256" + } + ], + "name": "Vote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + } + ], + "name": "BallotFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "ballotType", + "type": "uint256" + }, + { + "indexed": true, + "name": "creator", + "type": "address" + } + ], + "name": "BallotCreated", + "type": "event" + } +] diff --git a/src/votingToChangeMinThreshold.js b/src/votingToChangeMinThreshold.js new file mode 100644 index 0000000..55b2f07 --- /dev/null +++ b/src/votingToChangeMinThreshold.js @@ -0,0 +1,25 @@ +import votingToChangeMinThresholdABI from './votingToChangeMinThresholdABI.json' +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); + } + } + + createBallotToChangeThreshold({startTime, endTime, proposedValue, sender}){ + return this.votingToChangeMinThresholdInstance.methods.createBallotToChangeThreshold(startTime, endTime, proposedValue).send({from: sender}) + } + + vote({id, choice, sender}){ + return this.votingToChangeMinThresholdInstance.methods.vote(id, choice).send({from: sender}) + } + + finalize({id, sender}){ + return this.votingToChangeMinThresholdInstance.methods.finalize(id, id).send({from: sender}) + } +} diff --git a/src/votingToChangeMinThresholdABI.json b/src/votingToChangeMinThresholdABI.json new file mode 100644 index 0000000..18870b5 --- /dev/null +++ b/src/votingToChangeMinThresholdABI.json @@ -0,0 +1,611 @@ +[ + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "finalize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getIsFinalized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "isValidVote", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotsStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "activeBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getTotalVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "withinLimit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "getMiningByVotingKey", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "activeBallotsLength", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "isActive", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_startTime", + "type": "uint256" + }, + { + "name": "_endTime", + "type": "uint256" + }, + { + "name": "_proposedValue", + "type": "uint256" + } + ], + "name": "createBallotToChangeThreshold", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getEndTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_choice", + "type": "uint8" + } + ], + "name": "vote", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getKeysManager", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "proxyStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxOldMiningKeysDeepCheck", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getStartTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "hasAlreadyVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getGlobalMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "areOldMiningKeysVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getProposedValue", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nextBallotId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getProgress", + "outputs": [ + { + "name": "", + "type": "int256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "validatorActiveBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotLimitPerValidator", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "votingState", + "outputs": [ + { + "name": "startTime", + "type": "uint256" + }, + { + "name": "endTime", + "type": "uint256" + }, + { + "name": "totalVoters", + "type": "uint256" + }, + { + "name": "progress", + "type": "int256" + }, + { + "name": "isFinalized", + "type": "bool" + }, + { + "name": "quorumState", + "type": "uint8" + }, + { + "name": "index", + "type": "uint256" + }, + { + "name": "minThresholdOfVoters", + "type": "uint256" + }, + { + "name": "proposedValue", + "type": "uint256" + }, + { + "name": "creator", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_proxyStorage", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "name": "decision", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "name": "time", + "type": "uint256" + } + ], + "name": "Vote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + } + ], + "name": "BallotFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "ballotType", + "type": "uint256" + }, + { + "indexed": true, + "name": "creator", + "type": "address" + } + ], + "name": "BallotCreated", + "type": "event" + } +] diff --git a/src/votingToChangeProxy.js b/src/votingToChangeProxy.js new file mode 100644 index 0000000..3fa14aa --- /dev/null +++ b/src/votingToChangeProxy.js @@ -0,0 +1,25 @@ +import votingToChangeProxyABI from './votingToChangeProxyABI.json' +import Web3 from 'web3'; +import {VOTING_TO_CHANGE_PROXY} from './addresses' + +console.log('VotingToChangeProxy ', VOTING_TO_CHANGE_PROXY) +export default class VotingToChangeProxy { + constructor(){ + if(window.web3.currentProvider){ + let web3_10 = new Web3(window.web3.currentProvider); + this.votingToChangeKeysInstance = new web3_10.eth.Contract(votingToChangeProxyABI, VOTING_TO_CHANGE_PROXY); + } + } + + createBallotToChangeProxyAddress({startTime, endTime, proposedValue, sender}){ + return this.votingToChangeKeysInstance.methods.createVotingForKeys(startTime, endTime, proposedValue).send({from: sender}) + } + + vote({id, choice, sender}){ + return this.votingToChangeKeysInstance.methods.vote(id, choice).send({from: sender}) + } + + finalize({id, sender}){ + return this.votingToChangeKeysInstance.methods.finalize(id, id).send({from: sender}) + } +} diff --git a/src/votingToChangeProxyAddressABI.json b/src/votingToChangeProxyAddressABI.json new file mode 100644 index 0000000..d86e6e2 --- /dev/null +++ b/src/votingToChangeProxyAddressABI.json @@ -0,0 +1,638 @@ +[ + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "finalize", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getIsFinalized", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "isValidVote", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotsStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "activeBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_startTime", + "type": "uint256" + }, + { + "name": "_endTime", + "type": "uint256" + }, + { + "name": "_proposedValue", + "type": "address" + }, + { + "name": "_contractType", + "type": "uint8" + } + ], + "name": "createBallotToChangeProxyAddress", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getTotalVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "withinLimit", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "getMiningByVotingKey", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "activeBallotsLength", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "isActive", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getEndTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": false, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_choice", + "type": "uint8" + } + ], + "name": "vote", + "outputs": [], + "payable": false, + "stateMutability": "nonpayable", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getKeysManager", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "proxyStorage", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "maxOldMiningKeysDeepCheck", + "outputs": [ + { + "name": "", + "type": "uint8" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getStartTime", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getContractType", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_votingKey", + "type": "address" + } + ], + "name": "hasAlreadyVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getGlobalMinThresholdOfVoters", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + }, + { + "name": "_miningKey", + "type": "address" + } + ], + "name": "areOldMiningKeysVoted", + "outputs": [ + { + "name": "", + "type": "bool" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getProposedValue", + "outputs": [ + { + "name": "", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "nextBallotId", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "_id", + "type": "uint256" + } + ], + "name": "getProgress", + "outputs": [ + { + "name": "", + "type": "int256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "address" + } + ], + "name": "validatorActiveBallots", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [], + "name": "getBallotLimitPerValidator", + "outputs": [ + { + "name": "", + "type": "uint256" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "constant": true, + "inputs": [ + { + "name": "", + "type": "uint256" + } + ], + "name": "votingState", + "outputs": [ + { + "name": "startTime", + "type": "uint256" + }, + { + "name": "endTime", + "type": "uint256" + }, + { + "name": "totalVoters", + "type": "uint256" + }, + { + "name": "progress", + "type": "int256" + }, + { + "name": "isFinalized", + "type": "bool" + }, + { + "name": "quorumState", + "type": "uint8" + }, + { + "name": "index", + "type": "uint256" + }, + { + "name": "minThresholdOfVoters", + "type": "uint256" + }, + { + "name": "proposedValue", + "type": "address" + }, + { + "name": "contractType", + "type": "uint8" + }, + { + "name": "creator", + "type": "address" + } + ], + "payable": false, + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "name": "_proxyStorage", + "type": "address" + } + ], + "payable": false, + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": false, + "name": "decision", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + }, + { + "indexed": false, + "name": "time", + "type": "uint256" + } + ], + "name": "Vote", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "voter", + "type": "address" + } + ], + "name": "BallotFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "name": "id", + "type": "uint256" + }, + { + "indexed": true, + "name": "ballotType", + "type": "uint256" + }, + { + "indexed": true, + "name": "creator", + "type": "address" + } + ], + "name": "BallotCreated", + "type": "event" + } +]