{ "contractName": "Initializable", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"custom:oz-upgrades-unsafe-allow\":\"constructor constructor() initializer {} ``` ====\",\"details\":\"This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: [.hljs-theme-light.nopadding] ```\",\"kind\":\"dev\",\"methods\":{},\"stateVariables\":{\"_initialized\":{\"details\":\"Indicates that the contract has been initialized.\"},\"_initializing\":{\"details\":\"Indicates that the contract is in the process of being initialized.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":\"Initializable\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":false,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://6f319af26a9ade3e6cf3698bf1b84aa6213bdd7a76606ea9ba56ced163593934\",\"dweb:/ipfs/QmZ2u9zen5Htan4dSP1RZCY2XqB9HUwqkNCMzdn7aV2jWc\"]},\"@openzeppelin/contracts/utils/Address.sol\":{\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\",\"urls\":[\"bzz-raw://b3a57d0854b2fdce6ebff933a48dca2445643d1eccfc27f00292e937f26c6a58\",\"dweb:/ipfs/QmW45rZooS9TqR4YXUbjRbtf2Bpb5ouSarBvfW1LdGprvV\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "generatedSources": [], "deployedGeneratedSources": [], "sourceMap": "", "deployedSourceMap": "", "source": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n", "sourcePath": "@openzeppelin/contracts/proxy/utils/Initializable.sol", "ast": { "absolutePath": "@openzeppelin/contracts/proxy/utils/Initializable.sol", "exportedSymbols": { "Address": [ 5355 ], "Initializable": [ 1339 ] }, "id": 1340, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1267, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "113:23:4" }, { "absolutePath": "@openzeppelin/contracts/utils/Address.sol", "file": "../../utils/Address.sol", "id": 1268, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 1340, "sourceUnit": 5356, "src": "138:33:4", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [], "canonicalName": "Initializable", "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 1269, "nodeType": "StructuredDocumentation", "src": "173:1497:4", "text": " @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n [CAUTION]\n ====\n Avoid leaving a contract uninitialized.\n An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n [.hljs-theme-light.nopadding]\n ```\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() initializer {}\n ```\n ====" }, "fullyImplemented": true, "id": 1339, "linearizedBaseContracts": [ 1339 ], "name": "Initializable", "nameLocation": "1689:13:4", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "documentation": { "id": 1270, "nodeType": "StructuredDocumentation", "src": "1709:73:4", "text": " @dev Indicates that the contract has been initialized." }, "id": 1272, "mutability": "mutable", "name": "_initialized", "nameLocation": "1800:12:4", "nodeType": "VariableDeclaration", "scope": 1339, "src": "1787:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1271, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1787:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "private" }, { "constant": false, "documentation": { "id": 1273, "nodeType": "StructuredDocumentation", "src": "1819:91:4", "text": " @dev Indicates that the contract is in the process of being initialized." }, "id": 1275, "mutability": "mutable", "name": "_initializing", "nameLocation": "1928:13:4", "nodeType": "VariableDeclaration", "scope": 1339, "src": "1915:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1274, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1915:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "private" }, { "body": { "id": 1312, "nodeType": "Block", "src": "2069:637:4", "statements": [ { "expression": { "arguments": [ { "condition": { "id": 1279, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2358:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 1283, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "2393:13:4", "subExpression": { "id": 1282, "name": "_initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1272, "src": "2394:12:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1284, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "2358:48:4", "trueExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 1280, "name": "_isConstructor", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1338, "src": "2374:14:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 1281, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2374:16:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564", "id": 1285, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2408:48:4", "typeDescriptions": { "typeIdentifier": "t_stringliteral_7a2a4e26842155ea933fe6eb6e3137eb5a296dcdf55721c552be7b4c3cc23759", "typeString": "literal_string \"Initializable: contract is already initialized\"" }, "value": "Initializable: contract is already initialized" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_7a2a4e26842155ea933fe6eb6e3137eb5a296dcdf55721c552be7b4c3cc23759", "typeString": "literal_string \"Initializable: contract is already initialized\"" } ], "id": 1278, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2350:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1286, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2350:107:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1287, "nodeType": "ExpressionStatement", "src": "2350:107:4" }, { "assignments": [ 1289 ], "declarations": [ { "constant": false, "id": 1289, "mutability": "mutable", "name": "isTopLevelCall", "nameLocation": "2473:14:4", "nodeType": "VariableDeclaration", "scope": 1312, "src": "2468:19:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1288, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2468:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "id": 1292, "initialValue": { "id": 1291, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "2490:14:4", "subExpression": { "id": 1290, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2491:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "VariableDeclarationStatement", "src": "2468:36:4" }, { "condition": { "id": 1293, "name": "isTopLevelCall", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1289, "src": "2518:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1303, "nodeType": "IfStatement", "src": "2514:98:4", "trueBody": { "id": 1302, "nodeType": "Block", "src": "2534:78:4", "statements": [ { "expression": { "id": 1296, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1294, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2548:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "74727565", "id": 1295, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2564:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "2548:20:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1297, "nodeType": "ExpressionStatement", "src": "2548:20:4" }, { "expression": { "id": 1300, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1298, "name": "_initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1272, "src": "2582:12:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "74727565", "id": 1299, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2597:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "2582:19:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1301, "nodeType": "ExpressionStatement", "src": "2582:19:4" } ] } }, { "id": 1304, "nodeType": "PlaceholderStatement", "src": "2622:1:4" }, { "condition": { "id": 1305, "name": "isTopLevelCall", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1289, "src": "2638:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1311, "nodeType": "IfStatement", "src": "2634:66:4", "trueBody": { "id": 1310, "nodeType": "Block", "src": "2654:46:4", "statements": [ { "expression": { "id": 1308, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1306, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2668:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "66616c7365", "id": 1307, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2684:5:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "2668:21:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1309, "nodeType": "ExpressionStatement", "src": "2668:21:4" } ] } } ] }, "documentation": { "id": 1276, "nodeType": "StructuredDocumentation", "src": "1948:93:4", "text": " @dev Modifier to protect an initializer function from being invoked twice." }, "id": 1313, "name": "initializer", "nameLocation": "2055:11:4", "nodeType": "ModifierDefinition", "parameters": { "id": 1277, "nodeType": "ParameterList", "parameters": [], "src": "2066:2:4" }, "src": "2046:660:4", "virtual": false, "visibility": "internal" }, { "body": { "id": 1322, "nodeType": "Block", "src": "2923:97:4", "statements": [ { "expression": { "arguments": [ { "id": 1317, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2941:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "496e697469616c697a61626c653a20636f6e7472616374206973206e6f7420696e697469616c697a696e67", "id": 1318, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2956:45:4", "typeDescriptions": { "typeIdentifier": "t_stringliteral_d688db918bb9dd50354922faa108595679886fe9ff08046ad1ffe30aaea55f8b", "typeString": "literal_string \"Initializable: contract is not initializing\"" }, "value": "Initializable: contract is not initializing" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_d688db918bb9dd50354922faa108595679886fe9ff08046ad1ffe30aaea55f8b", "typeString": "literal_string \"Initializable: contract is not initializing\"" } ], "id": 1316, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2933:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1319, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2933:69:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1320, "nodeType": "ExpressionStatement", "src": "2933:69:4" }, { "id": 1321, "nodeType": "PlaceholderStatement", "src": "3012:1:4" } ] }, "documentation": { "id": 1314, "nodeType": "StructuredDocumentation", "src": "2712:178:4", "text": " @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n {initializer} modifier, directly or indirectly." }, "id": 1323, "name": "onlyInitializing", "nameLocation": "2904:16:4", "nodeType": "ModifierDefinition", "parameters": { "id": 1315, "nodeType": "ParameterList", "parameters": [], "src": "2920:2:4" }, "src": "2895:125:4", "virtual": false, "visibility": "internal" }, { "body": { "id": 1337, "nodeType": "Block", "src": "3080:58:4", "statements": [ { "expression": { "id": 1335, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "3097:34:4", "subExpression": { "arguments": [ { "arguments": [ { "id": 1332, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "3125:4:4", "typeDescriptions": { "typeIdentifier": "t_contract$_Initializable_$1339", "typeString": "contract Initializable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Initializable_$1339", "typeString": "contract Initializable" } ], "id": 1331, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "3117:7:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 1330, "name": "address", "nodeType": "ElementaryTypeName", "src": "3117:7:4", "typeDescriptions": {} } }, "id": 1333, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3117:13:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "id": 1328, "name": "Address", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5355, "src": "3098:7:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Address_$5355_$", "typeString": "type(library Address)" } }, "id": 1329, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "isContract", "nodeType": "MemberAccess", "referencedDeclaration": 5078, "src": "3098:18:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 1334, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3098:33:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 1327, "id": 1336, "nodeType": "Return", "src": "3090:41:4" } ] }, "id": 1338, "implemented": true, "kind": "function", "modifiers": [], "name": "_isConstructor", "nameLocation": "3035:14:4", "nodeType": "FunctionDefinition", "parameters": { "id": 1324, "nodeType": "ParameterList", "parameters": [], "src": "3049:2:4" }, "returnParameters": { "id": 1327, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1326, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1338, "src": "3074:4:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1325, "name": "bool", "nodeType": "ElementaryTypeName", "src": "3074:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "3073:6:4" }, "scope": 1339, "src": "3026:112:4", "stateMutability": "view", "virtual": false, "visibility": "private" } ], "scope": 1340, "src": "1671:1469:4", "usedErrors": [] } ], "src": "113:3028:4" }, "legacyAST": { "absolutePath": "@openzeppelin/contracts/proxy/utils/Initializable.sol", "exportedSymbols": { "Address": [ 5355 ], "Initializable": [ 1339 ] }, "id": 1340, "license": "MIT", "nodeType": "SourceUnit", "nodes": [ { "id": 1267, "literals": [ "solidity", "^", "0.8", ".0" ], "nodeType": "PragmaDirective", "src": "113:23:4" }, { "absolutePath": "@openzeppelin/contracts/utils/Address.sol", "file": "../../utils/Address.sol", "id": 1268, "nameLocation": "-1:-1:-1", "nodeType": "ImportDirective", "scope": 1340, "sourceUnit": 5356, "src": "138:33:4", "symbolAliases": [], "unitAlias": "" }, { "abstract": true, "baseContracts": [], "canonicalName": "Initializable", "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 1269, "nodeType": "StructuredDocumentation", "src": "173:1497:4", "text": " @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n [CAUTION]\n ====\n Avoid leaving a contract uninitialized.\n An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n [.hljs-theme-light.nopadding]\n ```\n /// @custom:oz-upgrades-unsafe-allow constructor\n constructor() initializer {}\n ```\n ====" }, "fullyImplemented": true, "id": 1339, "linearizedBaseContracts": [ 1339 ], "name": "Initializable", "nameLocation": "1689:13:4", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "documentation": { "id": 1270, "nodeType": "StructuredDocumentation", "src": "1709:73:4", "text": " @dev Indicates that the contract has been initialized." }, "id": 1272, "mutability": "mutable", "name": "_initialized", "nameLocation": "1800:12:4", "nodeType": "VariableDeclaration", "scope": 1339, "src": "1787:25:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1271, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1787:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "private" }, { "constant": false, "documentation": { "id": 1273, "nodeType": "StructuredDocumentation", "src": "1819:91:4", "text": " @dev Indicates that the contract is in the process of being initialized." }, "id": 1275, "mutability": "mutable", "name": "_initializing", "nameLocation": "1928:13:4", "nodeType": "VariableDeclaration", "scope": 1339, "src": "1915:26:4", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1274, "name": "bool", "nodeType": "ElementaryTypeName", "src": "1915:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "private" }, { "body": { "id": 1312, "nodeType": "Block", "src": "2069:637:4", "statements": [ { "expression": { "arguments": [ { "condition": { "id": 1279, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2358:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "id": 1283, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "2393:13:4", "subExpression": { "id": 1282, "name": "_initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1272, "src": "2394:12:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1284, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "2358:48:4", "trueExpression": { "arguments": [], "expression": { "argumentTypes": [], "id": 1280, "name": "_isConstructor", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1338, "src": "2374:14:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$_t_bool_$", "typeString": "function () view returns (bool)" } }, "id": 1281, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2374:16:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a6564", "id": 1285, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2408:48:4", "typeDescriptions": { "typeIdentifier": "t_stringliteral_7a2a4e26842155ea933fe6eb6e3137eb5a296dcdf55721c552be7b4c3cc23759", "typeString": "literal_string \"Initializable: contract is already initialized\"" }, "value": "Initializable: contract is already initialized" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_7a2a4e26842155ea933fe6eb6e3137eb5a296dcdf55721c552be7b4c3cc23759", "typeString": "literal_string \"Initializable: contract is already initialized\"" } ], "id": 1278, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2350:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1286, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2350:107:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1287, "nodeType": "ExpressionStatement", "src": "2350:107:4" }, { "assignments": [ 1289 ], "declarations": [ { "constant": false, "id": 1289, "mutability": "mutable", "name": "isTopLevelCall", "nameLocation": "2473:14:4", "nodeType": "VariableDeclaration", "scope": 1312, "src": "2468:19:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1288, "name": "bool", "nodeType": "ElementaryTypeName", "src": "2468:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "id": 1292, "initialValue": { "id": 1291, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "2490:14:4", "subExpression": { "id": 1290, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2491:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "VariableDeclarationStatement", "src": "2468:36:4" }, { "condition": { "id": 1293, "name": "isTopLevelCall", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1289, "src": "2518:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1303, "nodeType": "IfStatement", "src": "2514:98:4", "trueBody": { "id": 1302, "nodeType": "Block", "src": "2534:78:4", "statements": [ { "expression": { "id": 1296, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1294, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2548:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "74727565", "id": 1295, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2564:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "2548:20:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1297, "nodeType": "ExpressionStatement", "src": "2548:20:4" }, { "expression": { "id": 1300, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1298, "name": "_initialized", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1272, "src": "2582:12:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "74727565", "id": 1299, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2597:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "2582:19:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1301, "nodeType": "ExpressionStatement", "src": "2582:19:4" } ] } }, { "id": 1304, "nodeType": "PlaceholderStatement", "src": "2622:1:4" }, { "condition": { "id": 1305, "name": "isTopLevelCall", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1289, "src": "2638:14:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1311, "nodeType": "IfStatement", "src": "2634:66:4", "trueBody": { "id": 1310, "nodeType": "Block", "src": "2654:46:4", "statements": [ { "expression": { "id": 1308, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "id": 1306, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2668:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "hexValue": "66616c7365", "id": 1307, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "2684:5:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "2668:21:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 1309, "nodeType": "ExpressionStatement", "src": "2668:21:4" } ] } } ] }, "documentation": { "id": 1276, "nodeType": "StructuredDocumentation", "src": "1948:93:4", "text": " @dev Modifier to protect an initializer function from being invoked twice." }, "id": 1313, "name": "initializer", "nameLocation": "2055:11:4", "nodeType": "ModifierDefinition", "parameters": { "id": 1277, "nodeType": "ParameterList", "parameters": [], "src": "2066:2:4" }, "src": "2046:660:4", "virtual": false, "visibility": "internal" }, { "body": { "id": 1322, "nodeType": "Block", "src": "2923:97:4", "statements": [ { "expression": { "arguments": [ { "id": 1317, "name": "_initializing", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 1275, "src": "2941:13:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "hexValue": "496e697469616c697a61626c653a20636f6e7472616374206973206e6f7420696e697469616c697a696e67", "id": 1318, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "2956:45:4", "typeDescriptions": { "typeIdentifier": "t_stringliteral_d688db918bb9dd50354922faa108595679886fe9ff08046ad1ffe30aaea55f8b", "typeString": "literal_string \"Initializable: contract is not initializing\"" }, "value": "Initializable: contract is not initializing" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_d688db918bb9dd50354922faa108595679886fe9ff08046ad1ffe30aaea55f8b", "typeString": "literal_string \"Initializable: contract is not initializing\"" } ], "id": 1316, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ 4294967278, 4294967278 ], "referencedDeclaration": 4294967278, "src": "2933:7:4", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 1319, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "2933:69:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 1320, "nodeType": "ExpressionStatement", "src": "2933:69:4" }, { "id": 1321, "nodeType": "PlaceholderStatement", "src": "3012:1:4" } ] }, "documentation": { "id": 1314, "nodeType": "StructuredDocumentation", "src": "2712:178:4", "text": " @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n {initializer} modifier, directly or indirectly." }, "id": 1323, "name": "onlyInitializing", "nameLocation": "2904:16:4", "nodeType": "ModifierDefinition", "parameters": { "id": 1315, "nodeType": "ParameterList", "parameters": [], "src": "2920:2:4" }, "src": "2895:125:4", "virtual": false, "visibility": "internal" }, { "body": { "id": 1337, "nodeType": "Block", "src": "3080:58:4", "statements": [ { "expression": { "id": 1335, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "3097:34:4", "subExpression": { "arguments": [ { "arguments": [ { "id": 1332, "name": "this", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 4294967268, "src": "3125:4:4", "typeDescriptions": { "typeIdentifier": "t_contract$_Initializable_$1339", "typeString": "contract Initializable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_contract$_Initializable_$1339", "typeString": "contract Initializable" } ], "id": 1331, "isConstant": false, "isLValue": false, "isPure": true, "lValueRequested": false, "nodeType": "ElementaryTypeNameExpression", "src": "3117:7:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_address_$", "typeString": "type(address)" }, "typeName": { "id": 1330, "name": "address", "nodeType": "ElementaryTypeName", "src": "3117:7:4", "typeDescriptions": {} } }, "id": 1333, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3117:13:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_address", "typeString": "address" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address", "typeString": "address" } ], "expression": { "id": 1328, "name": "Address", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 5355, "src": "3098:7:4", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_Address_$5355_$", "typeString": "type(library Address)" } }, "id": 1329, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "isContract", "nodeType": "MemberAccess", "referencedDeclaration": 5078, "src": "3098:18:4", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$_t_address_$returns$_t_bool_$", "typeString": "function (address) view returns (bool)" } }, "id": 1334, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "3098:33:4", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "functionReturnParameters": 1327, "id": 1336, "nodeType": "Return", "src": "3090:41:4" } ] }, "id": 1338, "implemented": true, "kind": "function", "modifiers": [], "name": "_isConstructor", "nameLocation": "3035:14:4", "nodeType": "FunctionDefinition", "parameters": { "id": 1324, "nodeType": "ParameterList", "parameters": [], "src": "3049:2:4" }, "returnParameters": { "id": 1327, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 1326, "mutability": "mutable", "name": "", "nameLocation": "-1:-1:-1", "nodeType": "VariableDeclaration", "scope": 1338, "src": "3074:4:4", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 1325, "name": "bool", "nodeType": "ElementaryTypeName", "src": "3074:4:4", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "visibility": "internal" } ], "src": "3073:6:4" }, "scope": 1339, "src": "3026:112:4", "stateMutability": "view", "virtual": false, "visibility": "private" } ], "scope": 1340, "src": "1671:1469:4", "usedErrors": [] } ], "src": "113:3028:4" }, "compiler": { "name": "solc", "version": "0.8.10+commit.fc410830.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.4.4", "updatedAt": "2022-08-17T06:09:48.075Z", "devdoc": { "custom:oz-upgrades-unsafe-allow": "constructor constructor() initializer {} ``` ====", "details": "This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer function so it can only be called once. The {initializer} modifier provided by this contract will have this effect. TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}. CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure that all initializers are idempotent. This is not verified automatically as constructors are by Solidity. [CAUTION] ==== Avoid leaving a contract uninitialized. An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed: [.hljs-theme-light.nopadding] ```", "kind": "dev", "methods": {}, "stateVariables": { "_initialized": { "details": "Indicates that the contract has been initialized." }, "_initializing": { "details": "Indicates that the contract is in the process of being initialized." } }, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }