{ "contractName": "XBRMaintained", "abi": [ { "inputs": [], "payable": false, "stateMutability": "nonpayable", "type": "constructor" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" } ], "name": "MaintainerAdded", "type": "event" }, { "anonymous": false, "inputs": [ { "indexed": true, "internalType": "address", "name": "account", "type": "address" } ], "name": "MaintainerRemoved", "type": "event" }, { "constant": true, "inputs": [ { "internalType": "address", "name": "account", "type": "address" } ], "name": "isMaintainer", "outputs": [ { "internalType": "bool", "name": "", "type": "bool" } ], "payable": false, "stateMutability": "view", "type": "function" }, { "constant": false, "inputs": [ { "internalType": "address", "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" } ], "metadata": "{\"compiler\":{\"version\":\"0.5.16+commit.9c3226ce\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MaintainerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"MaintainerRemoved\",\"type\":\"event\"},{\"constant\":false,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"addMaintainer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"constant\":true,\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"isMaintainer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"payable\":false,\"stateMutability\":\"view\",\"type\":\"function\"},{\"constant\":false,\"inputs\":[],\"name\":\"renounceMaintainer\",\"outputs\":[],\"payable\":false,\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"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.\"}},\"settings\":{\"compilationTarget\":{\"/home/travis/build/crossbario/xbr-protocol/contracts/XBRMaintained.sol\":\"XBRMaintained\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/travis/build/crossbario/xbr-protocol/contracts/XBRMaintained.sol\":{\"keccak256\":\"0x2d3c274d75b270759fd8d6822d0690595cdae6d3878abc7eb33c3d19ce358dfe\",\"urls\":[\"bzz-raw://f5995d408d9a328f36a76e9c9e09828a0ff114757f7c25650944367bcd403389\",\"dweb:/ipfs/QmPNqFpo6x9pF7xkC28eEyTqAcT9WwTvUYsVEKbTVywqs3\"]},\"openzeppelin-solidity/contracts/access/Roles.sol\":{\"keccak256\":\"0xb002c378d7b82a101bd659c341518953ca0919d342c0a400196982c0e7e7bcdb\",\"urls\":[\"bzz-raw://00a788c4631466c220b385bdd100c571d24b2deccd657615cfbcef6cadf669a4\",\"dweb:/ipfs/QmTEwDbjJNxmMNCDMqtuou3dyM8Wtp8Q9NFvn7SAVM7Jf3\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "sourceMap": "", "deployedSourceMap": "", "source": "///////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (C) 2018-2020 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.12;\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/travis/build/crossbario/xbr-protocol/contracts/XBRMaintained.sol", "ast": { "absolutePath": "/home/travis/build/crossbario/xbr-protocol/contracts/XBRMaintained.sol", "exportedSymbols": { "XBRMaintained": [ 1729 ] }, "id": 1730, "nodeType": "SourceUnit", "nodes": [ { "id": 1628, "literals": [ "solidity", "^", "0.5", ".12" ], "nodeType": "PragmaDirective", "src": "810:24:3" }, { "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol", "file": "openzeppelin-solidity/contracts/access/Roles.sol", "id": 1629, "nodeType": "ImportDirective", "scope": 1730, "sourceUnit": 5534, "src": "836:58:3", "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": 1729, "linearizedBaseContracts": [ 1729 ], "name": "XBRMaintained", "nodeType": "ContractDefinition", "nodes": [ { "id": 1632, "libraryName": { "contractScope": null, "id": 1630, "name": "Roles", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5533, "src": "1222:5:3", "typeDescriptions": { "typeIdentifier": "t_contract$_Roles_$5533", "typeString": "library Roles" } }, "nodeType": "UsingForDirective", "src": "1216:27:3", "typeName": { "contractScope": null, "id": 1631, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5459, "src": "1232:10:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_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": 1636, "name": "MaintainerAdded", "nodeType": "EventDefinition", "parameters": { "id": 1635, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1634, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 1636, "src": "1408:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1633, "name": "address", "nodeType": "ElementaryTypeName", "src": "1408:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1407:25:3" }, "src": "1386:47:3" }, { "anonymous": false, "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.", "id": 1640, "name": "MaintainerRemoved", "nodeType": "EventDefinition", "parameters": { "id": 1639, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1638, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 1640, "src": "1604:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1637, "name": "address", "nodeType": "ElementaryTypeName", "src": "1604:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1603:25:3" }, "src": "1580:49:3" }, { "constant": false, "id": 1642, "name": "maintainers", "nodeType": "VariableDeclaration", "scope": 1729, "src": "1684:30:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role" }, "typeName": { "contractScope": null, "id": 1641, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5459, "src": "1684:10:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage_ptr", "typeString": "struct Roles.Role" } }, "value": null, "visibility": "private" }, { "body": { "id": 1650, "nodeType": "Block", "src": "1833:43:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1646, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "1858:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1647, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1858:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1645, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1712, "src": "1843:14:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1648, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1843:26:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1649, "nodeType": "ExpressionStatement", "src": "1843:26:3" } ] }, "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).", "id": 1651, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1643, "nodeType": "ParameterList", "parameters": [], "src": "1821:2:3" }, "returnParameters": { "id": 1644, "nodeType": "ParameterList", "parameters": [], "src": "1833:0:3" }, "scope": 1729, "src": "1809:67:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1661, "nodeType": "Block", "src": "2002:61:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1655, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "2033:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1656, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2033:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1654, "name": "isMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1675, "src": "2020:12:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 1657, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2020:24:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 1653, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6351, "src": "2012:7:3", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 1658, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2012:33:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1659, "nodeType": "ExpressionStatement", "src": "2012:33:3" }, { "id": 1660, "nodeType": "PlaceholderStatement", "src": "2055:1:3" } ] }, "documentation": "Modifier to require maintainer-role for the sender when calling a SC.", "id": 1662, "name": "onlyMaintainer", "nodeType": "ModifierDefinition", "parameters": { "id": 1652, "nodeType": "ParameterList", "parameters": [], "src": "1999:2:3" }, "src": "1975:88:3", "visibility": "internal" }, { "body": { "id": 1674, "nodeType": "Block", "src": "2335:48:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1671, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1664, "src": "2368:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1669, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2352:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1670, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "has", "nodeType": "MemberAccess", "referencedDeclaration": 5532, "src": "2352:15:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)" } }, "id": 1672, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2352:24:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 1668, "id": 1673, "nodeType": "Return", "src": "2345:31:3" } ] }, "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": 1675, "implemented": true, "kind": "function", "modifiers": [], "name": "isMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1665, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1664, "name": "account", "nodeType": "VariableDeclaration", "scope": 1675, "src": "2291:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1663, "name": "address", "nodeType": "ElementaryTypeName", "src": "2291:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2290:17:3" }, "returnParameters": { "id": 1668, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1667, "name": "", "nodeType": "VariableDeclaration", "scope": 1675, "src": "2329:4:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1666, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2329:4:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "2328:6:3" }, "scope": 1729, "src": "2268:115:3", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 1686, "nodeType": "Block", "src": "2596:40:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1683, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1677, "src": "2621:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1682, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1712, "src": "2606:14:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2606:23:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1685, "nodeType": "ExpressionStatement", "src": "2606:23:3" } ] }, "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.", "id": 1687, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 1680, "modifierName": { "argumentTypes": null, "id": 1679, "name": "onlyMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1662, "src": "2581:14:3", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2581:14:3" } ], "name": "addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1678, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1677, "name": "account", "nodeType": "VariableDeclaration", "scope": 1687, "src": "2557:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1676, "name": "address", "nodeType": "ElementaryTypeName", "src": "2557:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2556:17:3" }, "returnParameters": { "id": 1681, "nodeType": "ParameterList", "parameters": [], "src": "2596:0:3" }, "scope": 1729, "src": "2533:103:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1695, "nodeType": "Block", "src": "2732:46:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1691, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "2760:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1692, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2760:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1690, "name": "_removeMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1728, "src": "2742:17:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1693, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2742:29:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1694, "nodeType": "ExpressionStatement", "src": "2742:29:3" } ] }, "documentation": "Give away maintainer rights.", "id": 1696, "implemented": true, "kind": "function", "modifiers": [], "name": "renounceMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1688, "nodeType": "ParameterList", "parameters": [], "src": "2722:2:3" }, "returnParameters": { "id": 1689, "nodeType": "ParameterList", "parameters": [], "src": "2732:0:3" }, "scope": 1729, "src": "2694:84:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1711, "nodeType": "Block", "src": "2835:80:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1704, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1698, "src": "2861:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1701, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2845:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1703, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 5484, "src": "2845:15:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 1705, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2845:24:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1706, "nodeType": "ExpressionStatement", "src": "2845:24:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1708, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1698, "src": "2900:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1707, "name": "MaintainerAdded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1636, "src": "2884:15:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1709, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2884:24:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1710, "nodeType": "EmitStatement", "src": "2879:29:3" } ] }, "documentation": null, "id": 1712, "implemented": true, "kind": "function", "modifiers": [], "name": "_addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1699, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1698, "name": "account", "nodeType": "VariableDeclaration", "scope": 1712, "src": "2809:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1697, "name": "address", "nodeType": "ElementaryTypeName", "src": "2809:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2808:17:3" }, "returnParameters": { "id": 1700, "nodeType": "ParameterList", "parameters": [], "src": "2835:0:3" }, "scope": 1729, "src": "2784:131:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1727, "nodeType": "Block", "src": "2975:85:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1720, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1714, "src": "3004:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1717, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2985:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1719, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remove", "nodeType": "MemberAccess", "referencedDeclaration": 5508, "src": "2985:18:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 1721, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2985:27:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1722, "nodeType": "ExpressionStatement", "src": "2985:27:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1724, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1714, "src": "3045:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1723, "name": "MaintainerRemoved", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1640, "src": "3027:17:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1725, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3027:26:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1726, "nodeType": "EmitStatement", "src": "3022:31:3" } ] }, "documentation": null, "id": 1728, "implemented": true, "kind": "function", "modifiers": [], "name": "_removeMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1715, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1714, "name": "account", "nodeType": "VariableDeclaration", "scope": 1728, "src": "2949:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1713, "name": "address", "nodeType": "ElementaryTypeName", "src": "2949:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2948:17:3" }, "returnParameters": { "id": 1716, "nodeType": "ParameterList", "parameters": [], "src": "2975:0:3" }, "scope": 1729, "src": "2921:139:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" } ], "scope": 1730, "src": "1154:1908:3" } ], "src": "810:2253:3" }, "legacyAST": { "absolutePath": "/home/travis/build/crossbario/xbr-protocol/contracts/XBRMaintained.sol", "exportedSymbols": { "XBRMaintained": [ 1729 ] }, "id": 1730, "nodeType": "SourceUnit", "nodes": [ { "id": 1628, "literals": [ "solidity", "^", "0.5", ".12" ], "nodeType": "PragmaDirective", "src": "810:24:3" }, { "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol", "file": "openzeppelin-solidity/contracts/access/Roles.sol", "id": 1629, "nodeType": "ImportDirective", "scope": 1730, "sourceUnit": 5534, "src": "836:58:3", "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": 1729, "linearizedBaseContracts": [ 1729 ], "name": "XBRMaintained", "nodeType": "ContractDefinition", "nodes": [ { "id": 1632, "libraryName": { "contractScope": null, "id": 1630, "name": "Roles", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5533, "src": "1222:5:3", "typeDescriptions": { "typeIdentifier": "t_contract$_Roles_$5533", "typeString": "library Roles" } }, "nodeType": "UsingForDirective", "src": "1216:27:3", "typeName": { "contractScope": null, "id": 1631, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5459, "src": "1232:10:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_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": 1636, "name": "MaintainerAdded", "nodeType": "EventDefinition", "parameters": { "id": 1635, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1634, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 1636, "src": "1408:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1633, "name": "address", "nodeType": "ElementaryTypeName", "src": "1408:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1407:25:3" }, "src": "1386:47:3" }, { "anonymous": false, "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.", "id": 1640, "name": "MaintainerRemoved", "nodeType": "EventDefinition", "parameters": { "id": 1639, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1638, "indexed": true, "name": "account", "nodeType": "VariableDeclaration", "scope": 1640, "src": "1604:23:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1637, "name": "address", "nodeType": "ElementaryTypeName", "src": "1604:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "1603:25:3" }, "src": "1580:49:3" }, { "constant": false, "id": 1642, "name": "maintainers", "nodeType": "VariableDeclaration", "scope": 1729, "src": "1684:30:3", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role" }, "typeName": { "contractScope": null, "id": 1641, "name": "Roles.Role", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 5459, "src": "1684:10:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage_ptr", "typeString": "struct Roles.Role" } }, "value": null, "visibility": "private" }, { "body": { "id": 1650, "nodeType": "Block", "src": "1833:43:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1646, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "1858:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1647, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1858:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1645, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1712, "src": "1843:14:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1648, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1843:26:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1649, "nodeType": "ExpressionStatement", "src": "1843:26:3" } ] }, "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).", "id": 1651, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "parameters": { "id": 1643, "nodeType": "ParameterList", "parameters": [], "src": "1821:2:3" }, "returnParameters": { "id": 1644, "nodeType": "ParameterList", "parameters": [], "src": "1833:0:3" }, "scope": 1729, "src": "1809:67:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1661, "nodeType": "Block", "src": "2002:61:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1655, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "2033:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1656, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2033:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1654, "name": "isMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1675, "src": "2020:12:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 1657, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2020:24:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" } ], "id": 1653, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 6351, 6352 ], "referencedDeclaration": 6351, "src": "2012:7:3", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$", "typeString": "function (bool) pure" } }, "id": 1658, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2012:33:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1659, "nodeType": "ExpressionStatement", "src": "2012:33:3" }, { "id": 1660, "nodeType": "PlaceholderStatement", "src": "2055:1:3" } ] }, "documentation": "Modifier to require maintainer-role for the sender when calling a SC.", "id": 1662, "name": "onlyMaintainer", "nodeType": "ModifierDefinition", "parameters": { "id": 1652, "nodeType": "ParameterList", "parameters": [], "src": "1999:2:3" }, "src": "1975:88:3", "visibility": "internal" }, { "body": { "id": 1674, "nodeType": "Block", "src": "2335:48:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1671, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1664, "src": "2368:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1669, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2352:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1670, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "has", "nodeType": "MemberAccess", "referencedDeclaration": 5532, "src": "2352:15:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)" } }, "id": 1672, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2352:24:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 1668, "id": 1673, "nodeType": "Return", "src": "2345:31:3" } ] }, "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": 1675, "implemented": true, "kind": "function", "modifiers": [], "name": "isMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1665, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1664, "name": "account", "nodeType": "VariableDeclaration", "scope": 1675, "src": "2291:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1663, "name": "address", "nodeType": "ElementaryTypeName", "src": "2291:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2290:17:3" }, "returnParameters": { "id": 1668, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1667, "name": "", "nodeType": "VariableDeclaration", "scope": 1675, "src": "2329:4:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1666, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2329:4:3", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "2328:6:3" }, "scope": 1729, "src": "2268:115:3", "stateMutability": "view", "superFunction": null, "visibility": "public" }, { "body": { "id": 1686, "nodeType": "Block", "src": "2596:40:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1683, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1677, "src": "2621:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1682, "name": "_addMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1712, "src": "2606:14:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1684, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2606:23:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1685, "nodeType": "ExpressionStatement", "src": "2606:23:3" } ] }, "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.", "id": 1687, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 1680, "modifierName": { "argumentTypes": null, "id": 1679, "name": "onlyMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1662, "src": "2581:14:3", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "2581:14:3" } ], "name": "addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1678, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1677, "name": "account", "nodeType": "VariableDeclaration", "scope": 1687, "src": "2557:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1676, "name": "address", "nodeType": "ElementaryTypeName", "src": "2557:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2556:17:3" }, "returnParameters": { "id": 1681, "nodeType": "ParameterList", "parameters": [], "src": "2596:0:3" }, "scope": 1729, "src": "2533:103:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1695, "nodeType": "Block", "src": "2732:46:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 1691, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 6348, "src": "2760:3:3", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 1692, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "2760:10:3", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 1690, "name": "_removeMaintainer", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1728, "src": "2742:17:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1693, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2742:29:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1694, "nodeType": "ExpressionStatement", "src": "2742:29:3" } ] }, "documentation": "Give away maintainer rights.", "id": 1696, "implemented": true, "kind": "function", "modifiers": [], "name": "renounceMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1688, "nodeType": "ParameterList", "parameters": [], "src": "2722:2:3" }, "returnParameters": { "id": 1689, "nodeType": "ParameterList", "parameters": [], "src": "2732:0:3" }, "scope": 1729, "src": "2694:84:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "public" }, { "body": { "id": 1711, "nodeType": "Block", "src": "2835:80:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1704, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1698, "src": "2861:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1701, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2845:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1703, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "add", "nodeType": "MemberAccess", "referencedDeclaration": 5484, "src": "2845:15:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 1705, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2845:24:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1706, "nodeType": "ExpressionStatement", "src": "2845:24:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1708, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1698, "src": "2900:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1707, "name": "MaintainerAdded", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1636, "src": "2884:15:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1709, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2884:24:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1710, "nodeType": "EmitStatement", "src": "2879:29:3" } ] }, "documentation": null, "id": 1712, "implemented": true, "kind": "function", "modifiers": [], "name": "_addMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1699, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1698, "name": "account", "nodeType": "VariableDeclaration", "scope": 1712, "src": "2809:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1697, "name": "address", "nodeType": "ElementaryTypeName", "src": "2809:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2808:17:3" }, "returnParameters": { "id": 1700, "nodeType": "ParameterList", "parameters": [], "src": "2835:0:3" }, "scope": 1729, "src": "2784:131:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" }, { "body": { "id": 1727, "nodeType": "Block", "src": "2975:85:3", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1720, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1714, "src": "3004:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "argumentTypes": null, "id": 1717, "name": "maintainers", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1642, "src": "2985:11:3", "typeDescriptions": { "typeIdentifier": "t_struct$_Role_$5459_storage", "typeString": "struct Roles.Role storage ref" } }, "id": 1719, "isConstant": false, "isLValue": true, "isPure": false, "lValueRequested": false, "memberName": "remove", "nodeType": "MemberAccess", "referencedDeclaration": 5508, "src": "2985:18:3", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$5459_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$5459_storage_ptr_$", "typeString": "function (struct Roles.Role storage pointer,address)" } }, "id": 1721, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2985:27:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1722, "nodeType": "ExpressionStatement", "src": "2985:27:3" }, { "eventCall": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 1724, "name": "account", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1714, "src": "3045:7:3", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "id": 1723, "name": "MaintainerRemoved", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1640, "src": "3027:17:3", "typeDescriptions": { "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$", "typeString": "function (address)" } }, "id": 1725, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3027:26:3", "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1726, "nodeType": "EmitStatement", "src": "3022:31:3" } ] }, "documentation": null, "id": 1728, "implemented": true, "kind": "function", "modifiers": [], "name": "_removeMaintainer", "nodeType": "FunctionDefinition", "parameters": { "id": 1715, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1714, "name": "account", "nodeType": "VariableDeclaration", "scope": 1728, "src": "2949:15:3", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" }, "typeName": { "id": 1713, "name": "address", "nodeType": "ElementaryTypeName", "src": "2949:7:3", "stateMutability": "nonpayable", "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } }, "value": null, "visibility": "internal" } ], "src": "2948:17:3" }, "returnParameters": { "id": 1716, "nodeType": "ParameterList", "parameters": [], "src": "2975:0:3" }, "scope": 1729, "src": "2921:139:3", "stateMutability": "nonpayable", "superFunction": null, "visibility": "internal" } ], "scope": 1730, "src": "1154:1908:3" } ], "src": "810:2253:3" }, "compiler": { "name": "solc", "version": "0.5.16+commit.9c3226ce.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.1.0", "updatedAt": "2020-04-13T15:29:57.167Z", "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." } }