poa-dapps-voting/README.md

897 lines
51 KiB
Markdown
Raw Normal View History

# Oracles network Voting Dapp
## Initial page (Settings)
Choose your voting key from the list to continue. You can return to this page from any page by clicking **Settings** button.
![](./settings.png)
## Ballots page
You'll see the page with the list of all ballots. Here you can switch to see only your **UNANSWERED** or **EXPIRED** ballots.
**Search** by ballots' data is available too.
Single ballot page is opened by clicking **VOTE NOW** button.
![](./ballots.png)
## Single ballot page
Here you can vote for or against notary. If total number of votes > 3, notary will be added or deleted from the network depending on votes majority after voting will be finished.
![](./ballot.png)
## New ballot page
Click **NEW BALLOT** button from any page to create a new ballot.
![](./new_ballot.png)
## Configuration file
It is configured with [Oracles network contract](https://github.com/oraclesorg/oracles-contract)
Path: `./assets/javascripts/config.json`
```
{
"environment": "live",
"Ethereum": {
"dev": {
"rpc": "http://127.0.0.1:8545",
"account": "Oracles_contract_owner_address",
"contractAddress": "Oracles_contract_address"
},
"live": {
"rpc": "http://127.0.0.1:8540",
"account": "Oracles_contract_owner_address",
"contractAddress": "Oracles_contract_address"
},
"contracts": {
"Oracles": {
"bin": "0x606060405260036009556000600b60006101000a81548160ff021916908360000b60ff160217905550600c600b60016101000a81548160ff021916908360000b60ff1602179055506000600b60026101000a81548160ff021916908360000b60ff1602179055506034600b60036101000a81548160ff021916908360000b60ff16021790555034156200008e57fe5b5b5b73dd0bb0e2a1594240fed0c2f2c17c1e9ab4f87126600060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b60058054806001018281620000fc919062000175565b916000526020600020900160005b600060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b620001cc565b8154818355818115116200019f578183600052602060002091820191016200019e9190620001a4565b5b505050565b620001c991905b80821115620001c5576000816000905550600101620001ab565b5090565b90565b6138de80620001dc6000396000f30060606040523615610202576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063075f1d47146102045780630aeee8351461026457806311fc7f971461037e5780632010695914610425578063223b3b7a146104735780632abf367f146106f65780632c48fd0d1461072a57806331567174146107e757806332d21d001461083557806335aa2e44146109c45780633b41c35914610a2457806340d0f01214610a995780635b7d6c3614610ae75780635c632b3814610ba45780635f5f43fe14610bd85780636bbcdfcd14610c955780636f2dc1c114610ce357806375f358cc14610d1b5780637d66712014610d535780637d87283a14610d9d578063820e4a2414610de75780638334add414610e4757806383e51bc714610eee5780638da5cb5b14610f385780639ec5ade214610f8a578063a411e3451461105e578063a59c340814611092578063a7666dad146110c6578063a88ccf6e146110fe578063aff63d5e1461115e578063b045d11714611194578063b6f61f66146111c8578063b7ab4db5146111fc578063c6232a1514611271578063c9d27afe146112e5578063cbebcbbc14611310578063d40b65eb1461135e578063dfecd97414611392578063e00d1876146113e0578063eb87c6dc1461142a578063f40d99851461149f578063f65fb8ab146114ed575bfe5b341561020c57fe5b6102226004808035906020019091905050611513565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561026c57fe5b61037c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611554565b005b341561038657fe5b61039c60048080359060200190919050506116e1565b60405180806020018281038252838181518152602001915080519060200190808383600083146103eb575b8051825260208311156103eb576020820191506020810190506020830392506103c7565b505050905090810190601f1680156104175780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561042d57fe5b610459600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117a0565b604051808215151515815260200191505060405180910390f35b341561047b57fe5b6104a7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117cb565b604051808060200180602001806020018981526020018881526020018781526020018681526020018060200185810385528d8181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105545780601f1061052957610100808354040283529160200191610554565b820191906000526020600020905b81548152906001019060200180831161053757829003601f168201915b505085810384528c8181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156105d75780601f106105ac576101008083540402835291602001916105d7565b820191906000526020600020905b8154815290600101906020018083116105ba57829003601f168201915b505085810383528b81815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561065a5780601f1061062
"abi": [
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotAffectedKey",
"outputs": [
{
"name": "value",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "miningKey",
"type": "address"
},
{
"name": "zip",
"type": "uint256"
},
{
"name": "licenseID",
"type": "uint256"
},
{
"name": "licenseExpiredAt",
"type": "uint256"
},
{
"name": "fullName",
"type": "string"
},
{
"name": "streetName",
"type": "string"
},
{
"name": "state",
"type": "string"
}
],
"name": "addValidator",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotMemo",
"outputs": [
{
"name": "value",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "miningKeys",
"outputs": [
{
"name": "isActive",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "validator",
"outputs": [
{
"name": "fullName",
"type": "string"
},
{
"name": "streetName",
"type": "string"
},
{
"name": "state",
"type": "string"
},
{
"name": "zip",
"type": "uint256"
},
{
"name": "licenseID",
"type": "uint256"
},
{
"name": "licenseExpiredAt",
"type": "uint256"
},
{
"name": "disablingDate",
"type": "uint256"
},
{
"name": "disablingTX",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotVotingStart",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorFullName",
"outputs": [
{
"name": "value",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "key",
"type": "address"
}
],
"name": "checkInitialKey",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "ballotsMapping",
"outputs": [
{
"name": "owner",
"type": "address"
},
{
"name": "miningKey",
"type": "address"
},
{
"name": "affectedKey",
"type": "address"
},
{
"name": "memo",
"type": "string"
},
{
"name": "affectedKeyType",
"type": "uint256"
},
{
"name": "createdAt",
"type": "uint256"
},
{
"name": "votingStart",
"type": "uint256"
},
{
"name": "votingDeadline",
"type": "uint256"
},
{
"name": "votesAmmount",
"type": "int256"
},
{
"name": "result",
"type": "int256"
},
{
"name": "addAction",
"type": "bool"
},
{
"name": "active",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "validators",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getDisabledValidators",
"outputs": [
{
"name": "value",
"type": "address[]"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "payoutKeys",
"outputs": [
{
"name": "isActive",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorState",
"outputs": [
{
"name": "value",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "ballots",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorStreetName",
"outputs": [
{
"name": "value",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "initialKeys",
"outputs": [
{
"name": "isNew",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "ballotIsVoted",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "ballotIsActive",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorLicenseID",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorLicenseExpiredAt",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "uint256"
}
],
"name": "disabledValidators",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotOwner",
"outputs": [
{
"name": "value",
"type": "string"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorDisablingDate",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
},
{
"name": "owner",
"type": "address"
},
{
"name": "miningKey",
"type": "address"
},
{
"name": "affectedKey",
"type": "address"
},
{
"name": "affectedKeyType",
"type": "uint256"
},
{
"name": "addAction",
"type": "bool"
},
{
"name": "memo",
"type": "string"
}
],
"name": "addBallot",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotAffectedKeyType",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotVotingEnd",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotAction",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getBallotMiningKey",
"outputs": [
{
"name": "value",
"type": "address"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "key",
"type": "address"
}
],
"name": "addInitialKey",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "ballotCreatedAt",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getVotesAgainst",
"outputs": [
{
"name": "value",
"type": "int256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getValidators",
"outputs": [
{
"name": "value",
"type": "address[]"
}
],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "miningAddr",
"type": "address"
},
{
"name": "payoutAddr",
"type": "address"
},
{
"name": "votingAddr",
"type": "address"
}
],
"name": "createKeys",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
},
{
"name": "accept",
"type": "bool"
}
],
"name": "vote",
"outputs": [],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "votingKeys",
"outputs": [
{
"name": "isActive",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "ballotID",
"type": "uint256"
}
],
"name": "getVotesFor",
"outputs": [
{
"name": "value",
"type": "int256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "checkPayoutKeyValidity",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "getValidatorZip",
"outputs": [
{
"name": "value",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "getBallots",
"outputs": [
{
"name": "value",
"type": "uint256[]"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "checkVotingKeyValidity",
"outputs": [
{
"name": "value",
"type": "bool"
}
],
"payable": false,
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "votingLowerLimit",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"type": "function"
},
{
"inputs": [],
"payable": false,
"type": "constructor"
}
]
}
}
}
}
```