@netvote/elections-solidity
Version:
Elections Contracts
803 lines • 32.7 kB
JSON
{
"contractName": "ExternalAuthorizable",
"abi": [
{
"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": false,
"inputs": [
{
"name": "entry",
"type": "bytes32"
}
],
"name": "addAuthorized",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "removeSelf",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "entry",
"type": "bytes32"
}
],
"name": "isAuthorized",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "addr",
"type": "address"
}
],
"name": "addAdmin",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "entry",
"type": "bytes32"
}
],
"name": "removeAuthorized",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "owner",
"outputs": [
{
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
}
],
"bytecode": "0x606060405260008054600160a060020a033316600160a060020a03199091161790556103fc806100306000396000f3006060604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631785f53c811461009d57806324d7806c146100be57806341af099d146100f15780635e898dac1461010757806362f4ed901461011a578063704802751461013057806372e789b31461014f5780638da5cb5b14610165578063f2fde38b14610194575b600080fd5b34156100a857600080fd5b6100bc600160a060020a03600435166101b3565b005b34156100c957600080fd5b6100dd600160a060020a03600435166101ef565b604051901515815260200160405180910390f35b34156100fc57600080fd5b6100bc60043561023e565b341561011257600080fd5b6100bc61026d565b341561012557600080fd5b6100dd6004356102a3565b341561013b57600080fd5b6100bc600160a060020a03600435166102b8565b341561015a57600080fd5b6100bc6004356102fa565b341561017057600080fd5b610178610326565b604051600160a060020a03909116815260200160405180910390f35b341561019f57600080fd5b6100bc600160a060020a0360043516610335565b60005433600160a060020a039081169116146101ce57600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b6000600160a060020a038216158015906102385750600054600160a060020a03838116911614806102385750600160a060020a03821660009081526001602052604090205460ff165b92915050565b610247336101ef565b151561025257600080fd5b6000908152600260205260409020805460ff19166001179055565b610276336101ef565b151561028157600080fd5b600160a060020a0333166000908152600160205260409020805460ff19169055565b60009081526002602052604090205460ff1690565b60005433600160a060020a039081169116146102d357600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b610303336101ef565b151561030e57600080fd5b6000908152600260205260409020805460ff19169055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461035057600080fd5b600160a060020a038116151561036557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820dcab1d1923e28921274f2b7dfd9ee10e38a2e3f9b1595f11e9691be7c904ad510029",
"deployedBytecode": "0x6060604052600436106100985763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631785f53c811461009d57806324d7806c146100be57806341af099d146100f15780635e898dac1461010757806362f4ed901461011a578063704802751461013057806372e789b31461014f5780638da5cb5b14610165578063f2fde38b14610194575b600080fd5b34156100a857600080fd5b6100bc600160a060020a03600435166101b3565b005b34156100c957600080fd5b6100dd600160a060020a03600435166101ef565b604051901515815260200160405180910390f35b34156100fc57600080fd5b6100bc60043561023e565b341561011257600080fd5b6100bc61026d565b341561012557600080fd5b6100dd6004356102a3565b341561013b57600080fd5b6100bc600160a060020a03600435166102b8565b341561015a57600080fd5b6100bc6004356102fa565b341561017057600080fd5b610178610326565b604051600160a060020a03909116815260200160405180910390f35b341561019f57600080fd5b6100bc600160a060020a0360043516610335565b60005433600160a060020a039081169116146101ce57600080fd5b600160a060020a03166000908152600160205260409020805460ff19169055565b6000600160a060020a038216158015906102385750600054600160a060020a03838116911614806102385750600160a060020a03821660009081526001602052604090205460ff165b92915050565b610247336101ef565b151561025257600080fd5b6000908152600260205260409020805460ff19166001179055565b610276336101ef565b151561028157600080fd5b600160a060020a0333166000908152600160205260409020805460ff19169055565b60009081526002602052604090205460ff1690565b60005433600160a060020a039081169116146102d357600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b610303336101ef565b151561030e57600080fd5b6000908152600260205260409020805460ff19169055565b600054600160a060020a031681565b60005433600160a060020a0390811691161461035057600080fd5b600160a060020a038116151561036557600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820dcab1d1923e28921274f2b7dfd9ee10e38a2e3f9b1595f11e9691be7c904ad510029",
"sourceMap": "1033:403:1:-;;;494:5:21;:18;;-1:-1:-1;;;;;502:10:21;494:18;-1:-1:-1;;;;;;494:18:21;;;;;;1033:403:1;;;;;;",
"deployedSourceMap": "1033:403:1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1460:95:0;;;;;;;;;;-1:-1:-1;;;;;1460:95:0;;;;;;;1212:145;;;;;;;;;;-1:-1:-1;;;;;1212:145:0;;;;;;;;;;;;;;;;;;;;;;1240:92:1;;;;;;;;;;;;;;1561:84:0;;;;;;;;;;;;1125:109:1;;;;;;;;;;;;;;1363:91:0;;;;;;;;;;-1:-1:-1;;;;;1363:91:0;;;;;1338:96:1;;;;;;;;;;;;;;238:20:21;;;;;;;;;;;;;;;-1:-1:-1;;;;;238:20:21;;;;;;;;;;;;;;827:169;;;;;;;;;;-1:-1:-1;;;;;827:169:21;;;;;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;1240:92:1:-;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;1301:17:1;;;;:10;:17;;;;;:24;;-1:-1:-1;;1301:24:1;1321:4;1301:24;;;1240:92::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;1125:109:1:-;1187:4;1210:17;;;:10;:17;;;;;;;;;1125:109::o;1363:91:0:-;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;1338:96:1:-;1168:19:0;1176:10;1168:7;:19::i;:::-;1160:28;;;;;;;;1422:5:1;1402:17;;;:10;:17;;;;;:25;;-1:-1:-1;;1402:25:1;;;1338:96::o;238:20:21:-;;;-1:-1:-1;;;;;238:20:21;;:::o;827:169::-;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",
"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 \"./Adminable.sol\";\n\n\n/**\n * @title ExternalAuthorizable\n * @dev Allows an external system to ask whether an entry is authorized\n */\ncontract ExternalAuthorizable is Adminable {\n mapping (bytes32 => bool) authorized;\n\n function isAuthorized(bytes32 entry) public constant returns (bool) {\n return authorized[entry];\n }\n\n function addAuthorized(bytes32 entry) public admin {\n authorized[entry] = true;\n }\n\n function removeAuthorized(bytes32 entry) public admin {\n authorized[entry] = false;\n }\n}",
"sourcePath": "/Users/slanders/netvote/elections-solidity/contracts/auth/ExternalAuthorizable.sol",
"ast": {
"attributes": {
"absolutePath": "/Users/slanders/netvote/elections-solidity/contracts/auth/ExternalAuthorizable.sol",
"exportedSymbols": {
"ExternalAuthorizable": [
134
]
}
},
"children": [
{
"attributes": {
"literals": [
"solidity",
"^",
"0.4",
".17"
]
},
"id": 86,
"name": "PragmaDirective",
"src": "868:24:1"
},
{
"attributes": {
"SourceUnit": 85,
"absolutePath": "/Users/slanders/netvote/elections-solidity/contracts/auth/Adminable.sol",
"file": "./Adminable.sol",
"scope": 135,
"symbolAliases": [
null
],
"unitAlias": ""
},
"id": 87,
"name": "ImportDirective",
"src": "894:25:1"
},
{
"attributes": {
"contractDependencies": [
84,
2703
],
"contractKind": "contract",
"documentation": "@title ExternalAuthorizable\n@dev Allows an external system to ask whether an entry is authorized",
"fullyImplemented": true,
"linearizedBaseContracts": [
134,
84,
2703
],
"name": "ExternalAuthorizable",
"scope": 135
},
"children": [
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"contractScope": null,
"name": "Adminable",
"referencedDeclaration": 84,
"type": "contract Adminable"
},
"id": 88,
"name": "UserDefinedTypeName",
"src": "1066:9:1"
}
],
"id": 89,
"name": "InheritanceSpecifier",
"src": "1066:9:1"
},
{
"attributes": {
"constant": false,
"name": "authorized",
"scope": 134,
"stateVariable": true,
"storageLocation": "default",
"type": "mapping(bytes32 => bool)",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"type": "mapping(bytes32 => bool)"
},
"children": [
{
"attributes": {
"name": "bytes32",
"type": "bytes32"
},
"id": 90,
"name": "ElementaryTypeName",
"src": "1091:7:1"
},
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 91,
"name": "ElementaryTypeName",
"src": "1102:4:1"
}
],
"id": 92,
"name": "Mapping",
"src": "1082:25:1"
}
],
"id": 93,
"name": "VariableDeclaration",
"src": "1082:36:1"
},
{
"attributes": {
"constant": true,
"implemented": true,
"isConstructor": false,
"modifiers": [
null
],
"name": "isAuthorized",
"payable": false,
"scope": 134,
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "entry",
"scope": 105,
"stateVariable": false,
"storageLocation": "default",
"type": "bytes32",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bytes32",
"type": "bytes32"
},
"id": 94,
"name": "ElementaryTypeName",
"src": "1147:7:1"
}
],
"id": 95,
"name": "VariableDeclaration",
"src": "1147:13:1"
}
],
"id": 96,
"name": "ParameterList",
"src": "1146:15:1"
},
{
"children": [
{
"attributes": {
"constant": false,
"name": "",
"scope": 105,
"stateVariable": false,
"storageLocation": "default",
"type": "bool",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bool",
"type": "bool"
},
"id": 97,
"name": "ElementaryTypeName",
"src": "1187:4:1"
}
],
"id": 98,
"name": "VariableDeclaration",
"src": "1187:4:1"
}
],
"id": 99,
"name": "ParameterList",
"src": "1186:6:1"
},
{
"children": [
{
"attributes": {
"functionReturnParameters": 99
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 93,
"type": "mapping(bytes32 => bool)",
"value": "authorized"
},
"id": 100,
"name": "Identifier",
"src": "1210:10:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 95,
"type": "bytes32",
"value": "entry"
},
"id": 101,
"name": "Identifier",
"src": "1221:5:1"
}
],
"id": 102,
"name": "IndexAccess",
"src": "1210:17:1"
}
],
"id": 103,
"name": "Return",
"src": "1203:24:1"
}
],
"id": 104,
"name": "Block",
"src": "1193:41:1"
}
],
"id": 105,
"name": "FunctionDefinition",
"src": "1125:109:1"
},
{
"attributes": {
"constant": false,
"implemented": true,
"isConstructor": false,
"name": "addAuthorized",
"payable": false,
"scope": 134,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "entry",
"scope": 119,
"stateVariable": false,
"storageLocation": "default",
"type": "bytes32",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bytes32",
"type": "bytes32"
},
"id": 106,
"name": "ElementaryTypeName",
"src": "1263:7:1"
}
],
"id": 107,
"name": "VariableDeclaration",
"src": "1263:13:1"
}
],
"id": 108,
"name": "ParameterList",
"src": "1262:15:1"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 111,
"name": "ParameterList",
"src": "1291:0:1"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 19,
"type": "modifier ()",
"value": "admin"
},
"id": 109,
"name": "Identifier",
"src": "1285:5:1"
}
],
"id": 110,
"name": "ModifierInvocation",
"src": "1285:5:1"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 93,
"type": "mapping(bytes32 => bool)",
"value": "authorized"
},
"id": 112,
"name": "Identifier",
"src": "1301:10:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 107,
"type": "bytes32",
"value": "entry"
},
"id": 113,
"name": "Identifier",
"src": "1312:5:1"
}
],
"id": 114,
"name": "IndexAccess",
"src": "1301:17:1"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "74727565",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "true"
},
"id": 115,
"name": "Literal",
"src": "1321:4:1"
}
],
"id": 116,
"name": "Assignment",
"src": "1301:24:1"
}
],
"id": 117,
"name": "ExpressionStatement",
"src": "1301:24:1"
}
],
"id": 118,
"name": "Block",
"src": "1291:41:1"
}
],
"id": 119,
"name": "FunctionDefinition",
"src": "1240:92:1"
},
{
"attributes": {
"constant": false,
"implemented": true,
"isConstructor": false,
"name": "removeAuthorized",
"payable": false,
"scope": 134,
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "public"
},
"children": [
{
"children": [
{
"attributes": {
"constant": false,
"name": "entry",
"scope": 133,
"stateVariable": false,
"storageLocation": "default",
"type": "bytes32",
"value": null,
"visibility": "internal"
},
"children": [
{
"attributes": {
"name": "bytes32",
"type": "bytes32"
},
"id": 120,
"name": "ElementaryTypeName",
"src": "1364:7:1"
}
],
"id": 121,
"name": "VariableDeclaration",
"src": "1364:13:1"
}
],
"id": 122,
"name": "ParameterList",
"src": "1363:15:1"
},
{
"attributes": {
"parameters": [
null
]
},
"children": [],
"id": 125,
"name": "ParameterList",
"src": "1392:0:1"
},
{
"attributes": {
"arguments": [
null
]
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 19,
"type": "modifier ()",
"value": "admin"
},
"id": 123,
"name": "Identifier",
"src": "1386:5:1"
}
],
"id": 124,
"name": "ModifierInvocation",
"src": "1386:5:1"
},
{
"children": [
{
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"operator": "=",
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"type": "bool"
},
"children": [
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 93,
"type": "mapping(bytes32 => bool)",
"value": "authorized"
},
"id": 126,
"name": "Identifier",
"src": "1402:10:1"
},
{
"attributes": {
"argumentTypes": null,
"overloadedDeclarations": [
null
],
"referencedDeclaration": 121,
"type": "bytes32",
"value": "entry"
},
"id": 127,
"name": "Identifier",
"src": "1413:5:1"
}
],
"id": 128,
"name": "IndexAccess",
"src": "1402:17:1"
},
{
"attributes": {
"argumentTypes": null,
"hexvalue": "66616c7365",
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"subdenomination": null,
"token": "bool",
"type": "bool",
"value": "false"
},
"id": 129,
"name": "Literal",
"src": "1422:5:1"
}
],
"id": 130,
"name": "Assignment",
"src": "1402:25:1"
}
],
"id": 131,
"name": "ExpressionStatement",
"src": "1402:25:1"
}
],
"id": 132,
"name": "Block",
"src": "1392:42:1"
}
],
"id": 133,
"name": "FunctionDefinition",
"src": "1338:96:1"
}
],
"id": 134,
"name": "ContractDefinition",
"src": "1033:403:1"
}
],
"id": 135,
"name": "SourceUnit",
"src": "868:568:1"
},
"compiler": {
"name": "solc",
"version": "0.4.18+commit.9cf6e910.Emscripten.clang"
},
"networks": {},
"schemaVersion": "1.0.1",
"updatedAt": "2018-03-26T15:46:12.426Z"
}