cc-zos-vouching
Version:
Vouching logic for the EVM packages of the ZeppelinOS smart contract platform
1,246 lines (1,245 loc) • 83.7 kB
JSON
{
"contractName": "Roles",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bc0b83c3e49a0b3415f540e1aabb96ac53fd3ebb63ed20b8e6709fe73e5442770029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a72305820bc0b83c3e49a0b3415f540e1aabb96ac53fd3ebb63ed20b8e6709fe73e5442770029",
"sourceMap": "110:715:3:-;;132:2:-1;166:7;155:9;146:7;137:37;252:7;246:14;243:1;238:23;232:4;229:33;270:1;265:20;;;;222:63;;265:20;274:9;222:63;;298:9;295:1;288:20;328:4;319:7;311:22;352:7;343;336:24",
"deployedSourceMap": "110:715:3:-;;;;;;;;",
"source": "pragma solidity ^0.4.24;\n\n\n/**\n * @title Roles\n * @dev Library for managing addresses assigned to a Role.\n */\nlibrary Roles {\n struct Role {\n mapping (address => bool) bearer;\n }\n\n /**\n * @dev give an account access to this role\n */\n function add(Role storage role, address account) internal {\n require(account != address(0));\n role.bearer[account] = true;\n }\n\n /**\n * @dev remove an account's access to this role\n */\n function remove(Role storage role, address account) internal {\n require(account != address(0));\n role.bearer[account] = false;\n }\n\n /**\n * @dev check if an account has this role\n * @return bool\n */\n function has(Role storage role, address account)\n internal\n view\n returns (bool)\n {\n require(account != address(0));\n return role.bearer[account];\n }\n}\n",
"sourcePath": "openzeppelin-eth/contracts/access/Roles.sol",
"ast": {
"absolutePath": "openzeppelin-eth/contracts/access/Roles.sol",
"exportedSymbols": {
"Roles": [
566
]
},
"id": 567,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 489,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Roles\n@dev Library for managing addresses assigned to a Role.",
"fullyImplemented": true,
"id": 566,
"linearizedBaseContracts": [
566
],
"name": "Roles",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Roles.Role",
"id": 494,
"members": [
{
"constant": false,
"id": 493,
"name": "bearer",
"nodeType": "VariableDeclaration",
"scope": 494,
"src": "146:32:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 492,
"keyType": {
"id": 490,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "155:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "146:25:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 491,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "166:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Role",
"nodeType": "StructDefinition",
"scope": 566,
"src": "128:55:3",
"visibility": "public"
},
{
"body": {
"id": 517,
"nodeType": "Block",
"src": "303:74:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 502,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 498,
"src": "317:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 504,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "336:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 503,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "328:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 505,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "328:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "317:21:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 501,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
1936,
1937
],
"referencedDeclaration": 1936,
"src": "309:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 507,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "309:30:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 508,
"nodeType": "ExpressionStatement",
"src": "309:30:3"
},
{
"expression": {
"argumentTypes": null,
"id": 515,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 509,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 496,
"src": "345:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 512,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 493,
"src": "345:11:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 513,
"indexExpression": {
"argumentTypes": null,
"id": 511,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 498,
"src": "357:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "345:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 514,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "368:4:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "345:27:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 516,
"nodeType": "ExpressionStatement",
"src": "345:27:3"
}
]
},
"documentation": "@dev give an account access to this role",
"id": 518,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 499,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 496,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 518,
"src": "258:17:3",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 495,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 494,
"src": "258:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 498,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 518,
"src": "277:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 497,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "277:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "257:36:3"
},
"payable": false,
"returnParameters": {
"id": 500,
"nodeType": "ParameterList",
"parameters": [],
"src": "303:0:3"
},
"scope": 566,
"src": "245:132:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 541,
"nodeType": "Block",
"src": "504:75:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 530,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 526,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 522,
"src": "518:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 528,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "537:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 527,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "529:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 529,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "529:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "518:21:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 525,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
1936,
1937
],
"referencedDeclaration": 1936,
"src": "510:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 531,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "510:30:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 532,
"nodeType": "ExpressionStatement",
"src": "510:30:3"
},
{
"expression": {
"argumentTypes": null,
"id": 539,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 533,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 520,
"src": "546:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 536,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 493,
"src": "546:11:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 537,
"indexExpression": {
"argumentTypes": null,
"id": 535,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 522,
"src": "558:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "546:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 538,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "569:5:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "546:28:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 540,
"nodeType": "ExpressionStatement",
"src": "546:28:3"
}
]
},
"documentation": "@dev remove an account's access to this role",
"id": 542,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "remove",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 523,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 520,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 542,
"src": "459:17:3",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 519,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 494,
"src": "459:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 522,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 542,
"src": "478:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 521,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "478:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "458:36:3"
},
"payable": false,
"returnParameters": {
"id": 524,
"nodeType": "ParameterList",
"parameters": [],
"src": "504:0:3"
},
"scope": 566,
"src": "443:136:3",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 564,
"nodeType": "Block",
"src": "749:74:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 556,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 552,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 546,
"src": "763:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 554,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "782:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 553,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "774:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 555,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "774:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "763:21:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 551,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
1936,
1937
],
"referencedDeclaration": 1936,
"src": "755:7:3",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 557,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "755:30:3",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 558,
"nodeType": "ExpressionStatement",
"src": "755:30:3"
},
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 559,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 544,
"src": "798:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 560,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 493,
"src": "798:11:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 562,
"indexExpression": {
"argumentTypes": null,
"id": 561,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 546,
"src": "810:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "798:20:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 550,
"id": 563,
"nodeType": "Return",
"src": "791:27:3"
}
]
},
"documentation": "@dev check if an account has this role\n@return bool",
"id": 565,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "has",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 547,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 544,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 565,
"src": "670:17:3",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 543,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 494,
"src": "670:4:3",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$494_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 546,
"name": "account",
"nodeType": "VariableDeclaration",
"scope": 565,
"src": "689:15:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 545,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "689:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "669:36:3"
},
"payable": false,
"returnParameters": {
"id": 550,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 549,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 565,
"src": "741:4:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 548,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "741:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "740:6:3"
},
"scope": 566,
"src": "657:166:3",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 567,
"src": "110:715:3"
}
],
"src": "0:826:3"
},
"legacyAST": {
"absolutePath": "openzeppelin-eth/contracts/access/Roles.sol",
"exportedSymbols": {
"Roles": [
566
]
},
"id": 567,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 489,
"literals": [
"solidity",
"^",
"0.4",
".24"
],
"nodeType": "PragmaDirective",
"src": "0:24:3"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Roles\n@dev Library for managing addresses assigned to a Role.",
"fullyImplemented": true,
"id": 566,
"linearizedBaseContracts": [
566
],
"name": "Roles",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Roles.Role",
"id": 494,
"members": [
{
"constant": false,
"id": 493,
"name": "bearer",
"nodeType": "VariableDeclaration",
"scope": 494,
"src": "146:32:3",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 492,
"keyType": {
"id": 490,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "155:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "146:25:3",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 491,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "166:4:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Role",
"nodeType": "StructDefinition",
"scope": 566,
"src": "128:55:3",
"visibility": "public"
},
{
"body": {
"id": 517,
"nodeType": "Block",
"src": "303:74:3",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"commonType": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"id": 506,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftExpression": {
"argumentTypes": null,
"id": 502,
"name": "account",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 498,
"src": "317:7:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "BinaryOperation",
"operator": "!=",
"rightExpression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"hexValue": "30",
"id": 504,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "number",
"lValueRequested": false,
"nodeType": "Literal",
"src": "336:1:3",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
},
"value": "0"
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_rational_0_by_1",
"typeString": "int_const 0"
}
],
"id": 503,
"isConstant": false,
"isLValue": false,
"isPure": true,
"lValueRequested": false,
"nodeType": "ElementaryTypeNameExpression",
"src": "328:7:3",
"typeDescriptions": {
"typeIdentifier": "t_type$_t_address_$",
"typeString": "type(address)"
},
"typeName": "address"
},
"id": 505,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "typeConversion",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "328:10:3",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"src": "317:21:3",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],