{ "contractName": "XBRMaintained", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "account", "type": "address" } ], "name": "MaintainerAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "name": "account", "type": "address" } ], "name": "MaintainerRemoved", "type": "event" }, { "constant": true, "inputs": [ { "name": "account", "type": "address" } ], "name": "isMaintainer", "outputs": [ { "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "name": "account", "type": "address" } ], "name": "addMaintainer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" }, { "constant": false, "inputs": [], "name": "renounceMaintainer", "outputs": [], "payable": false, "stateMutability": "nonpayable", "type": "function" } ], "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "///////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (C) 2018 Crossbar.io Technologies GmbH and contributors.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n///////////////////////////////////////////////////////////////////////////////\n\npragma solidity ^0.5.2;\n\nimport \"openzeppelin-solidity/contracts/access/Roles.sol\";\n\n\n/**\n * XBR Network (and XBR Network Proxies) SCs inherit from this base contract\n * to manage network administration and maintenance via Role-based Access\n * Control (RBAC).\n * The implementation for management comes from the OpenZeppelin RBAC library.\n */\ncontract XBRMaintained {\n /// OpenZeppelin RBAC mixin.\n using Roles for Roles.Role;\n\n /**\n * Event fired when a maintainer was added.\n *\n * @param account The account that was added as a maintainer.\n */\n event MaintainerAdded(address indexed account);\n\n /**\n * Event fired when a maintainer was removed.\n *\n * @param account The account that was removed as a maintainer.\n */\n event MaintainerRemoved(address indexed account);\n\n /// Current list of XBR network maintainers.\n Roles.Role private maintainers;\n\n /// The constructor is internal (roles are managed by the OpenZeppelin base class).\n constructor () internal {\n _addMaintainer(msg.sender);\n }\n\n /**\n * Modifier to require maintainer-role for the sender when calling a SC.\n */\n modifier onlyMaintainer () {\n require(isMaintainer(msg.sender));\n _;\n }\n\n /**\n * Check if the given address is currently a maintainer.\n *\n * @param account The account to check.\n * @return `true` if the account is maintainer, otherwise `false`.\n */\n function isMaintainer (address account) public view returns (bool) {\n return maintainers.has(account);\n }\n\n /**\n * Add a new maintainer to the list of maintainers.\n *\n * @param account The account to grant maintainer rights to.\n */\n function addMaintainer (address account) public onlyMaintainer {\n _addMaintainer(account);\n }\n\n /**\n * Give away maintainer rights.\n */\n function renounceMaintainer () public {\n _removeMaintainer(msg.sender);\n }\n\n function _addMaintainer (address account) internal {\n maintainers.add(account);\n emit MaintainerAdded(account);\n }\n\n function _removeMaintainer (address account) internal {\n maintainers.remove(account);\n emit MaintainerRemoved(account);\n }\n}\n", "sourcePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRMaintained.sol", "ast": { "absolutePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRMaintained.sol", "exportedSymbols": { "XBRMaintained": [ 159 ] }, "id": 160, "nodeType": "SourceUnit", "nodes": [ { "id": 58, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "805:23:1" }, { "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol", "file": "openzeppelin-solidity/contracts/access/Roles.sol", "id": 59, "nodeType": "ImportDirective", "scope": 160, "sourceUnit": 2556, "src": "830:58:1", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "XBR Network (and XBR Network Proxies) SCs inherit from this base contract\nto manage network administration and maintenance via Role-based Access\nControl (RBAC).\nThe implementation for management comes from the OpenZeppelin RBAC library.", "fullyImplemented": true, "id": 159, "linearizedBaseContracts": [ 159 ], "name": "XBRMaintained", "nodeType": "ContractDefinition", "nodes": [ { "id": 62, "libraryName": { "contractScope": null, "id": 60, "name": "Roles", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2555, "src": "1216:5:1", "typeDescriptions": { "typeIdentifier": "t_contract$_Roles_$2555", "typeString": "library Roles" } }, "nodeType": "UsingForDirective", "src": "1210:27:1", "typeName": { "contractScope": null, "id": 61, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2468, "src": "1226:10:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage_ptr", "typeString": "struct Roles.Role" } } }, { "anonymous": false, "documentation": "Event fired when a maintainer was added.\n * @param account The account that was added as a maintainer.", "id": 66, "name": "MaintainerAdded", "nodeType": "EventDefinition", "parameters": { "id": 65, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 64, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 66, "src": "1402:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 63, "name": "address", "nodeType": "ElementaryTypeName", "src": "1402:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1401:25:1" }, "src": "1380:47:1" }, { "anonymous": false, "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.", "id": 70, "name": "MaintainerRemoved", "nodeType": "EventDefinition", "parameters": { "id": 69, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 68, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 70, "src": "1598:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 67, "name": "address", "nodeType": "ElementaryTypeName", "src": "1598:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1597:25:1" }, "src": "1574:49:1" }, { "constant": false, "id": 72, "name": "maintainers", "nodeType": "VariableDeclaration", "scope": 159, "src": "1678:30:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role" }, "typeName": { "contractScope": null, "id": 71, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2468, "src": "1678:10:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage_ptr", "typeString": "struct Roles.Role" } }, "value": null, "visibility": "private" }, { "body": { "id": 80, "nodeType": "Block", "src": "1827:43:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 76, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "1852:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 77, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1852:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 75, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 142, "src": "1837:14:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 78, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1837:26:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 79, "nodeType": "ExpressionStatement", "src": "1837:26:1" } ] }, "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).", "id": 81, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 73, "nodeType": "ParameterList", "parameters": [], "src": "1815:2:1" }, "returnParameters": { "id": 74, "nodeType": "ParameterList", "parameters": [], "src": "1827:0:1" }, "scope": 159, "src": "1803:67:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 91, "nodeType": "Block", "src": "1996:61:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 85, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "2027:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 86, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2027:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 84, "name": "isMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 105, "src": "2014:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 87, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2014:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 83, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "2006:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 88, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2006:33:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 89, "nodeType": "ExpressionStatement", "src": "2006:33:1" }, { "id": 90, "nodeType": "PlaceholderStatement", "src": "2049:1:1" } ] }, "documentation": "Modifier to require maintainer-role for the sender when calling a SC.", "id": 92, "name": "onlyMaintainer", "nodeType": "ModifierDefinition", "parameters": { "id": 82, "nodeType": "ParameterList", "parameters": [], "src": "1993:2:1" }, "src": "1969:88:1", "visibility": "internal" }, { "body": { "id": 104, "nodeType": "Block", "src": "2329:48:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 101, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 94, "src": "2362:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 99, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2346:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 100, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "has", "nodeType": "MemberAccess", "referencedDeclaration": 2554, "src": "2346:15:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)" } }, "id": 102, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2346:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 98, "id": 103, "nodeType": "Return", "src": "2339:31:1" } ] }, "documentation": "Check if the given address is currently a maintainer.\n * @param account The account to check.\n@return `true` if the account is maintainer, otherwise `false`.", "id": 105, "implemented": true, "kind": "function", "modifiers": [], "name": "isMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 95, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 94, "name": "account", "nodeType": "VariableDeclaration", "scope": 105, "src": "2285:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 93, "name": "address", "nodeType": "ElementaryTypeName", "src": "2285:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2284:17:1" }, "returnParameters": { "id": 98, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 97, "name": "", "nodeType": "VariableDeclaration", "scope": 105, "src": "2323:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 96, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2323:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "2322:6:1" }, "scope": 159, "src": "2262:115:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 116, "nodeType": "Block", "src": "2590:40:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 113, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 107, "src": "2615:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 112, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 142, "src": "2600:14:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 114, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2600:23:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 115, "nodeType": "ExpressionStatement", "src": "2600:23:1" } ] }, "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.", "id": 117, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 110, "modifierName": { "argumentTypes": null, "id": 109, "name": "onlyMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 92, "src": "2575:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2575:14:1" } ], "name": "addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 108, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 107, "name": "account", "nodeType": "VariableDeclaration", "scope": 117, "src": "2551:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 106, "name": "address", "nodeType": "ElementaryTypeName", "src": "2551:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2550:17:1" }, "returnParameters": { "id": 111, "nodeType": "ParameterList", "parameters": [], "src": "2590:0:1" }, "scope": 159, "src": "2527:103:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 125, "nodeType": "Block", "src": "2726:46:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 121, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "2754:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2754:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 120, "name": "_removeMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 158, "src": "2736:17:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 123, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2736:29:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 124, "nodeType": "ExpressionStatement", "src": "2736:29:1" } ] }, "documentation": "Give away maintainer rights.", "id": 126, "implemented": true, "kind": "function", "modifiers": [], "name": "renounceMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 118, "nodeType": "ParameterList", "parameters": [], "src": "2716:2:1" }, "returnParameters": { "id": 119, "nodeType": "ParameterList", "parameters": [], "src": "2726:0:1" }, "scope": 159, "src": "2688:84:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 141, "nodeType": "Block", "src": "2829:80:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 134, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 128, "src": "2855:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 131, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2839:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 133, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 2500, "src": "2839:15:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 135, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2839:24:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 136, "nodeType": "ExpressionStatement", "src": "2839:24:1" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 138, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 128, "src": "2894:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 137, "name": "MaintainerAdded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 66, "src": "2878:15:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 139, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2878:24:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 140, "nodeType": "EmitStatement", "src": "2873:29:1" } ] }, "documentation": null, "id": 142, "implemented": true, "kind": "function", "modifiers": [], "name": "_addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 129, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 128, "name": "account", "nodeType": "VariableDeclaration", "scope": 142, "src": "2803:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 127, "name": "address", "nodeType": "ElementaryTypeName", "src": "2803:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2802:17:1" }, "returnParameters": { "id": 130, "nodeType": "ParameterList", "parameters": [], "src": "2829:0:1" }, "scope": 159, "src": "2778:131:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 157, "nodeType": "Block", "src": "2969:85:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 150, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 144, "src": "2998:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 147, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2979:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 149, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remove", "nodeType": "MemberAccess", "referencedDeclaration": 2531, "src": "2979:18:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 151, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2979:27:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 152, "nodeType": "ExpressionStatement", "src": "2979:27:1" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 154, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 144, "src": "3039:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 153, "name": "MaintainerRemoved", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 70, "src": "3021:17:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 155, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3021:26:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 156, "nodeType": "EmitStatement", "src": "3016:31:1" } ] }, "documentation": null, "id": 158, "implemented": true, "kind": "function", "modifiers": [], "name": "_removeMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 145, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 144, "name": "account", "nodeType": "VariableDeclaration", "scope": 158, "src": "2943:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 143, "name": "address", "nodeType": "ElementaryTypeName", "src": "2943:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2942:17:1" }, "returnParameters": { "id": 146, "nodeType": "ParameterList", "parameters": [], "src": "2969:0:1" }, "scope": 159, "src": "2915:139:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" } ], "scope": 160, "src": "1148:1908:1" } ], "src": "805:2252:1" }, "legacyAST": { "absolutePath": "/home/oberstet/scm/xbr/xbr-protocol/contracts/XBRMaintained.sol", "exportedSymbols": { "XBRMaintained": [ 159 ] }, "id": 160, "nodeType": "SourceUnit", "nodes": [ { "id": 58, "literals": [ "solidity", "^", "0.5", ".2" ], "nodeType": "PragmaDirective", "src": "805:23:1" }, { "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol", "file": "openzeppelin-solidity/contracts/access/Roles.sol", "id": 59, "nodeType": "ImportDirective", "scope": 160, "sourceUnit": 2556, "src": "830:58:1", "symbolAliases": [], "unitAlias": "" }, { "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": "XBR Network (and XBR Network Proxies) SCs inherit from this base contract\nto manage network administration and maintenance via Role-based Access\nControl (RBAC).\nThe implementation for management comes from the OpenZeppelin RBAC library.", "fullyImplemented": true, "id": 159, "linearizedBaseContracts": [ 159 ], "name": "XBRMaintained", "nodeType": "ContractDefinition", "nodes": [ { "id": 62, "libraryName": { "contractScope": null, "id": 60, "name": "Roles", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2555, "src": "1216:5:1", "typeDescriptions": { "typeIdentifier": "t_contract$_Roles_$2555", "typeString": "library Roles" } }, "nodeType": "UsingForDirective", "src": "1210:27:1", "typeName": { "contractScope": null, "id": 61, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2468, "src": "1226:10:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage_ptr", "typeString": "struct Roles.Role" } } }, { "anonymous": false, "documentation": "Event fired when a maintainer was added.\n * @param account The account that was added as a maintainer.", "id": 66, "name": "MaintainerAdded", "nodeType": "EventDefinition", "parameters": { "id": 65, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 64, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 66, "src": "1402:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 63, "name": "address", "nodeType": "ElementaryTypeName", "src": "1402:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1401:25:1" }, "src": "1380:47:1" }, { "anonymous": false, "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.", "id": 70, "name": "MaintainerRemoved", "nodeType": "EventDefinition", "parameters": { "id": 69, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 68, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 70, "src": "1598:23:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 67, "name": "address", "nodeType": "ElementaryTypeName", "src": "1598:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1597:25:1" }, "src": "1574:49:1" }, { "constant": false, "id": 72, "name": "maintainers", "nodeType": "VariableDeclaration", "scope": 159, "src": "1678:30:1", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role" }, "typeName": { "contractScope": null, "id": 71, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 2468, "src": "1678:10:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage_ptr", "typeString": "struct Roles.Role" } }, "value": null, "visibility": "private" }, { "body": { "id": 80, "nodeType": "Block", "src": "1827:43:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 76, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "1852:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 77, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1852:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 75, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 142, "src": "1837:14:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 78, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1837:26:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 79, "nodeType": "ExpressionStatement", "src": "1837:26:1" } ] }, "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).", "id": 81, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 73, "nodeType": "ParameterList", "parameters": [], "src": "1815:2:1" }, "returnParameters": { "id": 74, "nodeType": "ParameterList", "parameters": [], "src": "1827:0:1" }, "scope": 159, "src": "1803:67:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 91, "nodeType": "Block", "src": "1996:61:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 85, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "2027:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 86, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2027:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 84, "name": "isMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 105, "src": "2014:12:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 87, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2014:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 83, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 3292, 3293 ], "referencedDeclaration": 3292, "src": "2006:7:1", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 88, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2006:33:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 89, "nodeType": "ExpressionStatement", "src": "2006:33:1" }, { "id": 90, "nodeType": "PlaceholderStatement", "src": "2049:1:1" } ] }, "documentation": "Modifier to require maintainer-role for the sender when calling a SC.", "id": 92, "name": "onlyMaintainer", "nodeType": "ModifierDefinition", "parameters": { "id": 82, "nodeType": "ParameterList", "parameters": [], "src": "1993:2:1" }, "src": "1969:88:1", "visibility": "internal" }, { "body": { "id": 104, "nodeType": "Block", "src": "2329:48:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 101, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 94, "src": "2362:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 99, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2346:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 100, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "has", "nodeType": "MemberAccess", "referencedDeclaration": 2554, "src": "2346:15:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)" } }, "id": 102, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2346:24:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 98, "id": 103, "nodeType": "Return", "src": "2339:31:1" } ] }, "documentation": "Check if the given address is currently a maintainer.\n * @param account The account to check.\n@return `true` if the account is maintainer, otherwise `false`.", "id": 105, "implemented": true, "kind": "function", "modifiers": [], "name": "isMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 95, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 94, "name": "account", "nodeType": "VariableDeclaration", "scope": 105, "src": "2285:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 93, "name": "address", "nodeType": "ElementaryTypeName", "src": "2285:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2284:17:1" }, "returnParameters": { "id": 98, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 97, "name": "", "nodeType": "VariableDeclaration", "scope": 105, "src": "2323:4:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 96, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2323:4:1", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "2322:6:1" }, "scope": 159, "src": "2262:115:1", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 116, "nodeType": "Block", "src": "2590:40:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 113, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 107, "src": "2615:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 112, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 142, "src": "2600:14:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 114, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2600:23:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 115, "nodeType": "ExpressionStatement", "src": "2600:23:1" } ] }, "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.", "id": 117, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 110, "modifierName": { "argumentTypes": null, "id": 109, "name": "onlyMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 92, "src": "2575:14:1", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2575:14:1" } ], "name": "addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 108, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 107, "name": "account", "nodeType": "VariableDeclaration", "scope": 117, "src": "2551:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 106, "name": "address", "nodeType": "ElementaryTypeName", "src": "2551:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2550:17:1" }, "returnParameters": { "id": 111, "nodeType": "ParameterList", "parameters": [], "src": "2590:0:1" }, "scope": 159, "src": "2527:103:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 125, "nodeType": "Block", "src": "2726:46:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 121, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 3289, "src": "2754:3:1", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 122, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2754:10:1", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 120, "name": "_removeMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 158, "src": "2736:17:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 123, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2736:29:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 124, "nodeType": "ExpressionStatement", "src": "2736:29:1" } ] }, "documentation": "Give away maintainer rights.", "id": 126, "implemented": true, "kind": "function", "modifiers": [], "name": "renounceMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 118, "nodeType": "ParameterList", "parameters": [], "src": "2716:2:1" }, "returnParameters": { "id": 119, "nodeType": "ParameterList", "parameters": [], "src": "2726:0:1" }, "scope": 159, "src": "2688:84:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 141, "nodeType": "Block", "src": "2829:80:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 134, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 128, "src": "2855:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 131, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2839:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 133, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 2500, "src": "2839:15:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 135, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2839:24:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 136, "nodeType": "ExpressionStatement", "src": "2839:24:1" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 138, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 128, "src": "2894:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 137, "name": "MaintainerAdded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 66, "src": "2878:15:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 139, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2878:24:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 140, "nodeType": "EmitStatement", "src": "2873:29:1" } ] }, "documentation": null, "id": 142, "implemented": true, "kind": "function", "modifiers": [], "name": "_addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 129, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 128, "name": "account", "nodeType": "VariableDeclaration", "scope": 142, "src": "2803:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 127, "name": "address", "nodeType": "ElementaryTypeName", "src": "2803:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2802:17:1" }, "returnParameters": { "id": 130, "nodeType": "ParameterList", "parameters": [], "src": "2829:0:1" }, "scope": 159, "src": "2778:131:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 157, "nodeType": "Block", "src": "2969:85:1", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 150, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 144, "src": "2998:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 147, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 72, "src": "2979:11:1", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$2468_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 149, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remove", "nodeType": "MemberAccess", "referencedDeclaration": 2531, "src": "2979:18:1", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2468_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2468_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 151, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2979:27:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 152, "nodeType": "ExpressionStatement", "src": "2979:27:1" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 154, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 144, "src": "3039:7:1", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 153, "name": "MaintainerRemoved", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 70, "src": "3021:17:1", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 155, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3021:26:1", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 156, "nodeType": "EmitStatement", "src": "3016:31:1" } ] }, "documentation": null, "id": 158, "implemented": true, "kind": "function", "modifiers": [], "name": "_removeMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 145, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 144, "name": "account", "nodeType": "VariableDeclaration", "scope": 158, "src": "2943:15:1", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 143, "name": "address", "nodeType": "ElementaryTypeName", "src": "2943:7:1", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2942:17:1" }, "returnParameters": { "id": 146, "nodeType": "ParameterList", "parameters": [], "src": "2969:0:1" }, "scope": 159, "src": "2915:139:1", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" } ], "scope": 160, "src": "1148:1908:1" } ], "src": "805:2252:1" }, "compiler": { "name": "solc", "version": "0.5.2+commit.1df8f40c.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.0.5", "updatedAt": "2019-06-04T10:01:11.419Z", "devdoc": { "methods": { "addMaintainer(address)": { "params": { "account": "The account to grant maintainer rights to." } }, "isMaintainer(address)": { "params": { "account": "The account to check." }, "return": "`true` if the account is maintainer, otherwise `false`." } } }, "userdoc": { "methods": { "addMaintainer(address)": { "notice": "Add a new maintainer to the list of maintainers." }, "constructor": "The constructor is internal (roles are managed by the OpenZeppelin base class).", "isMaintainer(address)": { "notice": "Check if the given address is currently a maintainer." }, "renounceMaintainer()": { "notice": "Give away maintainer rights." } }, "notice": "XBR Network (and XBR Network Proxies) SCs inherit from this base contract to manage network administration and maintenance via Role-based Access Control (RBAC). The implementation for management comes from the OpenZeppelin RBAC library." } }