{ "contractName": "ReentrancyGuard", "abi": [], "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[],\"devdoc\":{\"details\":\"ReentrancyGuard The contract provides protection against re-entrancy - calling a function (directly or indirectly) from within itself.\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"ensures instantiation only by sub-contracts\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol\":\"ReentrancyGuard\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol\":{\"keccak256\":\"0x5ea87c10dd6e7e79212da712eb5f079c03361e6c96e299a4ffd9aaee8d6a3899\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://882aac64a791df35a942480e6ce611d1acb399af4ac0c4ef0288965c3785bf50\",\"dweb:/ipfs/QmeWeYYFh5HZAzJ1SzPHoTcPvZrE4NPUVfmjvH9Q3m36Gg\"]}},\"version\":1}", "bytecode": "0x", "deployedBytecode": "0x", "immutableReferences": {}, "sourceMap": "", "deployedSourceMap": "", "source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\r\npragma solidity 0.6.12;\r\n\r\n/**\r\n * @dev ReentrancyGuard\r\n *\r\n * The contract provides protection against re-entrancy - calling a function (directly or\r\n * indirectly) from within itself.\r\n*/\r\ncontract ReentrancyGuard {\r\n // true while protected code is being executed, false otherwise\r\n bool private locked = false;\r\n\r\n /**\r\n * @dev ensures instantiation only by sub-contracts\r\n */\r\n constructor() internal {}\r\n\r\n // protects a function against reentrancy attacks\r\n modifier protected() {\r\n _protected();\r\n locked = true;\r\n _;\r\n locked = false;\r\n }\r\n\r\n // error message binary size optimization\r\n function _protected() internal view {\r\n require(!locked, \"ERR_REENTRANCY\");\r\n }\r\n}\r\n", "sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol", "ast": { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol", "exportedSymbols": { "ReentrancyGuard": [ 22242 ] }, "id": 22243, "license": "SEE LICENSE IN LICENSE", "nodeType": "SourceUnit", "nodes": [ { "id": 22207, "literals": [ "solidity", "0.6", ".12" ], "nodeType": "PragmaDirective", "src": "52:23:59" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 22208, "nodeType": "StructuredDocumentation", "src": "79:167:59", "text": " @dev ReentrancyGuard\n The contract provides protection against re-entrancy - calling a function (directly or\n indirectly) from within itself." }, "fullyImplemented": true, "id": 22242, "linearizedBaseContracts": [ 22242 ], "name": "ReentrancyGuard", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 22211, "mutability": "mutable", "name": "locked", "nodeType": "VariableDeclaration", "overrides": null, "scope": 22242, "src": "349:27:59", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 22209, "name": "bool", "nodeType": "ElementaryTypeName", "src": "349:4:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": { "argumentTypes": null, "hexValue": "66616c7365", "id": 22210, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "371:5:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "visibility": "private" }, { "body": { "id": 22215, "nodeType": "Block", "src": "483:2:59", "statements": [] }, "documentation": { "id": 22212, "nodeType": "StructuredDocumentation", "src": "385:69:59", "text": " @dev ensures instantiation only by sub-contracts" }, "id": 22216, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 22213, "nodeType": "ParameterList", "parameters": [], "src": "471:2:59" }, "returnParameters": { "id": 22214, "nodeType": "ParameterList", "parameters": [], "src": "483:0:59" }, "scope": 22242, "src": "460:25:59", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 22230, "nodeType": "Block", "src": "569:92:59", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 22218, "name": "_protected", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22241, "src": "580:10:59", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$__$", "typeString": "function () view" } }, "id": 22219, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "580:12:59", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 22220, "nodeType": "ExpressionStatement", "src": "580:12:59" }, { "expression": { "argumentTypes": null, "id": 22223, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 22221, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "603:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 22222, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "612:4:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "603:13:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 22224, "nodeType": "ExpressionStatement", "src": "603:13:59" }, { "id": 22225, "nodeType": "PlaceholderStatement", "src": "627:1:59" }, { "expression": { "argumentTypes": null, "id": 22228, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 22226, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "639:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "66616c7365", "id": 22227, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "648:5:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "639:14:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 22229, "nodeType": "ExpressionStatement", "src": "639:14:59" } ] }, "documentation": null, "id": 22231, "name": "protected", "nodeType": "ModifierDefinition", "overrides": null, "parameters": { "id": 22217, "nodeType": "ParameterList", "parameters": [], "src": "566:2:59" }, "src": "548:113:59", "virtual": false, "visibility": "internal" }, { "body": { "id": 22240, "nodeType": "Block", "src": "752:53:59", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 22236, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "771:7:59", "subExpression": { "argumentTypes": null, "id": 22235, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "772:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4552525f5245454e5452414e4359", "id": 22237, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "780:16:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_6e0eaf77891cd79d274f1446031427d8091629657fef0bd3d01a673469e9b08c", "typeString": "literal_string \"ERR_REENTRANCY\"" }, "value": "ERR_REENTRANCY" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_6e0eaf77891cd79d274f1446031427d8091629657fef0bd3d01a673469e9b08c", "typeString": "literal_string \"ERR_REENTRANCY\"" } ], "id": 22234, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "763:7:59", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 22238, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "763:34:59", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 22239, "nodeType": "ExpressionStatement", "src": "763:34:59" } ] }, "documentation": null, "id": 22241, "implemented": true, "kind": "function", "modifiers": [], "name": "_protected", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 22232, "nodeType": "ParameterList", "parameters": [], "src": "735:2:59" }, "returnParameters": { "id": 22233, "nodeType": "ParameterList", "parameters": [], "src": "752:0:59" }, "scope": 22242, "src": "716:89:59", "stateMutability": "view", "virtual": false, "visibility": "internal" } ], "scope": 22243, "src": "248:560:59" } ], "src": "52:758:59" }, "legacyAST": { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol", "exportedSymbols": { "ReentrancyGuard": [ 22242 ] }, "id": 22243, "license": "SEE LICENSE IN LICENSE", "nodeType": "SourceUnit", "nodes": [ { "id": 22207, "literals": [ "solidity", "0.6", ".12" ], "nodeType": "PragmaDirective", "src": "52:23:59" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": { "id": 22208, "nodeType": "StructuredDocumentation", "src": "79:167:59", "text": " @dev ReentrancyGuard\n The contract provides protection against re-entrancy - calling a function (directly or\n indirectly) from within itself." }, "fullyImplemented": true, "id": 22242, "linearizedBaseContracts": [ 22242 ], "name": "ReentrancyGuard", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "id": 22211, "mutability": "mutable", "name": "locked", "nodeType": "VariableDeclaration", "overrides": null, "scope": 22242, "src": "349:27:59", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 22209, "name": "bool", "nodeType": "ElementaryTypeName", "src": "349:4:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": { "argumentTypes": null, "hexValue": "66616c7365", "id": 22210, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "371:5:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "visibility": "private" }, { "body": { "id": 22215, "nodeType": "Block", "src": "483:2:59", "statements": [] }, "documentation": { "id": 22212, "nodeType": "StructuredDocumentation", "src": "385:69:59", "text": " @dev ensures instantiation only by sub-contracts" }, "id": 22216, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 22213, "nodeType": "ParameterList", "parameters": [], "src": "471:2:59" }, "returnParameters": { "id": 22214, "nodeType": "ParameterList", "parameters": [], "src": "483:0:59" }, "scope": 22242, "src": "460:25:59", "stateMutability": "nonpayable", "virtual": false, "visibility": "internal" }, { "body": { "id": 22230, "nodeType": "Block", "src": "569:92:59", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 22218, "name": "_protected", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22241, "src": "580:10:59", "typeDescriptions": { "typeIdentifier": "t_function_internal_view$__$returns$__$", "typeString": "function () view" } }, "id": 22219, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "580:12:59", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 22220, "nodeType": "ExpressionStatement", "src": "580:12:59" }, { "expression": { "argumentTypes": null, "id": 22223, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 22221, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "603:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 22222, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "612:4:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "603:13:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 22224, "nodeType": "ExpressionStatement", "src": "603:13:59" }, { "id": 22225, "nodeType": "PlaceholderStatement", "src": "627:1:59" }, { "expression": { "argumentTypes": null, "id": 22228, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 22226, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "639:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "66616c7365", "id": 22227, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "648:5:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "639:14:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 22229, "nodeType": "ExpressionStatement", "src": "639:14:59" } ] }, "documentation": null, "id": 22231, "name": "protected", "nodeType": "ModifierDefinition", "overrides": null, "parameters": { "id": 22217, "nodeType": "ParameterList", "parameters": [], "src": "566:2:59" }, "src": "548:113:59", "virtual": false, "visibility": "internal" }, { "body": { "id": 22240, "nodeType": "Block", "src": "752:53:59", "statements": [ { "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "id": 22236, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "771:7:59", "subExpression": { "argumentTypes": null, "id": 22235, "name": "locked", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22211, "src": "772:6:59", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, { "argumentTypes": null, "hexValue": "4552525f5245454e5452414e4359", "id": 22237, "isConstant": false, "isLValue": false, "isPure": true, "kind": "string", "lValueRequested": false, "nodeType": "Literal", "src": "780:16:59", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_stringliteral_6e0eaf77891cd79d274f1446031427d8091629657fef0bd3d01a673469e9b08c", "typeString": "literal_string \"ERR_REENTRANCY\"" }, "value": "ERR_REENTRANCY" } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_bool", "typeString": "bool" }, { "typeIdentifier": "t_stringliteral_6e0eaf77891cd79d274f1446031427d8091629657fef0bd3d01a673469e9b08c", "typeString": "literal_string \"ERR_REENTRANCY\"" } ], "id": 22234, "name": "require", "nodeType": "Identifier", "overloadedDeclarations": [ -18, -18 ], "referencedDeclaration": -18, "src": "763:7:59", "typeDescriptions": { "typeIdentifier": "t_function_require_pure$_t_bool_$_t_string_memory_ptr_$returns$__$", "typeString": "function (bool,string memory) pure" } }, "id": 22238, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "763:34:59", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 22239, "nodeType": "ExpressionStatement", "src": "763:34:59" } ] }, "documentation": null, "id": 22241, "implemented": true, "kind": "function", "modifiers": [], "name": "_protected", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 22232, "nodeType": "ParameterList", "parameters": [], "src": "735:2:59" }, "returnParameters": { "id": 22233, "nodeType": "ParameterList", "parameters": [], "src": "752:0:59" }, "scope": 22242, "src": "716:89:59", "stateMutability": "view", "virtual": false, "visibility": "internal" } ], "scope": 22243, "src": "248:560:59" } ], "src": "52:758:59" }, "compiler": { "name": "solc", "version": "0.6.12+commit.27d51765.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.3", "updatedAt": "2020-10-20T08:24:47.844Z", "devdoc": { "details": "ReentrancyGuard The contract provides protection against re-entrancy - calling a function (directly or indirectly) from within itself.", "kind": "dev", "methods": { "constructor": { "details": "ensures instantiation only by sub-contracts" } }, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }