UNPKG

hardlydifficult-ethereum-contracts

Version:
1,109 lines 108 kB
{ "contractName": "AdminRole", "abi": [ { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" } ], "name": "AdminAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" } ], "name": "AdminRemoved", "type": "event" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "_account", "type": "address" } ], "name": "isAdmin", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "addAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceAdmin", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.17+commit.d19bba13\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AdminAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"AdminRemoved\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addAdmin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"_account\",\"type\":\"address\"}],\"name\":\"isAdmin\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceAdmin\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"methods\":{},\"title\":\"AdminRole\"},\"userdoc\":{\"methods\":{},\"notice\":\"A copy of one of the OpenZeppelin roles with a more general purpose name. Original source: https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/access\"}},\"settings\":{\"compilationTarget\":{\"/home/circleci/repo/contracts/access/roles/AdminRole.sol\":\"AdminRole\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":2000000},\"remappings\":[]},\"sources\":{\"/home/circleci/repo/contracts/access/roles/AdminRole.sol\":{\"keccak256\":\"0x6f15262c282d670b69401ab27e7ae9e203d97b8ebd86c1a282c1f8fdc1241224\",\"urls\":[\"bzz-raw://a149786f216652b390abc9aa53ae79dc31275c8623e58b44a9266649a3224808\",\"dweb:/ipfs/QmPk2D6FEgnrsHwkNdPaRF4ad4xCfNVEVjJPfcBE8tWvFS\"]},\"@openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol\":{\"keccak256\":\"0xb002c378d7b82a101bd659c341518953ca0919d342c0a400196982c0e7e7bcdb\",\"urls\":[\"bzz-raw://00a788c4631466c220b385bdd100c571d24b2deccd657615cfbcef6cadf669a4\",\"dweb:/ipfs/QmTEwDbjJNxmMNCDMqtuou3dyM8Wtp8Q9NFvn7SAVM7Jf3\"]},\"@openzeppelin/upgrades/contracts/Initializable.sol\":{\"keccak256\":\"0x9bfec92e36234ecc99b5d37230acb6cd1f99560233753162204104a4897e8721\",\"urls\":[\"bzz-raw://5cf7c208583d4d046d75bd99f5507412ab01cce9dd9f802ce9768a416d93ea2f\",\"dweb:/ipfs/QmcQS1BBMPpVEkXP3qzwSjxHNrqDek8YeR7xbVWDC9ApC7\"]}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b506104b5806100206000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c806324d7806c14610046578063704802751461008d5780638bad0c0a146100c2575b600080fd5b6100796004803603602081101561005c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ca565b604080519115158252519081900360200190f35b6100c0600480360360208110156100a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100e3565b005b6100c061014d565b60006100dd60338363ffffffff61015816565b92915050565b6100ec336100ca565b610141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610453602e913960400191505060405180910390fd5b61014a816101f3565b50565b61015633610248565b565b600073ffffffffffffffffffffffffffffffffffffffff82166101c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104316022913960400191505060405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff1690565b61020460338263ffffffff61029d16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e33990600090a250565b61025960338263ffffffff61036316565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f90600090a250565b6102a78282610158565b1561031357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b61036d8282610158565b6103c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806104106021913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905556fe526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f206164647265737341646d696e526f6c653a2063616c6c657220646f6573206e6f742068617665207468652041646d696e20726f6c65a265627a7a72315820fa4848453cc20754da834b33e8b76736ce837c1595faa1c682c5697db93e56e664736f6c63430005110032", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c806324d7806c14610046578063704802751461008d5780638bad0c0a146100c2575b600080fd5b6100796004803603602081101561005c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100ca565b604080519115158252519081900360200190f35b6100c0600480360360208110156100a357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166100e3565b005b6100c061014d565b60006100dd60338363ffffffff61015816565b92915050565b6100ec336100ca565b610141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e815260200180610453602e913960400191505060405180910390fd5b61014a816101f3565b50565b61015633610248565b565b600073ffffffffffffffffffffffffffffffffffffffff82166101c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806104316022913960400191505060405180910390fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff1690565b61020460338263ffffffff61029d16565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f44d6d25963f097ad14f29f06854a01f575648a1ef82f30e562ccd3889717e33990600090a250565b61025960338263ffffffff61036316565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fa3b62bc36326052d97ea62d63c3d60308ed4c3ea8ac079dd8499f1e9c4f80c0f90600090a250565b6102a78282610158565b1561031357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b61036d8282610158565b6103c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806104106021913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016905556fe526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65526f6c65733a206163636f756e7420697320746865207a65726f206164647265737341646d696e526f6c653a2063616c6c657220646f6573206e6f742068617665207468652041646d696e20726f6c65a265627a7a72315820fa4848453cc20754da834b33e8b76736ce837c1595faa1c682c5697db93e56e664736f6c63430005110032", "sourceMap": "382:926:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;382:926:0;;;;;;;", "deployedSourceMap": "382:926:0:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;382:926:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;803:111;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;803:111:0;;;;:::i;:::-;;;;;;;;;;;;;;;;;;918:83;;;;;;13:2:-1;8:3;5:11;2:2;;;29:1;26;19:12;2:2;-1:-1;918:83:0;;;;:::i;:::-;;1005:69;;;:::i;803:111::-;867:4;888:21;:7;900:8;888:21;:11;:21;:::i;:::-;881:28;803:111;-1:-1:-1;;803:111:0:o;918:83::-;717:19;725:10;717:7;:19::i;:::-;709:78;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;978:18;988:7;978:9;:18::i;:::-;918:83;:::o;1005:69::-;1045:24;1058:10;1045:12;:24::i;:::-;1005:69::o;779:200:24:-;851:4;875:21;;;867:68;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;952:20:24;;:11;:20;;;;;;;;;;;;;;;779:200::o;1078:108:0:-;1131:20;:7;1143;1131:20;:11;:20;:::i;:::-;1162:19;;;;;;;;;;;1078:108;:::o;1190:116::-;1246:23;:7;1261;1246:23;:14;:23;:::i;:::-;1280:21;;;;;;;;;;;1190:116;:::o;260:175:24:-;337:18;341:4;347:7;337:3;:18::i;:::-;336:19;328:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;401:20;;:11;:20;;;;;;;;;;;:27;;;;424:4;401:27;;;260:175::o;510:180::-;589:18;593:4;599:7;589:3;:18::i;:::-;581:64;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;655:20;;678:5;655:20;;;;;;;;;;;:28;;;;;;510:180::o", "source": "pragma solidity ^0.5.0;\n\nimport '@openzeppelin/upgrades/contracts/Initializable.sol';\nimport '@openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol';\n\n/**\n * @title AdminRole\n * @notice A copy of one of the OpenZeppelin roles with a more general purpose name.\n * Original source: https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/access\n */\ncontract AdminRole is Initializable\n{\n using Roles for Roles.Role;\n\n event AdminAdded(address indexed account);\n event AdminRemoved(address indexed account);\n\n Roles.Role private _admins;\n\n function _initializeAdminRole(address _admin) internal initializer()\n {\n _addAdmin(_admin);\n }\n\n modifier onlyAdmin()\n {\n require(isAdmin(msg.sender), 'AdminRole: caller does not have the Admin role');\n _;\n }\n\n function isAdmin(\n address _account\n ) public view returns (bool)\n {\n return _admins.has(_account);\n }\n\n function addAdmin(address account) public onlyAdmin\n {\n _addAdmin(account);\n }\n\n function renounceAdmin() public\n {\n _removeAdmin(msg.sender);\n }\n\n function _addAdmin(address account) internal\n {\n _admins.add(account);\n emit AdminAdded(account);\n }\n\n function _removeAdmin(address account) internal\n {\n _admins.remove(account);\n emit AdminRemoved(account);\n }\n}\n", "sourcePath": "/home/circleci/repo/contracts/access/roles/AdminRole.sol", "ast": { "absolutePath": "/home/circleci/repo/contracts/access/roles/AdminRole.sol", "exportedSymbols": { "AdminRole": [ 109 ] }, "id": 110, "nodeType": "SourceUnit", "nodes": [ { "id": 1, "literals": [ "solidity", "^", "0.5", ".0" ], "nodeType": "PragmaDirective", "src": "0:23:0" }, { "absolutePath": "@openzeppelin/upgrades/contracts/Initializable.sol", "file": "@openzeppelin/upgrades/contracts/Initializable.sol", "id": 2, "nodeType": "ImportDirective", "scope": 110, "sourceUnit": 2249, "src": "25:60:0", "symbolAliases": [], "unitAlias": "" }, { "absolutePath": "@openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol", "file": "@openzeppelin/contracts-ethereum-package/contracts/access/Roles.sol", "id": 3, "nodeType": "ImportDirective", "scope": 110, "sourceUnit": 1924, "src": "86:77:0", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 4, "name": "Initializable", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2248, "src": "404:13:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Initializable_$2248", "typeString": "contract Initializable" } }, "id": 5, "nodeType": "InheritanceSpecifier", "src": "404:13:0" } ], "contractDependencies": [ 2248 ], "contractKind": "contract", "documentation": "@title AdminRole\n@notice A copy of one of the OpenZeppelin roles with a more general purpose name.\nOriginal source: https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts/access", "fullyImplemented": true, "id": 109, "linearizedBaseContracts": [ 109, 2248 ], "name": "AdminRole", "nodeType": "ContractDefinition", "nodes": [ { "id": 8, "libraryName": { "contractScope": null, "id": 6, "name": "Roles", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1923, "src": "428:5:0", "typeDescriptions": { "typeIdentifier": "t_contract$_Roles_$1923", "typeString": "library Roles" } }, "nodeType": "UsingForDirective", "src": "422:27:0", "typeName": { "contractScope": null, "id": 7, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1849, "src": "438:10:0", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$1849_storage_ptr", "typeString": "struct Roles.Role" } } }, { "anonymous": false, "documentation": null, "id": 12, "name": "AdminAdded", "nodeType": "EventDefinition", "parameters": { "id": 11, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 10, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 12, "src": "470:23:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 9, "name": "address", "nodeType": "ElementaryTypeName", "src": "470:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "469:25:0" }, "src": "453:42:0" }, { "anonymous": false, "documentation": null, "id": 16, "name": "AdminRemoved", "nodeType": "EventDefinition", "parameters": { "id": 15, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 14, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 16, "src": "517:23:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 13, "name": "address", "nodeType": "ElementaryTypeName", "src": "517:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "516:25:0" }, "src": "498:44:0" }, { "constant": false, "id": 18, "name": "_admins", "nodeType": "VariableDeclaration", "scope": 109, "src": "546:26:0", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$1849_storage", "typeString": "struct Roles.Role" }, "typeName": { "contractScope": null, "id": 17, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 1849, "src": "546:10:0", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$1849_storage_ptr", "typeString": "struct Roles.Role" } }, "value": null, "visibility": "private" }, { "body": { "id": 29, "nodeType": "Block", "src": "648:28:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 26, "name": "_admin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 20, "src": "664:6:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 25, "name": "_addAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 92, "src": "654:9:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 27, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "654:17:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 28, "nodeType": "ExpressionStatement", "src": "654:17:0" } ] }, "documentation": null, "id": 30, "implemented": true, "kind": "function", "modifiers": [ { "arguments": [], "id": 23, "modifierName": { "argumentTypes": null, "id": 22, "name": "initializer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2223, "src": "632:11:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "632:13:0" } ], "name": "_initializeAdminRole", "nodeType": "FunctionDefinition", "parameters": { "id": 21, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 20, "name": "_admin", "nodeType": "VariableDeclaration", "scope": 30, "src": "607:14:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 19, "name": "address", "nodeType": "ElementaryTypeName", "src": "607:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "606:16:0" }, "returnParameters": { "id": 24, "nodeType": "ParameterList", "parameters": [], "src": "648:0:0" }, "scope": 109, "src": "577:99:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 41, "nodeType": "Block", "src": "703:96:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 34, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2263, "src": "725:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 35, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "725:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 33, "name": "isAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 55, "src": "717:7:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 36, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "717:19:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "41646d696e526f6c653a2063616c6c657220646f6573206e6f742068617665207468652041646d696e20726f6c65", "id": 37, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "738:48:0", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_b8487d002a356d65129c7f2d6a4517d378d929ddd6beeb4c325c1ed9f8ec139b", "typeString": "literal_string \"AdminRole: caller does not have the Admin role\"" }, "value": "AdminRole: caller does not have the Admin role" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_b8487d002a356d65129c7f2d6a4517d378d929ddd6beeb4c325c1ed9f8ec139b", "typeString": "literal_string \"AdminRole: caller does not have the Admin role\"" } ], "id": 32, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 2266, 2267 ], "referencedDeclaration": 2267, "src": "709:7:0", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 38, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "709:78:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 39, "nodeType": "ExpressionStatement", "src": "709:78:0" }, { "id": 40, "nodeType": "PlaceholderStatement", "src": "793:1:0" } ] }, "documentation": null, "id": 42, "name": "onlyAdmin", "nodeType": "ModifierDefinition", "parameters": { "id": 31, "nodeType": "ParameterList", "parameters": [], "src": "698:2:0" }, "src": "680:119:0", "visibility": "internal" }, { "body": { "id": 54, "nodeType": "Block", "src": "875:39:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 51, "name": "_account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 44, "src": "900:8:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 49, "name": "_admins", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18, "src": "888:7:0", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$1849_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 50, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "has", "nodeType": "MemberAccess", "referencedDeclaration": 1922, "src": "888:11:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$1849_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$1849_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)" } }, "id": 52, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "888:21:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 48, "id": 53, "nodeType": "Return", "src": "881:28:0" } ] }, "documentation": null, "id": 55, "implemented": true, "kind": "function", "modifiers": [], "name": "isAdmin", "nodeType": "FunctionDefinition", "parameters": { "id": 45, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 44, "name": "_account", "nodeType": "VariableDeclaration", "scope": 55, "src": "825:16:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 43, "name": "address", "nodeType": "ElementaryTypeName", "src": "825:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "819:26:0" }, "returnParameters": { "id": 48, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 47, "name": "", "nodeType": "VariableDeclaration", "scope": 55, "src": "867:4:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 46, "name": "bool", "nodeType": "ElementaryTypeName", "src": "867:4:0", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "866:6:0" }, "scope": 109, "src": "803:111:0", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 66, "nodeType": "Block", "src": "972:29:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 63, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 57, "src": "988:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 62, "name": "_addAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 92, "src": "978:9:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 64, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "978:18:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 65, "nodeType": "ExpressionStatement", "src": "978:18:0" } ] }, "documentation": null, "id": 67, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 60, "modifierName": { "argumentTypes": null, "id": 59, "name": "onlyAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 42, "src": "960:9:0", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "960:9:0" } ], "name": "addAdmin", "nodeType": "FunctionDefinition", "parameters": { "id": 58, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 57, "name": "account", "nodeType": "VariableDeclaration", "scope": 67, "src": "936:15:0", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 56, "name": "address", "nodeType": "ElementaryTypeName", "src": "936:7:0", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "935:17:0" }, "returnParameters": { "id": 61, "nodeType": "ParameterList", "parameters": [], "src": "972:0:0" }, "scope": 109, "src": "918:83:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 75, "nodeType": "Block", "src": "1039:35:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 71, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 2263, "src": "1058:3:0", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 72, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1058:10:0", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 70, "name": "_removeAdmin", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 108, "src": "1045:12:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 73, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1045:24:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 74, "nodeType": "ExpressionStatement", "src": "1045:24:0" } ] }, "documentation": null, "id": 76, "implemented": true, "kind": "function", "modifiers": [], "name": "renounceAdmin", "nodeType": "FunctionDefinition", "parameters": { "id": 68, "nodeType": "ParameterList", "parameters": [], "src": "1027:2:0" }, "returnParameters": { "id": 69, "nodeType": "ParameterList", "parameters": [], "src": "1039:0:0" }, "scope": 109, "src": "1005:69:0", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 91, "nodeType": "Block", "src": "1125:61:0", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 84, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 78, "src": "1143:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 81, "name": "_admins", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 18, "src": "1131:7:0", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$1849_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 83, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 1874, "src": "1131:11:0", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$1849_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$1849_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 85, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1131:20:0", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 86, "nodeType": "ExpressionStatement", "src": "1131:20:0" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 88, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 78, "src": "1173:7:0", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 87, "name": "AdminAdded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 12, "src": "1162:10:0", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 89, "isConstant": false, "isLValue": false, "isPure": false, "kind": "funct