Files
openzeppelin-contracts/build/contracts/Roles.json
2018-08-23 11:45:35 -03:00

1705 lines
65 KiB
JSON

{
"contractName": "Roles",
"abi": [],
"bytecode": "0x604c602c600b82828239805160001a60731460008114601c57601e565bfe5b5030600052607381538281f30073000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058203e6eb3a41487aa5abfd0ed72a602bcab4431889e67db11b31d8b0c9b98e034b90029",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a723058203e6eb3a41487aa5abfd0ed72a602bcab4431889e67db11b31d8b0c9b98e034b90029",
"sourceMap": "191:783:28:-;;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": "191:783:28:-;;;;;;;;",
"source": "pragma solidity ^0.4.21;\n\n\n/**\n * @title Roles\n * @author Francisco Giordano (@frangio)\n * @dev Library for managing addresses assigned to a Role.\n * See RBAC.sol for example usage.\n */\nlibrary Roles {\n struct Role {\n mapping (address => bool) bearer;\n }\n\n /**\n * @dev give an address access to this role\n */\n function add(Role storage role, address addr)\n internal\n {\n role.bearer[addr] = true;\n }\n\n /**\n * @dev remove an address' access to this role\n */\n function remove(Role storage role, address addr)\n internal\n {\n role.bearer[addr] = false;\n }\n\n /**\n * @dev check if an address has this role\n * // reverts\n */\n function check(Role storage role, address addr)\n view\n internal\n {\n require(has(role, addr));\n }\n\n /**\n * @dev check if an address has this role\n * @return bool\n */\n function has(Role storage role, address addr)\n view\n internal\n returns (bool)\n {\n return role.bearer[addr];\n }\n}\n",
"sourcePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/ownership/rbac/Roles.sol",
"ast": {
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/ownership/rbac/Roles.sol",
"exportedSymbols": {
"Roles": [
1824
]
},
"id": 1825,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1756,
"literals": [
"solidity",
"^",
"0.4",
".21"
],
"nodeType": "PragmaDirective",
"src": "0:24:28"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Roles\n@author Francisco Giordano (@frangio)\n@dev Library for managing addresses assigned to a Role.\n See RBAC.sol for example usage.",
"fullyImplemented": true,
"id": 1824,
"linearizedBaseContracts": [
1824
],
"name": "Roles",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Roles.Role",
"id": 1761,
"members": [
{
"constant": false,
"id": 1760,
"name": "bearer",
"nodeType": "VariableDeclaration",
"scope": 1761,
"src": "227:32:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 1759,
"keyType": {
"id": 1757,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "236:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "227:25:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 1758,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "247:4:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Role",
"nodeType": "StructDefinition",
"scope": 1824,
"src": "209:55:28",
"visibility": "public"
},
{
"body": {
"id": 1776,
"nodeType": "Block",
"src": "387:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1768,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1763,
"src": "393:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1771,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "393:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1772,
"indexExpression": {
"argumentTypes": null,
"id": 1770,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1765,
"src": "405:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "393:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1773,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "413:4:28",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "393:24:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1775,
"nodeType": "ExpressionStatement",
"src": "393:24:28"
}
]
},
"documentation": "@dev give an address access to this role",
"id": 1777,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1766,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1763,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1777,
"src": "339:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1762,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "339:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1765,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1777,
"src": "358:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1764,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "358:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "338:33:28"
},
"payable": false,
"returnParameters": {
"id": 1767,
"nodeType": "ParameterList",
"parameters": [],
"src": "387:0:28"
},
"scope": 1824,
"src": "326:96:28",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1792,
"nodeType": "Block",
"src": "551:36:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1784,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1779,
"src": "557:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1787,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "557:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1788,
"indexExpression": {
"argumentTypes": null,
"id": 1786,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "569:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "557:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1789,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "577:5:28",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "557:25:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1791,
"nodeType": "ExpressionStatement",
"src": "557:25:28"
}
]
},
"documentation": "@dev remove an address' access to this role",
"id": 1793,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "remove",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1782,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1779,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "503:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1778,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "503:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1781,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "522:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1780,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "522:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "502:33:28"
},
"payable": false,
"returnParameters": {
"id": 1783,
"nodeType": "ParameterList",
"parameters": [],
"src": "551:0:28"
},
"scope": 1824,
"src": "487:100:28",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1807,
"nodeType": "Block",
"src": "735:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1802,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1795,
"src": "753:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
{
"argumentTypes": null,
"id": 1803,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1797,
"src": "759:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1801,
"name": "has",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1823,
"src": "749:3:28",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_struct$_Role_$1761_storage_ptr_$_t_address_$returns$_t_bool_$",
"typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)"
}
},
"id": 1804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "749:15:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1800,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4787,
4788
],
"referencedDeclaration": 4787,
"src": "741:7:28",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1805,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "741:24:28",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1806,
"nodeType": "ExpressionStatement",
"src": "741:24:28"
}
]
},
"documentation": "@dev check if an address has this role\n// reverts",
"id": 1808,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "check",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1798,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1795,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1808,
"src": "678:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1794,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "678:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1797,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1808,
"src": "697:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1796,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "697:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "677:33:28"
},
"payable": false,
"returnParameters": {
"id": 1799,
"nodeType": "ParameterList",
"parameters": [],
"src": "735:0:28"
},
"scope": 1824,
"src": "663:107:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1822,
"nodeType": "Block",
"src": "937:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1817,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1810,
"src": "950:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1818,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "950:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1820,
"indexExpression": {
"argumentTypes": null,
"id": 1819,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1812,
"src": "962:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "950:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1816,
"id": 1821,
"nodeType": "Return",
"src": "943:24:28"
}
]
},
"documentation": "@dev check if an address has this role\n@return bool",
"id": 1823,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "has",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1810,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "861:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1809,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "861:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1812,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "880:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1811,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "880:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "860:33:28"
},
"payable": false,
"returnParameters": {
"id": 1816,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1815,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "929:4:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1814,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "929:4:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "928:6:28"
},
"scope": 1824,
"src": "848:124:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 1825,
"src": "191:783:28"
}
],
"src": "0:975:28"
},
"legacyAST": {
"absolutePath": "/home/spalladino/Projects/openzeppelin-zos/contracts/ownership/rbac/Roles.sol",
"exportedSymbols": {
"Roles": [
1824
]
},
"id": 1825,
"nodeType": "SourceUnit",
"nodes": [
{
"id": 1756,
"literals": [
"solidity",
"^",
"0.4",
".21"
],
"nodeType": "PragmaDirective",
"src": "0:24:28"
},
{
"baseContracts": [],
"contractDependencies": [],
"contractKind": "library",
"documentation": "@title Roles\n@author Francisco Giordano (@frangio)\n@dev Library for managing addresses assigned to a Role.\n See RBAC.sol for example usage.",
"fullyImplemented": true,
"id": 1824,
"linearizedBaseContracts": [
1824
],
"name": "Roles",
"nodeType": "ContractDefinition",
"nodes": [
{
"canonicalName": "Roles.Role",
"id": 1761,
"members": [
{
"constant": false,
"id": 1760,
"name": "bearer",
"nodeType": "VariableDeclaration",
"scope": 1761,
"src": "227:32:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"typeName": {
"id": 1759,
"keyType": {
"id": 1757,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "236:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"nodeType": "Mapping",
"src": "227:25:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
},
"valueType": {
"id": 1758,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "247:4:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
},
"value": null,
"visibility": "internal"
}
],
"name": "Role",
"nodeType": "StructDefinition",
"scope": 1824,
"src": "209:55:28",
"visibility": "public"
},
{
"body": {
"id": 1776,
"nodeType": "Block",
"src": "387:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1774,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1768,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1763,
"src": "393:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1771,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "393:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1772,
"indexExpression": {
"argumentTypes": null,
"id": 1770,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1765,
"src": "405:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "393:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "74727565",
"id": 1773,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "413:4:28",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "true"
},
"src": "393:24:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1775,
"nodeType": "ExpressionStatement",
"src": "393:24:28"
}
]
},
"documentation": "@dev give an address access to this role",
"id": 1777,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "add",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1766,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1763,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1777,
"src": "339:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1762,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "339:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1765,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1777,
"src": "358:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1764,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "358:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "338:33:28"
},
"payable": false,
"returnParameters": {
"id": 1767,
"nodeType": "ParameterList",
"parameters": [],
"src": "387:0:28"
},
"scope": 1824,
"src": "326:96:28",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1792,
"nodeType": "Block",
"src": "551:36:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"id": 1790,
"isConstant": false,
"isLValue": false,
"isPure": false,
"lValueRequested": false,
"leftHandSide": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1784,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1779,
"src": "557:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1787,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "557:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1788,
"indexExpression": {
"argumentTypes": null,
"id": 1786,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1781,
"src": "569:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": true,
"nodeType": "IndexAccess",
"src": "557:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"nodeType": "Assignment",
"operator": "=",
"rightHandSide": {
"argumentTypes": null,
"hexValue": "66616c7365",
"id": 1789,
"isConstant": false,
"isLValue": false,
"isPure": true,
"kind": "bool",
"lValueRequested": false,
"nodeType": "Literal",
"src": "577:5:28",
"subdenomination": null,
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"value": "false"
},
"src": "557:25:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"id": 1791,
"nodeType": "ExpressionStatement",
"src": "557:25:28"
}
]
},
"documentation": "@dev remove an address' access to this role",
"id": 1793,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": false,
"modifiers": [],
"name": "remove",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1782,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1779,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "503:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1778,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "503:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1781,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1793,
"src": "522:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1780,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "522:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "502:33:28"
},
"payable": false,
"returnParameters": {
"id": 1783,
"nodeType": "ParameterList",
"parameters": [],
"src": "551:0:28"
},
"scope": 1824,
"src": "487:100:28",
"stateMutability": "nonpayable",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1807,
"nodeType": "Block",
"src": "735:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"arguments": [
{
"argumentTypes": null,
"id": 1802,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1795,
"src": "753:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
{
"argumentTypes": null,
"id": 1803,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1797,
"src": "759:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
},
{
"typeIdentifier": "t_address",
"typeString": "address"
}
],
"id": 1801,
"name": "has",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1823,
"src": "749:3:28",
"typeDescriptions": {
"typeIdentifier": "t_function_internal_view$_t_struct$_Role_$1761_storage_ptr_$_t_address_$returns$_t_bool_$",
"typeString": "function (struct Roles.Role storage pointer,address) view returns (bool)"
}
},
"id": 1804,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "749:15:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
}
],
"expression": {
"argumentTypes": [
{
"typeIdentifier": "t_bool",
"typeString": "bool"
}
],
"id": 1800,
"name": "require",
"nodeType": "Identifier",
"overloadedDeclarations": [
4787,
4788
],
"referencedDeclaration": 4787,
"src": "741:7:28",
"typeDescriptions": {
"typeIdentifier": "t_function_require_pure$_t_bool_$returns$__$",
"typeString": "function (bool) pure"
}
},
"id": 1805,
"isConstant": false,
"isLValue": false,
"isPure": false,
"kind": "functionCall",
"lValueRequested": false,
"names": [],
"nodeType": "FunctionCall",
"src": "741:24:28",
"typeDescriptions": {
"typeIdentifier": "t_tuple$__$",
"typeString": "tuple()"
}
},
"id": 1806,
"nodeType": "ExpressionStatement",
"src": "741:24:28"
}
]
},
"documentation": "@dev check if an address has this role\n// reverts",
"id": 1808,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "check",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1798,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1795,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1808,
"src": "678:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1794,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "678:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1797,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1808,
"src": "697:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1796,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "697:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "677:33:28"
},
"payable": false,
"returnParameters": {
"id": 1799,
"nodeType": "ParameterList",
"parameters": [],
"src": "735:0:28"
},
"scope": 1824,
"src": "663:107:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
},
{
"body": {
"id": 1822,
"nodeType": "Block",
"src": "937:35:28",
"statements": [
{
"expression": {
"argumentTypes": null,
"baseExpression": {
"argumentTypes": null,
"expression": {
"argumentTypes": null,
"id": 1817,
"name": "role",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1810,
"src": "950:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role storage pointer"
}
},
"id": 1818,
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"memberName": "bearer",
"nodeType": "MemberAccess",
"referencedDeclaration": 1760,
"src": "950:11:28",
"typeDescriptions": {
"typeIdentifier": "t_mapping$_t_address_$_t_bool_$",
"typeString": "mapping(address => bool)"
}
},
"id": 1820,
"indexExpression": {
"argumentTypes": null,
"id": 1819,
"name": "addr",
"nodeType": "Identifier",
"overloadedDeclarations": [],
"referencedDeclaration": 1812,
"src": "962:4:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"isConstant": false,
"isLValue": true,
"isPure": false,
"lValueRequested": false,
"nodeType": "IndexAccess",
"src": "950:17:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"functionReturnParameters": 1816,
"id": 1821,
"nodeType": "Return",
"src": "943:24:28"
}
]
},
"documentation": "@dev check if an address has this role\n@return bool",
"id": 1823,
"implemented": true,
"isConstructor": false,
"isDeclaredConst": true,
"modifiers": [],
"name": "has",
"nodeType": "FunctionDefinition",
"parameters": {
"id": 1813,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1810,
"name": "role",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "861:17:28",
"stateVariable": false,
"storageLocation": "storage",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
},
"typeName": {
"contractScope": null,
"id": 1809,
"name": "Role",
"nodeType": "UserDefinedTypeName",
"referencedDeclaration": 1761,
"src": "861:4:28",
"typeDescriptions": {
"typeIdentifier": "t_struct$_Role_$1761_storage_ptr",
"typeString": "struct Roles.Role"
}
},
"value": null,
"visibility": "internal"
},
{
"constant": false,
"id": 1812,
"name": "addr",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "880:12:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
},
"typeName": {
"id": 1811,
"name": "address",
"nodeType": "ElementaryTypeName",
"src": "880:7:28",
"typeDescriptions": {
"typeIdentifier": "t_address",
"typeString": "address"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "860:33:28"
},
"payable": false,
"returnParameters": {
"id": 1816,
"nodeType": "ParameterList",
"parameters": [
{
"constant": false,
"id": 1815,
"name": "",
"nodeType": "VariableDeclaration",
"scope": 1823,
"src": "929:4:28",
"stateVariable": false,
"storageLocation": "default",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
},
"typeName": {
"id": 1814,
"name": "bool",
"nodeType": "ElementaryTypeName",
"src": "929:4:28",
"typeDescriptions": {
"typeIdentifier": "t_bool",
"typeString": "bool"
}
},
"value": null,
"visibility": "internal"
}
],
"src": "928:6:28"
},
"scope": 1824,
"src": "848:124:28",
"stateMutability": "view",
"superFunction": null,
"visibility": "internal"
}
],
"scope": 1825,
"src": "191:783:28"
}
],
"src": "0:975:28"
},
"compiler": {
"name": "solc",
"version": "0.4.24+commit.e67f0147.Emscripten.clang"
},
"networks": {},
"schemaVersion": "2.0.1",
"updatedAt": "2018-08-23T14:35:50.633Z"
}