1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521 |
- {
- "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"
- }
- ],
- "metadata": "",
- "bytecode": "0x",
- "deployedBytecode": "0x",
- "sourceMap": "",
- "deployedSourceMap": "",
- "source": "///////////////////////////////////////////////////////////////////////////////\n//\n// Copyright (C) 2018-2019 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/crossbario/xbr-protocol/contracts/XBRMaintained.sol",
- "ast": {
- "absolutePath": "/home/oberstet/scm/crossbario/xbr-protocol/contracts/XBRMaintained.sol",
- "exportedSymbols": {
- "XBRMaintained": [
- 762
- ]
- },
- "id": 763,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 661,
- "literals": [
- "solidity",
- "^",
- "0.5",
- ".2"
- ],
- "nodeType": "PragmaDirective",
- "src": "810:23:2"
- },
- {
- "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol",
- "file": "openzeppelin-solidity/contracts/access/Roles.sol",
- "id": 662,
- "nodeType": "ImportDirective",
- "scope": 763,
- "sourceUnit": 2910,
- "src": "835:58:2",
- "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": 762,
- "linearizedBaseContracts": [
- 762
- ],
- "name": "XBRMaintained",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "id": 665,
- "libraryName": {
- "contractScope": null,
- "id": 663,
- "name": "Roles",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2909,
- "src": "1221:5:2",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Roles_$2909",
- "typeString": "library Roles"
- }
- },
- "nodeType": "UsingForDirective",
- "src": "1215:27:2",
- "typeName": {
- "contractScope": null,
- "id": 664,
- "name": "Roles.Role",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2835,
- "src": "1231:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_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": 669,
- "name": "MaintainerAdded",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 668,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 667,
- "indexed": true,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 669,
- "src": "1407:23:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 666,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "1407:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "1406:25:2"
- },
- "src": "1385:47:2"
- },
- {
- "anonymous": false,
- "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.",
- "id": 673,
- "name": "MaintainerRemoved",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 672,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 671,
- "indexed": true,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 673,
- "src": "1603:23:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 670,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "1603:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "1602:25:2"
- },
- "src": "1579:49:2"
- },
- {
- "constant": false,
- "id": 675,
- "name": "maintainers",
- "nodeType": "VariableDeclaration",
- "scope": 762,
- "src": "1683:30:2",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role"
- },
- "typeName": {
- "contractScope": null,
- "id": 674,
- "name": "Roles.Role",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2835,
- "src": "1683:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage_ptr",
- "typeString": "struct Roles.Role"
- }
- },
- "value": null,
- "visibility": "private"
- },
- {
- "body": {
- "id": 683,
- "nodeType": "Block",
- "src": "1832:43:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 679,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "1857:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 680,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1857:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 678,
- "name": "_addMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 745,
- "src": "1842:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 681,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1842:26:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 682,
- "nodeType": "ExpressionStatement",
- "src": "1842:26:2"
- }
- ]
- },
- "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).",
- "id": 684,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 676,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1820:2:2"
- },
- "returnParameters": {
- "id": 677,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1832:0:2"
- },
- "scope": 762,
- "src": "1808:67:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- },
- {
- "body": {
- "id": 694,
- "nodeType": "Block",
- "src": "2001:61:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 688,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "2032:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 689,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "2032:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 687,
- "name": "isMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 708,
- "src": "2019:12:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
- "typeString": "function (address) view returns (bool)"
- }
- },
- "id": 690,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2019:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 686,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 3665,
- 3666
- ],
- "referencedDeclaration": 3665,
- "src": "2011:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 691,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2011:33:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 692,
- "nodeType": "ExpressionStatement",
- "src": "2011:33:2"
- },
- {
- "id": 693,
- "nodeType": "PlaceholderStatement",
- "src": "2054:1:2"
- }
- ]
- },
- "documentation": "Modifier to require maintainer-role for the sender when calling a SC.",
- "id": 695,
- "name": "onlyMaintainer",
- "nodeType": "ModifierDefinition",
- "parameters": {
- "id": 685,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1998:2:2"
- },
- "src": "1974:88:2",
- "visibility": "internal"
- },
- {
- "body": {
- "id": 707,
- "nodeType": "Block",
- "src": "2334:48:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 704,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 697,
- "src": "2367:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 702,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2351:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 703,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "has",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2908,
- "src": "2351:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)"
- }
- },
- "id": 705,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2351:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "functionReturnParameters": 701,
- "id": 706,
- "nodeType": "Return",
- "src": "2344:31:2"
- }
- ]
- },
- "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": 708,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "isMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 698,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 697,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 708,
- "src": "2290:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 696,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2290:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2289:17:2"
- },
- "returnParameters": {
- "id": 701,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 700,
- "name": "",
- "nodeType": "VariableDeclaration",
- "scope": 708,
- "src": "2328:4:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- },
- "typeName": {
- "id": 699,
- "name": "bool",
- "nodeType": "ElementaryTypeName",
- "src": "2328:4:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2327:6:2"
- },
- "scope": 762,
- "src": "2267:115:2",
- "stateMutability": "view",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 719,
- "nodeType": "Block",
- "src": "2595:40:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 716,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 710,
- "src": "2620:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 715,
- "name": "_addMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 745,
- "src": "2605:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 717,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2605:23:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 718,
- "nodeType": "ExpressionStatement",
- "src": "2605:23:2"
- }
- ]
- },
- "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.",
- "id": 720,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 713,
- "modifierName": {
- "argumentTypes": null,
- "id": 712,
- "name": "onlyMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 695,
- "src": "2580:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "2580:14:2"
- }
- ],
- "name": "addMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 711,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 710,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 720,
- "src": "2556:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 709,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2556:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2555:17:2"
- },
- "returnParameters": {
- "id": 714,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2595:0:2"
- },
- "scope": 762,
- "src": "2532:103:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 728,
- "nodeType": "Block",
- "src": "2731:46:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 724,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "2759:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 725,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "2759:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 723,
- "name": "_removeMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 761,
- "src": "2741:17:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 726,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2741:29:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 727,
- "nodeType": "ExpressionStatement",
- "src": "2741:29:2"
- }
- ]
- },
- "documentation": "Give away maintainer rights.",
- "id": 729,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "renounceMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 721,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2721:2:2"
- },
- "returnParameters": {
- "id": 722,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2731:0:2"
- },
- "scope": 762,
- "src": "2693:84:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 744,
- "nodeType": "Block",
- "src": "2834:80:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 737,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 731,
- "src": "2860:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 734,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2844:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 736,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "add",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2860,
- "src": "2844:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address)"
- }
- },
- "id": 738,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2844:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 739,
- "nodeType": "ExpressionStatement",
- "src": "2844:24:2"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 741,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 731,
- "src": "2899:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 740,
- "name": "MaintainerAdded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 669,
- "src": "2883:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 742,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2883:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 743,
- "nodeType": "EmitStatement",
- "src": "2878:29:2"
- }
- ]
- },
- "documentation": null,
- "id": 745,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "_addMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 732,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 731,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 745,
- "src": "2808:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 730,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2808:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2807:17:2"
- },
- "returnParameters": {
- "id": 733,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2834:0:2"
- },
- "scope": 762,
- "src": "2783:131:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- },
- {
- "body": {
- "id": 760,
- "nodeType": "Block",
- "src": "2974:85:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 753,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 747,
- "src": "3003:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 750,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2984:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 752,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "remove",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2884,
- "src": "2984:18:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address)"
- }
- },
- "id": 754,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2984:27:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 755,
- "nodeType": "ExpressionStatement",
- "src": "2984:27:2"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 757,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 747,
- "src": "3044:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 756,
- "name": "MaintainerRemoved",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 673,
- "src": "3026:17:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 758,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "3026:26:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 759,
- "nodeType": "EmitStatement",
- "src": "3021:31:2"
- }
- ]
- },
- "documentation": null,
- "id": 761,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "_removeMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 748,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 747,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 761,
- "src": "2948:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 746,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2948:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2947:17:2"
- },
- "returnParameters": {
- "id": 749,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2974:0:2"
- },
- "scope": 762,
- "src": "2920:139:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- }
- ],
- "scope": 763,
- "src": "1153:1908:2"
- }
- ],
- "src": "810:2252:2"
- },
- "legacyAST": {
- "absolutePath": "/home/oberstet/scm/crossbario/xbr-protocol/contracts/XBRMaintained.sol",
- "exportedSymbols": {
- "XBRMaintained": [
- 762
- ]
- },
- "id": 763,
- "nodeType": "SourceUnit",
- "nodes": [
- {
- "id": 661,
- "literals": [
- "solidity",
- "^",
- "0.5",
- ".2"
- ],
- "nodeType": "PragmaDirective",
- "src": "810:23:2"
- },
- {
- "absolutePath": "openzeppelin-solidity/contracts/access/Roles.sol",
- "file": "openzeppelin-solidity/contracts/access/Roles.sol",
- "id": 662,
- "nodeType": "ImportDirective",
- "scope": 763,
- "sourceUnit": 2910,
- "src": "835:58:2",
- "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": 762,
- "linearizedBaseContracts": [
- 762
- ],
- "name": "XBRMaintained",
- "nodeType": "ContractDefinition",
- "nodes": [
- {
- "id": 665,
- "libraryName": {
- "contractScope": null,
- "id": 663,
- "name": "Roles",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2909,
- "src": "1221:5:2",
- "typeDescriptions": {
- "typeIdentifier": "t_contract$_Roles_$2909",
- "typeString": "library Roles"
- }
- },
- "nodeType": "UsingForDirective",
- "src": "1215:27:2",
- "typeName": {
- "contractScope": null,
- "id": 664,
- "name": "Roles.Role",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2835,
- "src": "1231:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_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": 669,
- "name": "MaintainerAdded",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 668,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 667,
- "indexed": true,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 669,
- "src": "1407:23:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 666,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "1407:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "1406:25:2"
- },
- "src": "1385:47:2"
- },
- {
- "anonymous": false,
- "documentation": "Event fired when a maintainer was removed.\n * @param account The account that was removed as a maintainer.",
- "id": 673,
- "name": "MaintainerRemoved",
- "nodeType": "EventDefinition",
- "parameters": {
- "id": 672,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 671,
- "indexed": true,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 673,
- "src": "1603:23:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 670,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "1603:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "1602:25:2"
- },
- "src": "1579:49:2"
- },
- {
- "constant": false,
- "id": 675,
- "name": "maintainers",
- "nodeType": "VariableDeclaration",
- "scope": 762,
- "src": "1683:30:2",
- "stateVariable": true,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role"
- },
- "typeName": {
- "contractScope": null,
- "id": 674,
- "name": "Roles.Role",
- "nodeType": "UserDefinedTypeName",
- "referencedDeclaration": 2835,
- "src": "1683:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage_ptr",
- "typeString": "struct Roles.Role"
- }
- },
- "value": null,
- "visibility": "private"
- },
- {
- "body": {
- "id": 683,
- "nodeType": "Block",
- "src": "1832:43:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 679,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "1857:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 680,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "1857:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 678,
- "name": "_addMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 745,
- "src": "1842:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 681,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "1842:26:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 682,
- "nodeType": "ExpressionStatement",
- "src": "1842:26:2"
- }
- ]
- },
- "documentation": "The constructor is internal (roles are managed by the OpenZeppelin base class).",
- "id": 684,
- "implemented": true,
- "kind": "constructor",
- "modifiers": [],
- "name": "",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 676,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1820:2:2"
- },
- "returnParameters": {
- "id": 677,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1832:0:2"
- },
- "scope": 762,
- "src": "1808:67:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- },
- {
- "body": {
- "id": 694,
- "nodeType": "Block",
- "src": "2001:61:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 688,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "2032:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 689,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "2032:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 687,
- "name": "isMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 708,
- "src": "2019:12:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$",
- "typeString": "function (address) view returns (bool)"
- }
- },
- "id": 690,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2019:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- ],
- "id": 686,
- "name": "require",
- "nodeType": "Identifier",
- "overloadedDeclarations": [
- 3665,
- 3666
- ],
- "referencedDeclaration": 3665,
- "src": "2011:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
- "typeString": "function (bool) pure"
- }
- },
- "id": 691,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2011:33:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 692,
- "nodeType": "ExpressionStatement",
- "src": "2011:33:2"
- },
- {
- "id": 693,
- "nodeType": "PlaceholderStatement",
- "src": "2054:1:2"
- }
- ]
- },
- "documentation": "Modifier to require maintainer-role for the sender when calling a SC.",
- "id": 695,
- "name": "onlyMaintainer",
- "nodeType": "ModifierDefinition",
- "parameters": {
- "id": 685,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "1998:2:2"
- },
- "src": "1974:88:2",
- "visibility": "internal"
- },
- {
- "body": {
- "id": 707,
- "nodeType": "Block",
- "src": "2334:48:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 704,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 697,
- "src": "2367:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 702,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2351:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 703,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "has",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2908,
- "src": "2351:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_view$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)"
- }
- },
- "id": 705,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2351:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "functionReturnParameters": 701,
- "id": 706,
- "nodeType": "Return",
- "src": "2344:31:2"
- }
- ]
- },
- "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": 708,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "isMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 698,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 697,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 708,
- "src": "2290:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 696,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2290:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2289:17:2"
- },
- "returnParameters": {
- "id": 701,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 700,
- "name": "",
- "nodeType": "VariableDeclaration",
- "scope": 708,
- "src": "2328:4:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- },
- "typeName": {
- "id": 699,
- "name": "bool",
- "nodeType": "ElementaryTypeName",
- "src": "2328:4:2",
- "typeDescriptions": {
- "typeIdentifier": "t_bool",
- "typeString": "bool"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2327:6:2"
- },
- "scope": 762,
- "src": "2267:115:2",
- "stateMutability": "view",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 719,
- "nodeType": "Block",
- "src": "2595:40:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 716,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 710,
- "src": "2620:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 715,
- "name": "_addMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 745,
- "src": "2605:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 717,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2605:23:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 718,
- "nodeType": "ExpressionStatement",
- "src": "2605:23:2"
- }
- ]
- },
- "documentation": "Add a new maintainer to the list of maintainers.\n * @param account The account to grant maintainer rights to.",
- "id": 720,
- "implemented": true,
- "kind": "function",
- "modifiers": [
- {
- "arguments": null,
- "id": 713,
- "modifierName": {
- "argumentTypes": null,
- "id": 712,
- "name": "onlyMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 695,
- "src": "2580:14:2",
- "typeDescriptions": {
- "typeIdentifier": "t_modifier$__$",
- "typeString": "modifier ()"
- }
- },
- "nodeType": "ModifierInvocation",
- "src": "2580:14:2"
- }
- ],
- "name": "addMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 711,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 710,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 720,
- "src": "2556:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 709,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2556:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2555:17:2"
- },
- "returnParameters": {
- "id": 714,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2595:0:2"
- },
- "scope": 762,
- "src": "2532:103:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 728,
- "nodeType": "Block",
- "src": "2731:46:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "expression": {
- "argumentTypes": null,
- "id": 724,
- "name": "msg",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 3662,
- "src": "2759:3:2",
- "typeDescriptions": {
- "typeIdentifier": "t_magic_message",
- "typeString": "msg"
- }
- },
- "id": 725,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "sender",
- "nodeType": "MemberAccess",
- "referencedDeclaration": null,
- "src": "2759:10:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address_payable",
- "typeString": "address payable"
- }
- ],
- "id": 723,
- "name": "_removeMaintainer",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 761,
- "src": "2741:17:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 726,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2741:29:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 727,
- "nodeType": "ExpressionStatement",
- "src": "2741:29:2"
- }
- ]
- },
- "documentation": "Give away maintainer rights.",
- "id": 729,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "renounceMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 721,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2721:2:2"
- },
- "returnParameters": {
- "id": 722,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2731:0:2"
- },
- "scope": 762,
- "src": "2693:84:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "public"
- },
- {
- "body": {
- "id": 744,
- "nodeType": "Block",
- "src": "2834:80:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 737,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 731,
- "src": "2860:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 734,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2844:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 736,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "add",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2860,
- "src": "2844:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address)"
- }
- },
- "id": 738,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2844:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 739,
- "nodeType": "ExpressionStatement",
- "src": "2844:24:2"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 741,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 731,
- "src": "2899:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 740,
- "name": "MaintainerAdded",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 669,
- "src": "2883:15:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 742,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2883:24:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 743,
- "nodeType": "EmitStatement",
- "src": "2878:29:2"
- }
- ]
- },
- "documentation": null,
- "id": 745,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "_addMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 732,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 731,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 745,
- "src": "2808:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 730,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2808:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2807:17:2"
- },
- "returnParameters": {
- "id": 733,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2834:0:2"
- },
- "scope": 762,
- "src": "2783:131:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- },
- {
- "body": {
- "id": 760,
- "nodeType": "Block",
- "src": "2974:85:2",
- "statements": [
- {
- "expression": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 753,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 747,
- "src": "3003:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "expression": {
- "argumentTypes": null,
- "id": 750,
- "name": "maintainers",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 675,
- "src": "2984:11:2",
- "typeDescriptions": {
- "typeIdentifier": "t_struct$_Role_$2835_storage",
- "typeString": "struct Roles.Role storage ref"
- }
- },
- "id": 752,
- "isConstant": false,
- "isLValue": true,
- "isPure": false,
- "lValueRequested": false,
- "memberName": "remove",
- "nodeType": "MemberAccess",
- "referencedDeclaration": 2884,
- "src": "2984:18:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$2835_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$2835_storage_ptr_$",
- "typeString": "function (struct Roles.Role storage pointer,address)"
- }
- },
- "id": 754,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "2984:27:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 755,
- "nodeType": "ExpressionStatement",
- "src": "2984:27:2"
- },
- {
- "eventCall": {
- "argumentTypes": null,
- "arguments": [
- {
- "argumentTypes": null,
- "id": 757,
- "name": "account",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 747,
- "src": "3044:7:2",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- }
- ],
- "expression": {
- "argumentTypes": [
- {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- ],
- "id": 756,
- "name": "MaintainerRemoved",
- "nodeType": "Identifier",
- "overloadedDeclarations": [],
- "referencedDeclaration": 673,
- "src": "3026:17:2",
- "typeDescriptions": {
- "typeIdentifier": "t_function_event_nonpayable$_t_address_$returns$__$",
- "typeString": "function (address)"
- }
- },
- "id": 758,
- "isConstant": false,
- "isLValue": false,
- "isPure": false,
- "kind": "functionCall",
- "lValueRequested": false,
- "names": [],
- "nodeType": "FunctionCall",
- "src": "3026:26:2",
- "typeDescriptions": {
- "typeIdentifier": "t_tuple$__$",
- "typeString": "tuple()"
- }
- },
- "id": 759,
- "nodeType": "EmitStatement",
- "src": "3021:31:2"
- }
- ]
- },
- "documentation": null,
- "id": 761,
- "implemented": true,
- "kind": "function",
- "modifiers": [],
- "name": "_removeMaintainer",
- "nodeType": "FunctionDefinition",
- "parameters": {
- "id": 748,
- "nodeType": "ParameterList",
- "parameters": [
- {
- "constant": false,
- "id": 747,
- "name": "account",
- "nodeType": "VariableDeclaration",
- "scope": 761,
- "src": "2948:15:2",
- "stateVariable": false,
- "storageLocation": "default",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- },
- "typeName": {
- "id": 746,
- "name": "address",
- "nodeType": "ElementaryTypeName",
- "src": "2948:7:2",
- "stateMutability": "nonpayable",
- "typeDescriptions": {
- "typeIdentifier": "t_address",
- "typeString": "address"
- }
- },
- "value": null,
- "visibility": "internal"
- }
- ],
- "src": "2947:17:2"
- },
- "returnParameters": {
- "id": 749,
- "nodeType": "ParameterList",
- "parameters": [],
- "src": "2974:0:2"
- },
- "scope": 762,
- "src": "2920:139:2",
- "stateMutability": "nonpayable",
- "superFunction": null,
- "visibility": "internal"
- }
- ],
- "scope": 763,
- "src": "1153:1908:2"
- }
- ],
- "src": "810:2252:2"
- },
- "compiler": {
- "name": "solc",
- "version": "0.5.2+commit.1df8f40c.Emscripten.clang"
- },
- "networks": {},
- "schemaVersion": "3.0.16",
- "updatedAt": "2019-10-23T07:58:23.254Z",
- "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."
- }
- }
|