@dnextco/tokenboost-solidity-erc223token
Version:
Solidity contracts for TokenBoost (ERC223Token)
1,140 lines • 112 kB
JSON
{
"contractName": "RBAC",
"abi": [
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "operator",
"type": "address"
},
{
"indexed": false,
"name": "role",
"type": "string"
}
],
"name": "RoleAdded",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "operator",
"type": "address"
},
{
"indexed": false,
"name": "role",
"type": "string"
}
],
"name": "RoleRemoved",
"type": "event"
},
{
"constant": true,
"inputs": [
{
"name": "_operator",
"type": "address"
},
{
"name": "_role",
"type": "string"
}
],
"name": "checkRole",
"outputs": [],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "_operator",
"type": "address"
},
{
"name": "_role",
"type": "string"
}
],
"name": "hasRole",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x608060405234801561001057600080fd5b5061029c806100206000396000f30060806040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c8114610050578063217fe6c6146100c6575b600080fd5b34801561005c57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526100c495833573ffffffffffffffffffffffffffffffffffffffff1695369560449491939091019190819084018382808284375094975061014e9650505050505050565b005b3480156100d257600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261013a95833573ffffffffffffffffffffffffffffffffffffffff169536956044949193909101919081908401838280828437509497506101bc9650505050505050565b604080519115158252519081900360200190f35b6101b8826000836040518082805190602001908083835b602083106101845780518252601f199092019160209182019101610165565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061022f565b5050565b6000610228836000846040518082805190602001908083835b602083106101f45780518252601f1990920191602091820191016101d5565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610244565b9392505050565b6102398282610244565b15156101b857600080fd5b73ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff16905600a165627a7a723058209fe3ba5cfeb5ae3c338fb459dabdff8840e37062612f9f1613e81699f7b6d14c0029",
"deployedBytecode": "0x60806040526004361061004b5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c8114610050578063217fe6c6146100c6575b600080fd5b34801561005c57600080fd5b5060408051602060046024803582810135601f81018590048502860185019096528585526100c495833573ffffffffffffffffffffffffffffffffffffffff1695369560449491939091019190819084018382808284375094975061014e9650505050505050565b005b3480156100d257600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261013a95833573ffffffffffffffffffffffffffffffffffffffff169536956044949193909101919081908401838280828437509497506101bc9650505050505050565b604080519115158252519081900360200190f35b6101b8826000836040518082805190602001908083835b602083106101845780518252601f199092019160209182019101610165565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092209291505061022f565b5050565b6000610228836000846040518082805190602001908083835b602083106101f45780518252601f1990920191602091820191016101d5565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610244565b9392505050565b6102398282610244565b15156101b857600080fd5b73ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff16905600a165627a7a723058209fe3ba5cfeb5ae3c338fb459dabdff8840e37062612f9f1613e81699f7b6d14c0029",
"sourceMap": "478:2158:37:-;;;;8:9:-1;5:2;;;30:1;27;20:12;5:2;478:2158:37;;;;;;;",
"deployedSourceMap": "478:2158:37:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;837:114;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;837:114:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;837:114:37;;-1:-1:-1;837:114:37;;-1:-1:-1;;;;;;;837:114:37;;;1091:136;;8:9:-1;5:2;;;30:1;27;20:12;5:2;-1:-1;1091:136:37;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;1091:136:37;;-1:-1:-1;1091:136:37;;-1:-1:-1;;;;;;;1091:136:37;;;;;;;;;;;;;;;;;;;837:114;917:29;936:9;917:5;923;917:12;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;917:12:37;;;;;-1:-1:-1;917:12:37;;;;;;;;;;;;-1:-1:-1;;917:18:37;:29::i;:::-;837:114;;:::o;1091:136::-;1174:4;1195:27;1212:9;1195:5;1201;1195:12;;;;;;;;;;;;;36:153:-1;66:2;58:11;;36:153;;176:10;;164:23;;-1:-1;;139:12;;;;98:2;89:12;;;;114;36:153;;;299:10;344;;263:2;259:12;;;254:3;250:22;-1:-1;;246:30;311:9;;295:26;;;340:21;;377:20;365:33;;1195:12:37;;;;;-1:-1:-1;1195:12:37;;;;;;;;;;;;-1:-1:-1;;1195:16:37;:27::i;:::-;1188:34;1091:136;-1:-1:-1;;;1091:136:37:o;666:111:38:-;754:17;758:5;765;754:3;:17::i;:::-;746:26;;;;;;;855:128;959:19;;938:4;959:19;;;;;;;;;;;;;;;855:128::o",
"source": "pragma solidity ^0.4.24;\n\nimport \"./Roles.sol\";\n\n\n/**\n * @title RBAC (Role-Based Access Control)\n * @author Matt Condon (@Shrugs)\n * @dev Stores and provides setters and getters for roles and addresses.\n * Supports unlimited numbers of roles and addresses.\n * See //contracts/mocks/RBACMock.sol for an example of usage.\n * This RBAC method uses strings to key roles. It may be beneficial\n * for you to write your own implementation of this interface using Enums or similar.\n */\ncontract RBAC {\n using Roles for Roles.Role;\n\n mapping (string => Roles.Role) private roles;\n\n event RoleAdded(address indexed operator, string role);\n event RoleRemoved(address indexed operator, string role);\n\n /**\n * @dev reverts if addr does not have role\n * @param _operator address\n * @param _role the name of the role\n * // reverts\n */\n function checkRole(address _operator, string _role)\n public\n view\n {\n roles[_role].check(_operator);\n }\n\n /**\n * @dev determine if addr has role\n * @param _operator address\n * @param _role the name of the role\n * @return bool\n */\n function hasRole(address _operator, string _role)\n public\n view\n returns (bool)\n {\n return roles[_role].has(_operator);\n }\n\n /**\n * @dev add a role to an address\n * @param _operator address\n * @param _role the name of the role\n */\n function addRole(address _operator, string _role)\n internal\n {\n roles[_role].add(_operator);\n emit RoleAdded(_operator, _role);\n }\n\n /**\n * @dev remove a role from an address\n * @param _operator address\n * @param _role the name of the role\n */\n function removeRole(address _operator, string _role)\n internal\n {\n roles[_role].remove(_operator);\n emit RoleRemoved(_operator, _role);\n }\n\n /**\n * @dev modifier to scope access to a single role (uses msg.sender as addr)\n * @param _role the name of the role\n * // reverts\n */\n modifier onlyRole(string _role)\n {\n checkRole(msg.sender, _role);\n _;\n }\n\n /**\n * @dev modifier to scope access to a set of roles (uses msg.sender as addr)\n * @param _roles the names of the roles to scope access to\n * // reverts\n *\n * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this\n * see: https://github.com/ethereum/solidity/issues/2467\n */\n // modifier onlyRoles(string[] _roles) {\n // bool hasAnyRole = false;\n // for (uint8 i = 0; i < _roles.length; i++) {\n // if (hasRole(msg.sender, _roles[i])) {\n // hasAnyRole = true;\n // break;\n // }\n // }\n\n // require(hasAnyRole);\n\n // _;\n // }\n}\n",
"sourcePath": "zeppelin-solidity/contracts/access/rbac/RBAC.sol",
"ast": {
"absolutePath": "zeppelin-solidity/contracts/access/rbac/RBAC.sol",
"exportedSymbols": {
"RBAC": [
6531
]
},
"id": 6532,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 6426,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:37"
},
{
"absolutePath": "zeppelin-solidity/contracts/access/rbac/Roles.sol",
"file": "./Roles.sol",
"id": 6427,
"nodeType": "ImportDirective",
"scope": 6532,
"sourceUnit": 6602,
"src": "26:21:37",
"symbolAliases": [],
"unitAlias": ""
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "contract",
"documentation": "@title RBAC (Role-Based Access Control)\n@author Matt Condon (@Shrugs)\n@dev Stores and provides setters and getters for roles and addresses.\nSupports unlimited numbers of roles and addresses.\nSee //contracts/mocks/RBACMock.sol for an example of usage.\nThis RBAC method uses strings to key roles. It may be beneficial\nfor you to write your own implementation of this interface using Enums or similar.",
"fullyImplemented": true,
"id": 6531,
"linearizedBaseContracts": [
6531
],
"name": "RBAC",
"nodeType": "ContractDefinition",
"nodes": [
{
"id": 6430,
"libraryName": {
"contractScope": null,
"id": 6428,
"name": "Roles",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6601,
"src": "502:5:37",
"typeDescriptions": {
"typeIdentifier": "t_contract$_Roles_$6601",
"typeString": "library Roles"
}
},
"nodeType": "UsingForDirective",
"src": "496:27:37",
"typeName": {
"contractScope": null,
"id": 6429,
"name": "Roles.Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6538,
"src": "512:10:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage_ptr",
"typeString": "struct Roles.Role"
}
}
},
{
"constant": false,
"id": 6434,
"name": "roles",
"nodeType": "VariableDeclaration",
"scope": 6531,
"src": "527:44:37",
"stateVariable": true,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string => struct Roles.Role)"
},
"typeName": {
"id": 6433,
"keyType": {
"id": 6431,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "536:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"nodeType": "Mapping",
"src": "527:30:37",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string => struct Roles.Role)"
},
"valueType": {
"contractScope": null,
"id": 6432,
"name": "Roles.Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 6538,
"src": "546:10:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage_ptr",
"typeString": "struct Roles.Role"
}
}
},
"value": null,
"visibility": "private"
},
{
"anonymous": false,
"documentation": null,
"id": 6440,
"name": "RoleAdded",
"nodeType": "EventDefinition",
"parameters": {
"id": 6439,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6436,
"indexed": true,
"name": "operator",
"nodeType": "VariableDeclaration",
"scope": 6440,
"src": "592:24:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6435,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "592:7:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6438,
"indexed": false,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 6440,
"src": "618:11:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6437,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "618:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "591:39:37"
},
"src": "576:55:37"
},
{
"anonymous": false,
"documentation": null,
"id": 6446,
"name": "RoleRemoved",
"nodeType": "EventDefinition",
"parameters": {
"id": 6445,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6442,
"indexed": true,
"name": "operator",
"nodeType": "VariableDeclaration",
"scope": 6446,
"src": "652:24:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6441,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "652:7:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6444,
"indexed": false,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 6446,
"src": "678:11:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6443,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "678:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "651:39:37"
},
"src": "634:57:37"
},
{
"body": {
"id": 6460,
"nodeType": "Block",
"src": "911:40:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6457,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6448,
"src": "936:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6453,
"name": "roles",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6434,
"src": "917:5:37",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string memory => struct Roles.Role storage ref)"
}
},
"id": 6455,
"indexExpression": {
"argumentTypes": null,
"id": 6454,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6450,
"src": "923:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "917:12:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage",
"typeString": "struct Roles.Role storage ref"
}
},
"id": 6456,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "check",
"nodeType": "MemberAccess",
"referencedDeclaration": 6585,
"src": "917:18:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_struct$_Role_$6538_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$6538_storage_ptr_$",
"typeString": "function (struct Roles.Role storage pointer,address) view"
}
},
"id": 6458,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "917:29:37",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6459,
"nodeType": "ExpressionStatement",
"src": "917:29:37"
}
]
},
"documentation": "@dev reverts if addr does not have role\n@param _operator address\n@param _role the name of the role\n// reverts",
"id": 6461,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "checkRole",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6451,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6448,
"name": "_operator",
"nodeType": "VariableDeclaration",
"scope": 6461,
"src": "856:17:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6447,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "856:7:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6450,
"name": "_role",
"nodeType": "VariableDeclaration",
"scope": 6461,
"src": "875:12:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6449,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "875:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "855:33:37"
},
"payable": false,
"returnParameters": {
"id": 6452,
"nodeType": "ParameterList",
"parameters": [],
"src": "911:0:37"
},
"scope": 6531,
"src": "837:114:37",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 6477,
"nodeType": "Block",
"src": "1182:45:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6474,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6463,
"src": "1212:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6470,
"name": "roles",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6434,
"src": "1195:5:37",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string memory => struct Roles.Role storage ref)"
}
},
"id": 6472,
"indexExpression": {
"argumentTypes": null,
"id": 6471,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6465,
"src": "1201:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1195:12:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage",
"typeString": "struct Roles.Role storage ref"
}
},
"id": 6473,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "has",
"nodeType": "MemberAccess",
"referencedDeclaration": 6600,
"src": "1195:16:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_struct$_Role_$6538_storage_ptr_$_t_address_$returns$_t_bool_$bound_to$_t_struct$_Role_$6538_storage_ptr_$",
"typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)"
}
},
"id": 6475,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1195:27:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 6469,
"id": 6476,
"nodeType": "Return",
"src": "1188:34:37"
}
]
},
"documentation": "@dev determine if addr has role\n@param _operator address\n@param _role the name of the role\n@return bool",
"id": 6478,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "hasRole",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6466,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6463,
"name": "_operator",
"nodeType": "VariableDeclaration",
"scope": 6478,
"src": "1108:17:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6462,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1108:7:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6465,
"name": "_role",
"nodeType": "VariableDeclaration",
"scope": 6478,
"src": "1127:12:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6464,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1127:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1107:33:37"
},
"payable": false,
"returnParameters": {
"id": 6469,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6468,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 6478,
"src": "1174:4:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 6467,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "1174:4:37",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1173:6:37"
},
"scope": 6531,
"src": "1091:136:37",
"stateMutability": "view",
"superFunction": null,
"visibility": "public"
},
{
"body": {
"id": 6497,
"nodeType": "Block",
"src": "1412:76:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6489,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6480,
"src": "1435:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6485,
"name": "roles",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6434,
"src": "1418:5:37",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string memory => struct Roles.Role storage ref)"
}
},
"id": 6487,
"indexExpression": {
"argumentTypes": null,
"id": 6486,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6482,
"src": "1424:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1418:12:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage",
"typeString": "struct Roles.Role storage ref"
}
},
"id": 6488,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "add",
"nodeType": "MemberAccess",
"referencedDeclaration": 6554,
"src": "1418:16:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$6538_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$6538_storage_ptr_$",
"typeString": "function (struct Roles.Role storage pointer,address)"
}
},
"id": 6490,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1418:27:37",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6491,
"nodeType": "ExpressionStatement",
"src": "1418:27:37"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6493,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6480,
"src": "1466:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 6494,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6482,
"src": "1477:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
],
"id": 6492,
"name": "RoleAdded",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6440,
"src": "1456:9:37",
"typeDescriptions": {
"typeIdentifier": "t_function_event_nonpayable$_t_address_$_t_string_memory_ptr_$returns$__$",
"typeString": "function (address,string memory)"
}
},
"id": 6495,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1456:27:37",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6496,
"nodeType": "EmitStatement",
"src": "1451:32:37"
}
]
},
"documentation": "@dev add a role to an address\n@param _operator address\n@param _role the name of the role",
"id": 6498,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "addRole",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 6483,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 6480,
"name": "_operator",
"nodeType": "VariableDeclaration",
"scope": 6498,
"src": "1364:17:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 6479,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "1364:7:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 6482,
"name": "_role",
"nodeType": "VariableDeclaration",
"scope": 6498,
"src": "1383:12:37",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string"
},
"typeName": {
"id": 6481,
"name": "string",
"nodeType": "ElementaryTypeName",
"src": "1383:6:37",
"typeDescriptions": {
"typeIdentifier": "t_string_storage_ptr",
"typeString": "string"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "1363:33:37"
},
"payable": false,
"returnParameters": {
"id": 6484,
"nodeType": "ParameterList",
"parameters": [],
"src": "1412:0:37"
},
"scope": 6531,
"src": "1347:141:37",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 6517,
"nodeType": "Block",
"src": "1681:81:37",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6509,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6500,
"src": "1707:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"id": 6505,
"name": "roles",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6434,
"src": "1687:5:37",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_string_memory_$_t_struct$_Role_$6538_storage_$",
"typeString": "mapping(string memory => struct Roles.Role storage ref)"
}
},
"id": 6507,
"indexExpression": {
"argumentTypes": null,
"id": 6506,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6502,
"src": "1693:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "1687:12:37",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$6538_storage",
"typeString": "struct Roles.Role storage ref"
}
},
"id": 6508,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "remove",
"nodeType": "MemberAccess",
"referencedDeclaration": 6570,
"src": "1687:19:37",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_nonpayable$_t_struct$_Role_$6538_storage_ptr_$_t_address_$returns$__$bound_to$_t_struct$_Role_$6538_storage_ptr_$",
"typeString": "function (struct Roles.Role storage pointer,address)"
}
},
"id": 6510,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "1687:30:37",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 6511,
"nodeType": "ExpressionStatement",
"src": "1687:30:37"
},
{
"eventCall": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 6513,
"name": "_operator",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6500,
"src": "1740:9:37",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
{
"argumentTypes": null,
"id": 6514,
"name": "_role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 6502,
"src": "1751:5:37",
"typeDescriptions": {
"typeIdentifier": "t_string_memory_ptr",
"typeString": "string memory"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_address",
"typeString": "address"
},
{
"typeIdentifier": "t_stri