@netvote/elections-solidity
Version:
Elections Contracts
1,079 lines (1,078 loc) • 79.7 kB
JSON
{
"contractName": "ElectionPhaseable",
"abi": [
{
"constant": false,
"inputs": [],
"name": "activate",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "removeAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "isAdmin",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "electionPhase",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "abort",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "close",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "removeSelf",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isLocked",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "unlock",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isClosed",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "checkConfig",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "lock",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [],
"name": "Closed",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Activated",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Aborted",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Locked",
"type": "event"
},
{
"anonymous": false,
"inputs": [],
"name": "Unlocked",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
}
],
"bytecode": "0x60606040526002805461ffff1916905560008054600160a060020a03191633600160a060020a03161781556106c290819061003a90396000f3006060604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630f15f4c081146100df5780631785f53c146100f457806324d7806c14610113578063265050b61461014657806335a063b41461017d57806343d726d6146101905780635e898dac146101a357806370480275146101b65780638da5cb5b146101d5578063a4e2d63414610204578063a69df4b514610217578063c2b6b58c1461022a578063f098fe471461023d578063f2fde38b14610250578063f83d08ba1461026f575b600080fd5b34156100ea57600080fd5b6100f2610282565b005b34156100ff57600080fd5b6100f2600160a060020a036004351661031b565b341561011e57600080fd5b610132600160a060020a0360043516610357565b604051901515815260200160405180910390f35b341561015157600080fd5b6101596103a6565b6040518082600381111561016957fe5b60ff16815260200191505060405180910390f35b341561018857600080fd5b6100f26103b4565b341561019b57600080fd5b6100f2610405565b34156101ae57600080fd5b6100f261048b565b34156101c157600080fd5b6100f2600160a060020a03600435166104c1565b34156101e057600080fd5b6101e8610503565b604051600160a060020a03909116815260200160405180910390f35b341561020f57600080fd5b610132610512565b341561022257600080fd5b6100f261051b565b341561023557600080fd5b610132610578565b341561024857600080fd5b610132610597565b341561025b57600080fd5b6100f2600160a060020a036004351661059c565b341561027a57600080fd5b6100f2610637565b61028a610512565b1580156102ac57506000600254610100900460ff1660038111156102aa57fe5b145b15156102b757600080fd5b6102c033610357565b15156102cb57600080fd5b6102d3610597565b15156102de57600080fd5b6002805461ff0019166101001790557fed1cd0670ee0c0017f550451a038818c696d0b6a9d6ce5b369e44275573cf9b060405160405180910390a1565b60005433600160a060020a0390811691161461033657600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b6000600160a060020a038216158015906103a05750600054600160a060020a03838116911614806103a05750600160a060020a03821660009081526001602052604090205460ff165b92915050565b600254610100900460ff1681565b6103bd33610357565b15156103c857600080fd5b6002805461ff0019166103001790557f72c874aeff0b183a56e2b79c71b46e1aed4dee5e09862134b8821ba2fddbf8bf60405160405180910390a1565b61040d610512565b15801561042f57506001600254610100900460ff16600381111561042d57fe5b145b151561043a57600080fd5b61044333610357565b151561044e57600080fd5b6002805461ff0019166102001790557f1cdde67b72a90f19919ac732a437ac2f7a10fc128d28c2a6e525d89ce5cd9d3a60405160405180910390a1565b61049433610357565b151561049f57600080fd5b600160a060020a0333166000908152600160205260409020805460ff19169055565b60005433600160a060020a039081169116146104dc57600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600054600160a060020a031681565b60025460ff1690565b61052433610357565b151561052f57600080fd5b60025460ff16151561054057600080fd5b6002805460ff191690557f19aad37188a1d3921e29eb3c66acf43d81975e107cb650d58cca878627955fd660405160405180910390a1565b600060028054610100900460ff16600381111561059157fe5b14905090565b600190565b60005433600160a060020a039081169116146105b757600080fd5b600160a060020a03811615156105cc57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b61064033610357565b151561064b57600080fd5b60025460ff161561065b57600080fd5b6002805460ff191660011790557f0f2e5b6c72c6a4491efd919a9f9a409f324ef0708c11ee57d410c2cb06c0992b60405160405180910390a15600a165627a7a72305820c952a60f2bd5acd2202e10cc44882ad0820d3e2c36711e202e6271c254a733150029",
"deployedBytecode": "0x6060604052600436106100da5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630f15f4c081146100df5780631785f53c146100f457806324d7806c14610113578063265050b61461014657806335a063b41461017d57806343d726d6146101905780635e898dac146101a357806370480275146101b65780638da5cb5b146101d5578063a4e2d63414610204578063a69df4b514610217578063c2b6b58c1461022a578063f098fe471461023d578063f2fde38b14610250578063f83d08ba1461026f575b600080fd5b34156100ea57600080fd5b6100f2610282565b005b34156100ff57600080fd5b6100f2600160a060020a036004351661031b565b341561011e57600080fd5b610132600160a060020a0360043516610357565b604051901515815260200160405180910390f35b341561015157600080fd5b6101596103a6565b6040518082600381111561016957fe5b60ff16815260200191505060405180910390f35b341561018857600080fd5b6100f26103b4565b341561019b57600080fd5b6100f2610405565b34156101ae57600080fd5b6100f261048b565b34156101c157600080fd5b6100f2600160a060020a03600435166104c1565b34156101e057600080fd5b6101e8610503565b604051600160a060020a03909116815260200160405180910390f35b341561020f57600080fd5b610132610512565b341561022257600080fd5b6100f261051b565b341561023557600080fd5b610132610578565b341561024857600080fd5b610132610597565b341561025b57600080fd5b6100f2600160a060020a036004351661059c565b341561027a57600080fd5b6100f2610637565b61028a610512565b1580156102ac57506000600254610100900460ff1660038111156102aa57fe5b145b15156102b757600080fd5b6102c033610357565b15156102cb57600080fd5b6102d3610597565b15156102de57600080fd5b6002805461ff0019166101001790557fed1cd0670ee0c0017f550451a038818c696d0b6a9d6ce5b369e44275573cf9b060405160405180910390a1565b60005433600160a060020a0390811691161461033657600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b6000600160a060020a038216158015906103a05750600054600160a060020a03838116911614806103a05750600160a060020a03821660009081526001602052604090205460ff165b92915050565b600254610100900460ff1681565b6103bd33610357565b15156103c857600080fd5b6002805461ff0019166103001790557f72c874aeff0b183a56e2b79c71b46e1aed4dee5e09862134b8821ba2fddbf8bf60405160405180910390a1565b61040d610512565b15801561042f57506001600254610100900460ff16600381111561042d57fe5b145b151561043a57600080fd5b61044333610357565b151561044e57600080fd5b6002805461ff0019166102001790557f1cdde67b72a90f19919ac732a437ac2f7a10fc128d28c2a6e525d89ce5cd9d3a60405160405180910390a1565b61049433610357565b151561049f57600080fd5b600160a060020a0333166000908152600160205260409020805460ff19169055565b60005433600160a060020a039081169116146104dc57600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600054600160a060020a031681565b60025460ff1690565b61052433610357565b151561052f57600080fd5b60025460ff16151561054057600080fd5b6002805460ff191690557f19aad37188a1d3921e29eb3c66acf43d81975e107cb650d58cca878627955fd660405160405180910390a1565b600060028054610100900460ff16600381111561059157fe5b14905090565b600190565b60005433600160a060020a039081169116146105b757600080fd5b600160a060020a03811615156105cc57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b61064033610357565b151561064b57600080fd5b60025460ff161561065b57600080fd5b6002805460ff191660011790557f0f2e5b6c72c6a4491efd919a9f9a409f324ef0708c11ee57d410c2cb06c0992b60405160405180910390a15600a165627a7a72305820c952a60f2bd5acd2202e10cc44882ad0820d3e2c36711e202e6271c254a733150029",
"sourceMap": "1216:1163:15:-;;;1183:22:16;;;-1:-1:-1;;1326:59:15;;;-1:-1:-1;494:18:21;;-1:-1:-1;;;;;;494:18:21;502:10;-1:-1:-1;;;;;494:18:21;;;;1216:1163:15;;;;;;;;",
"deployedSourceMap": "1216:1163:15:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2006:148;;;;;;;;;;;;;;1460:95:0;;;;;;;;;;-1:-1:-1;;;;;1460:95:0;;;;;1212:145;;;;;;;;;;-1:-1:-1;;;;;1212:145:0;;;;;;;;;;;;;;;;;;;;;;1326:59:15;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2274:103;;;;;;;;;;;;2160:108;;;;;;;;;;;;1561:84:0;;;;;;;;;;;;1363:91;;;;;;;;;;-1:-1:-1;;;;;1363:91:0;;;;;238:20:21;;;;;;;;;;;;;;;-1:-1:-1;;;;;238:20:21;;;;;;;;;;;;;;1355:84:16;;;;;;;;;;;;1540:92;;;;;;;;;;;;1720:112:15;;;;;;;;;;;;1838:162;;;;;;;;;;;;827:169:21;;;;;;;;;;-1:-1:-1;;;;;827:169:21;;;;;1445:89:16;;;;;;;;;;;;2006:148:15;1529:10;:8;:10::i;:::-;1528:11;:54;;;;-1:-1:-1;1560:22:15;1543:13;;;;;;;:39;;;;;;;;;1528:54;1520:63;;;;;;;;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;2066:13:15;:11;:13::i;:::-;2058:22;;;;;;;;2090:13;:36;;-1:-1:-1;;2090:36:15;;;;;2136:11;;;;;;;;;;2006:148::o;1460:95:0:-;647:5:21;;633:10;-1:-1:-1;;;;;633:19:21;;;647:5;;633:19;625:28;;;;;;-1:-1:-1;;;;;1522:18:0;1543:5;1522:18;;;:12;:18;;;;;:26;;-1:-1:-1;;1522:26:0;;;1460:95::o;1212:145::-;1268:4;-1:-1:-1;;;;;1291:18:0;;;;;;:59;;-1:-1:-1;1322:5:0;;-1:-1:-1;;;;;1314:13:0;;;1322:5;;1314:13;;:35;;-1:-1:-1;;;;;;1331:18:0;;;;;;:12;:18;;;;;;;;1314:35;1284:66;1212:145;-1:-1:-1;;1212:145:0:o;1326:59:15:-;;;;;;;;;:::o;2274:103::-;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;2314:13:15;:37;;-1:-1:-1;;2314:37:15;;;;;2361:9;;;;;;;;;;2274:103::o;2160:108::-;1644:10;:8;:10::i;:::-;1643:11;:52;;;;-1:-1:-1;1675:20:15;1658:13;;;;;;;:37;;;;;;;;;1643:52;1635:61;;;;;;;;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;2223:20:15;2207:36;;-1:-1:-1;;2207:36:15;;;;;2253:8;;;;;;;;;;2160:108::o;1561:84:0:-;1168:19;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;-1:-1:-1;;;;;1619:10:0;1606:24;1633:5;1606:24;;;:12;:24;;;;;:32;;-1:-1:-1;;1606:32:0;;;1561:84::o;1363:91::-;647:5:21;;633:10;-1:-1:-1;;;;;633:19:21;;;647:5;;633:19;625:28;;;;;;-1:-1:-1;;;;;1422:18:0;;;;;1443:4;1422:18;;;;;;;;:25;;-1:-1:-1;;1422:25:0;;;;;;1363:91::o;238:20:21:-;;;-1:-1:-1;;;;;238:20:21;;:::o;1355:84:16:-;1423:9;;;;1355:84;:::o;1540:92::-;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;1248:9:16;;;;1240:18;;;;;;;;1588:9;:17;;-1:-1:-1;;1588:17:16;;;1615:10;;;;;;;;;;1540:92::o;1720:112:15:-;1765:4;1805:20;1788:13;;;;;;;:37;;;;;;;;;1781:44;;1720:112;:::o;1838:162::-;1989:4;1838:162;:::o;827:169:21:-;647:5;;633:10;-1:-1:-1;;;;;633:19:21;;;647:5;;633:19;625:28;;;;;;-1:-1:-1;;;;;903:22:21;;;;895:31;;;;;;953:5;;-1:-1:-1;;;;;932:37:21;;;;953:5;932:37;;;;;;;;;;975:5;:16;;-1:-1:-1;;975:16:21;-1:-1:-1;;;;;975:16:21;;;;;;;;;;827:169::o;1445:89:16:-;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;1321:9:16;;;;1320:10;1312:19;;;;;;1493:9;:16;;-1:-1:-1;;1493:16:16;1505:4;1493:16;;;1519:8;;;;;;;;;;1445:89::o",
"source": "// ------------------------------------------------------------------------------\n// This file is part of netvote.\n//\n// netvote is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// netvote is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with solidity. If not, see <http://www.gnu.org/licenses/>\n//\n// (c) 2017 netvote contributors.\n//------------------------------------------------------------------------------\n\npragma solidity ^0.4.17;\n\nimport \"./Lockable.sol\";\n\n\n/**\n * @title ElectionPhaseable\n * @dev State machine for election contracts.\n * Building = while building the election\n * Voting = votes are coming in (no changes allowed)\n * Closed = votes may no longer arrive\n * Aborted = admin determined there was a problem and all activities must stop\n */\ncontract ElectionPhaseable is Lockable {\n event Closed();\n event Activated();\n event Aborted();\n\n ElectionPhase public electionPhase = ElectionPhase.Building;\n\n enum ElectionPhase {\n Building,\n Voting,\n Closed,\n Aborted\n }\n\n modifier building() {\n require(!isLocked() && electionPhase == ElectionPhase.Building);\n _;\n }\n\n modifier voting() {\n require(!isLocked() && electionPhase == ElectionPhase.Voting);\n _;\n }\n\n function isClosed() public constant returns (bool) {\n return electionPhase == ElectionPhase.Closed;\n }\n\n function checkConfig() public constant returns (bool) {\n //override in other contracts if there are verifications pre-activation\n return true;\n }\n\n function activate() public building admin {\n require(checkConfig());\n electionPhase = ElectionPhase.Voting;\n Activated();\n }\n\n function close() public voting admin {\n electionPhase = ElectionPhase.Closed;\n Closed();\n }\n\n function abort() public admin {\n electionPhase = ElectionPhase.Aborted;\n Aborted();\n }\n}",
"sourcePath": "/Users/slanders/netvote/elections-solidity/contracts/state/ElectionPhaseable.sol",
"ast": {
"attributes": {
"absolutePath": "/Users/slanders/netvote/elections-solidity/contracts/state/ElectionPhaseable.sol",
"exportedSymbols": {
"ElectionPhaseable": [
2129
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.4",
".17"
]
},
"id": 2010,
"name": "PragmaDirective",
"src": "868:24:15"
},
{
"attributes": {
"SourceUnit": 2198,
"absolutePath": "/Users/slanders/netvote/elections-solidity/contracts/state/Lockable.sol",
"file": "./Lockable.sol",
"scope": 2130,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 2011,
"name": "ImportDirective",
"src": "894:24:15"
},
{
"attributes": {
"contractDependencies": [
84,
2197,
2703
],
"contractKind": "contract",
"documentation": "@title ElectionPhaseable\n@dev State machine for election contracts.\nBuilding = while building the election\nVoting = votes are coming in (no changes allowed)\nClosed = votes may no longer arrive\nAborted = admin determined there was a problem and all activities must stop",
"fullyImplemented": true,
"linearizedBaseContracts": [
2129,
2197,
84,
2703
],
"name": "ElectionPhaseable",
"scope": 2130
},
"children": [
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Lockable",
"referencedDeclaration": 2197,
"type": "contract Lockable"
},
"id": 2012,
"name": "UserDefinedTypeName",
"src": "1246:8:15"
}
],
"id": 2013,
"name": "InheritanceSpecifier",
"src": "1246:8:15"
},
{
"attributes": {
"anonymous": false,
"name": "Closed"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2014,
"name": "ParameterList",
"src": "1273:2:15"
}
],
"id": 2015,
"name": "EventDefinition",
"src": "1261:15:15"
},
{
"attributes": {
"anonymous": false,
"name": "Activated"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2016,
"name": "ParameterList",
"src": "1296:2:15"
}
],
"id": 2017,
"name": "EventDefinition",
"src": "1281:18:15"
},
{
"attributes": {
"anonymous": false,
"name": "Aborted"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2018,
"name": "ParameterList",
"src": "1317:2:15"
}
],
"id": 2019,
"name": "EventDefinition",
"src": "1304:16:15"
},
{
"attributes": {
"constant": false,
"name": "electionPhase",
"scope": 2129,
"stateVariable": true,
"storageLocation": "default",
"type": "enum ElectionPhaseable.ElectionPhase",
"visibility": "public"
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "ElectionPhase",
"referencedDeclaration": 2028,
"type": "enum ElectionPhaseable.ElectionPhase"
},
"id": 2020,
"name": "UserDefinedTypeName",
"src": "1326:13:15"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"member_name": "Building",
"referencedDeclaration": null,
"type": "enum ElectionPhaseable.ElectionPhase"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2028,
"type": "type(enum ElectionPhaseable.ElectionPhase)",
"value": "ElectionPhase"
},
"id": 2021,
"name": "Identifier",
"src": "1363:13:15"
}
],
"id": 2022,
"name": "MemberAccess",
"src": "1363:22:15"
}
],
"id": 2023,
"name": "VariableDeclaration",
"src": "1326:59:15"
},
{
"attributes": {
"canonicalName": "ElectionPhaseable.ElectionPhase",
"name": "ElectionPhase"
},
"children": [
{
"attributes": {
"name": "Building"
},
"id": 2024,
"name": "EnumValue",
"src": "1421:8:15"
},
{
"attributes": {
"name": "Voting"
},
"id": 2025,
"name": "EnumValue",
"src": "1439:6:15"
},
{
"attributes": {
"name": "Closed"
},
"id": 2026,
"name": "EnumValue",
"src": "1455:6:15"
},
{
"attributes": {
"name": "Aborted"
},
"id": 2027,
"name": "EnumValue",
"src": "1471:7:15"
}
],
"id": 2028,
"name": "EnumDefinition",
"src": "1392:92:15"
},
{
"attributes": {
"name": "building",
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2029,
"name": "ParameterList",
"src": "1507:2:15"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3241,
"type": "function (bool) pure",
"value": "require"
},
"id": 2030,
"name": "Identifier",
"src": "1520:7:15"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "&&",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "!",
"prefix": true,
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"arguments": [
null
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "bool",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
null
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2166,
"type": "function () view returns (bool)",
"value": "isLocked"
},
"id": 2031,
"name": "Identifier",
"src": "1529:8:15"
}
],
"id": 2032,
"name": "FunctionCall",
"src": "1529:10:15"
}
],
"id": 2033,
"name": "UnaryOperation",
"src": "1528:11:15"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_ElectionPhase_$2028",
"typeString": "enum ElectionPhaseable.ElectionPhase"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "==",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2023,
"type": "enum ElectionPhaseable.ElectionPhase",
"value": "electionPhase"
},
"id": 2034,
"name": "Identifier",
"src": "1543:13:15"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"member_name": "Building",
"referencedDeclaration": null,
"type": "enum ElectionPhaseable.ElectionPhase"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2028,
"type": "type(enum ElectionPhaseable.ElectionPhase)",
"value": "ElectionPhase"
},
"id": 2035,
"name": "Identifier",
"src": "1560:13:15"
}
],
"id": 2036,
"name": "MemberAccess",
"src": "1560:22:15"
}
],
"id": 2037,
"name": "BinaryOperation",
"src": "1543:39:15"
}
],
"id": 2038,
"name": "BinaryOperation",
"src": "1528:54:15"
}
],
"id": 2039,
"name": "FunctionCall",
"src": "1520:63:15"
}
],
"id": 2040,
"name": "ExpressionStatement",
"src": "1520:63:15"
},
{
"id": 2041,
"name": "PlaceholderStatement",
"src": "1593:1:15"
}
],
"id": 2042,
"name": "Block",
"src": "1510:91:15"
}
],
"id": 2043,
"name": "ModifierDefinition",
"src": "1490:111:15"
},
{
"attributes": {
"name": "voting",
"visibility": "internal"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2044,
"name": "ParameterList",
"src": "1622:2:15"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "tuple()",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 3241,
"type": "function (bool) pure",
"value": "require"
},
"id": 2045,
"name": "Identifier",
"src": "1635:7:15"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "&&",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "!",
"prefix": true,
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"arguments": [
null
],
"isConstant": false,
"isLValue": false,
"isPure": false,
"isStructConstructorCall": false,
"lValueRequested": false,
"names": [
null
],
"type": "bool",
"type_conversion": false
},
"children": [
{
"attributes": {
"argumentTypes": [
null
],
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2166,
"type": "function () view returns (bool)",
"value": "isLocked"
},
"id": 2046,
"name": "Identifier",
"src": "1644:8:15"
}
],
"id": 2047,
"name": "FunctionCall",
"src": "1644:10:15"
}
],
"id": 2048,
"name": "UnaryOperation",
"src": "1643:11:15"
},
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_ElectionPhase_$2028",
"typeString": "enum ElectionPhaseable.ElectionPhase"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "==",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2023,
"type": "enum ElectionPhaseable.ElectionPhase",
"value": "electionPhase"
},
"id": 2049,
"name": "Identifier",
"src": "1658:13:15"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"member_name": "Voting",
"referencedDeclaration": null,
"type": "enum ElectionPhaseable.ElectionPhase"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2028,
"type": "type(enum ElectionPhaseable.ElectionPhase)",
"value": "ElectionPhase"
},
"id": 2050,
"name": "Identifier",
"src": "1675:13:15"
}
],
"id": 2051,
"name": "MemberAccess",
"src": "1675:20:15"
}
],
"id": 2052,
"name": "BinaryOperation",
"src": "1658:37:15"
}
],
"id": 2053,
"name": "BinaryOperation",
"src": "1643:52:15"
}
],
"id": 2054,
"name": "FunctionCall",
"src": "1635:61:15"
}
],
"id": 2055,
"name": "ExpressionStatement",
"src": "1635:61:15"
},
{
"id": 2056,
"name": "PlaceholderStatement",
"src": "1706:1:15"
}
],
"id": 2057,
"name": "Block",
"src": "1625:89:15"
}
],
"id": 2058,
"name": "ModifierDefinition",
"src": "1607:107:15"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "isClosed",
"payable": false,
"scope": 2129,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 2059,
"name": "ParameterList",
"src": "1737:2:15"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 2069,
"stateVariable": false,
"storageLocation": "default",
"type": "bool",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 2060,
"name": "ElementaryTypeName",
"src": "1765:4:15"
}
],
"id": 2061,
"name": "VariableDeclaration",
"src": "1765:4:15"
}
],
"id": 2062,
"name": "ParameterList",
"src": "1764:6:15"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 2062
},
"children": [
{
"attributes": {
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_enum$_ElectionPhase_$2028",
"typeString": "enum ElectionPhaseable.ElectionPhase"
},
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "==",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2023,
"type": "enum ElectionPhaseable.ElectionPhase",
"value": "electionPhase"
},
"id": 2063,
"name": "Identifier",
"src": "1788:13:15"
},
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"member_name": "Closed",
"referencedDeclaration": null,
"type": "enum ElectionPhaseable.ElectionPhase"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 2028,
"type": "type(enum ElectionPhaseable.ElectionPhase)",
"value": "ElectionPhase"
},
"id": 2064,
"name": "Identifier",
"src": "1805:13:15"
}
],
"id": 2065,
"name": "MemberAccess",
"src": "1805:20:15"
}
],
"id": 2066,
"name": "BinaryOperation",
"src": "1788:37:15"
}
],
"id": 2067,
"name": "Return",
"src": "1781:44:15"
}
],
"id": 2068,
"name": "Block",
"src": "1771:61:15"
}
],
"id": 2069,
"name": "FunctionDefinition",
"src": "1720:112:15"