{ "contractName": "TestReentrancyGuard", "abi": [ { "inputs": [], "name": "calls", "outputs": [ { "internalType": "uint256", "name": "", "type": "uint256" } ], "stateMutability": "view", "type": "function" }, { "inputs": [], "name": "protectedMethod", "outputs": [], "stateMutability": "nonpayable", "type": "function" }, { "inputs": [], "name": "unprotectedMethod", "outputs": [], "stateMutability": "nonpayable", "type": "function" } ], "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"calls\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"protectedMethod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unprotectedMethod\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/helpers/TestReentrancyGuard.sol\":\"TestReentrancyGuard\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/helpers/TestReentrancyGuard.sol\":{\"keccak256\":\"0x10cc32288bb587945509a8d78bf7d96b999df3bfd631162acf07b8db00404c3e\",\"license\":\"SEE LICENSE IN LICENSE\",\"urls\":[\"bzz-raw://0eae14c3bc545882b4afdf7ef001c24b70781ed0216bdb559ec11218d4182e6c\",\"dweb:/ipfs/QmNpdpANj4EA2DgLHEmVH4FtKrQL91boCdEGSZ87coJLj4\"]},\"/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": "0x60806040526000805460ff1916905534801561001a57600080fd5b506101848061002a6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80632d4d800c14610046578063305f72b714610050578063f86485d91461006a575b600080fd5b61004e610072565b005b61005861009b565b60408051918252519081900360200190f35b61004e6100a1565b61007a6100ab565b6000805460ff1916600117905561008f6100f4565b6000805460ff19169055565b60015481565b6100a96100f4565b565b60005460ff16156100a9576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b60018054810190556040805163041d939960e11b81529051339163083b273291600480830192600092919082900301818387803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b5050505056fea2646970667358221220db5b491438fe4fee705ac2ae433f910b1a9796da0ae45353617780e40ca664a264736f6c634300060c0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80632d4d800c14610046578063305f72b714610050578063f86485d91461006a575b600080fd5b61004e610072565b005b61005861009b565b60408051918252519081900360200190f35b61004e6100a1565b61007a6100ab565b6000805460ff1916600117905561008f6100f4565b6000805460ff19169055565b60015481565b6100a96100f4565b565b60005460ff16156100a9576040805162461bcd60e51b815260206004820152600e60248201526d4552525f5245454e5452414e435960901b604482015290519081900360640190fd5b60018054810190556040805163041d939960e11b81529051339163083b273291600480830192600092919082900301818387803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b5050505056fea2646970667358221220db5b491438fe4fee705ac2ae433f910b1a9796da0ae45353617780e40ca664a264736f6c634300060c0033", "immutableReferences": {}, "sourceMap": "942:331:43:-:0;;;371:5:59;349:27;;-1:-1:-1;;349:27:59;;;942:331:43;;;;;;;;;;;;;;;;", "deployedSourceMap": "942:331:43:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1023:68;;;:::i;:::-;;996:20;;;:::i;:::-;;;;;;;;;;;;;;;;1097:60;;;:::i;1023:68::-;580:12:59;:10;:12::i;:::-;603:6;:13;;-1:-1:-1;;603:13:59;612:4;603:13;;;1079:5:43::1;:3;:5::i;:::-;648::59::0;639:14;;-1:-1:-1;;639:14:59;;;1023:68:43:o;996:20::-;;;;:::o;1097:60::-;1145:5;:3;:5::i;:::-;1097:60::o;716:89:59:-;772:6;;;;771:7;763:34;;;;;-1:-1:-1;;;763:34:59;;;;;;;;;;;;-1:-1:-1;;;763:34:59;;;;;;;;;;;;;;1163:108:43;1196:5;:7;;;;;;1214:50;;;-1:-1:-1;;;1214:50:43;;;;1242:10;;1214:48;;:50;;;;;1196:5;;1214:50;;;;;;;1196:5;1242:10;1214:50;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1163:108::o", "source": "// SPDX-License-Identifier: SEE LICENSE IN LICENSE\npragma solidity 0.6.12;\nimport \"../utility/ReentrancyGuard.sol\";\n\n\ncontract TestReentrancyGuardAttacker {\n TestReentrancyGuard public target;\n bool public reentrancy;\n bool public callProtectedMethod;\n bool public attacking;\n\n constructor(TestReentrancyGuard _target) public {\n target = _target;\n }\n\n function setReentrancy(bool _reentrancy) external {\n reentrancy = _reentrancy;\n }\n\n function setCallProtectedMethod(bool _callProtectedMethod) external {\n callProtectedMethod = _callProtectedMethod;\n }\n\n function run() public {\n callProtectedMethod ? target.protectedMethod() : target.unprotectedMethod();\n }\n\n function callback() external {\n if (!reentrancy) {\n return;\n }\n\n if (!attacking) {\n attacking = true;\n\n run();\n }\n\n attacking = false;\n }\n}\n\ncontract TestReentrancyGuard is ReentrancyGuard {\n uint256 public calls;\n\n function protectedMethod() external protected {\n run();\n }\n\n function unprotectedMethod() external {\n run();\n }\n\n function run() private {\n calls++;\n\n TestReentrancyGuardAttacker(msg.sender).callback();\n }\n}\n", "sourcePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/helpers/TestReentrancyGuard.sol", "ast": { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/helpers/TestReentrancyGuard.sol", "exportedSymbols": { "TestReentrancyGuard": [ 19640 ], "TestReentrancyGuardAttacker": [ 19605 ] }, "id": 19641, "license": "SEE LICENSE IN LICENSE", "nodeType": "SourceUnit", "nodes": [ { "id": 19528, "literals": [ "solidity", "0.6", ".12" ], "nodeType": "PragmaDirective", "src": "51:23:43" }, { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol", "file": "../utility/ReentrancyGuard.sol", "id": 19529, "nodeType": "ImportDirective", "scope": 19641, "sourceUnit": 22243, "src": "75:40:43", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 19605, "linearizedBaseContracts": [ 19605 ], "name": "TestReentrancyGuardAttacker", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "d4b83992", "id": 19531, "mutability": "mutable", "name": "target", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "161:33:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" }, "typeName": { "contractScope": null, "id": 19530, "name": "TestReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19640, "src": "161:19:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "e11f493e", "id": 19533, "mutability": "mutable", "name": "reentrancy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "200:22:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19532, "name": "bool", "nodeType": "ElementaryTypeName", "src": "200:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "17846e39", "id": 19535, "mutability": "mutable", "name": "callProtectedMethod", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "228:31:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19534, "name": "bool", "nodeType": "ElementaryTypeName", "src": "228:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "3c0bbcd9", "id": 19537, "mutability": "mutable", "name": "attacking", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "265:21:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19536, "name": "bool", "nodeType": "ElementaryTypeName", "src": "265:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "body": { "id": 19546, "nodeType": "Block", "src": "341:33:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19544, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19542, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "351:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19543, "name": "_target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19539, "src": "360:7:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "src": "351:16:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19545, "nodeType": "ExpressionStatement", "src": "351:16:43" } ] }, "documentation": null, "id": 19547, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19540, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19539, "mutability": "mutable", "name": "_target", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19547, "src": "305:27:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" }, "typeName": { "contractScope": null, "id": 19538, "name": "TestReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19640, "src": "305:19:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "value": null, "visibility": "internal" } ], "src": "304:29:43" }, "returnParameters": { "id": 19541, "nodeType": "ParameterList", "parameters": [], "src": "341:0:43" }, "scope": 19605, "src": "293:81:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 19556, "nodeType": "Block", "src": "430:41:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19552, "name": "reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19533, "src": "440:10:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19553, "name": "_reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19549, "src": "453:11:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "440:24:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19555, "nodeType": "ExpressionStatement", "src": "440:24:43" } ] }, "documentation": null, "functionSelector": "322d5010", "id": 19557, "implemented": true, "kind": "function", "modifiers": [], "name": "setReentrancy", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19550, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19549, "mutability": "mutable", "name": "_reentrancy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19557, "src": "403:16:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19548, "name": "bool", "nodeType": "ElementaryTypeName", "src": "403:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "402:18:43" }, "returnParameters": { "id": 19551, "nodeType": "ParameterList", "parameters": [], "src": "430:0:43" }, "scope": 19605, "src": "380:91:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19566, "nodeType": "Block", "src": "545:59:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19564, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19562, "name": "callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19535, "src": "555:19:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19563, "name": "_callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19559, "src": "577:20:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "555:42:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19565, "nodeType": "ExpressionStatement", "src": "555:42:43" } ] }, "documentation": null, "functionSelector": "99563f10", "id": 19567, "implemented": true, "kind": "function", "modifiers": [], "name": "setCallProtectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19560, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19559, "mutability": "mutable", "name": "_callProtectedMethod", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19567, "src": "509:25:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19558, "name": "bool", "nodeType": "ElementaryTypeName", "src": "509:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "508:27:43" }, "returnParameters": { "id": 19561, "nodeType": "ParameterList", "parameters": [], "src": "545:0:43" }, "scope": 19605, "src": "477:127:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19579, "nodeType": "Block", "src": "632:92:43", "statements": [ { "expression": { "argumentTypes": null, "condition": { "argumentTypes": null, "id": 19570, "name": "callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19535, "src": "642:19:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 19574, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "691:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "unprotectedMethod", "nodeType": "MemberAccess", "referencedDeclaration": 19625, "src": "691:24:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19576, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "691:26:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19577, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "642:75:43", "trueExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 19571, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "664:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19572, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "protectedMethod", "nodeType": "MemberAccess", "referencedDeclaration": 19618, "src": "664:22:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19573, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "664:24:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19578, "nodeType": "ExpressionStatement", "src": "642:75:43" } ] }, "documentation": null, "functionSelector": "c0406226", "id": 19580, "implemented": true, "kind": "function", "modifiers": [], "name": "run", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19568, "nodeType": "ParameterList", "parameters": [], "src": "622:2:43" }, "returnParameters": { "id": 19569, "nodeType": "ParameterList", "parameters": [], "src": "632:0:43" }, "scope": 19605, "src": "610:114:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 19603, "nodeType": "Block", "src": "759:179:43", "statements": [ { "condition": { "argumentTypes": null, "id": 19584, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "773:11:43", "subExpression": { "argumentTypes": null, "id": 19583, "name": "reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19533, "src": "774:10:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 19587, "nodeType": "IfStatement", "src": "769:48:43", "trueBody": { "id": 19586, "nodeType": "Block", "src": "786:31:43", "statements": [ { "expression": null, "functionReturnParameters": 19582, "id": 19585, "nodeType": "Return", "src": "800:7:43" } ] } }, { "condition": { "argumentTypes": null, "id": 19589, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "831:10:43", "subExpression": { "argumentTypes": null, "id": 19588, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "832:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 19598, "nodeType": "IfStatement", "src": "827:77:43", "trueBody": { "id": 19597, "nodeType": "Block", "src": "843:61:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19592, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19590, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "857:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 19591, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "869:4:43", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "857:16:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19593, "nodeType": "ExpressionStatement", "src": "857:16:43" }, { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19594, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19580, "src": "888:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19595, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "888:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19596, "nodeType": "ExpressionStatement", "src": "888:5:43" } ] } }, { "expression": { "argumentTypes": null, "id": 19601, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19599, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "914:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "66616c7365", "id": 19600, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "926:5:43", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "914:17:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19602, "nodeType": "ExpressionStatement", "src": "914:17:43" } ] }, "documentation": null, "functionSelector": "083b2732", "id": 19604, "implemented": true, "kind": "function", "modifiers": [], "name": "callback", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19581, "nodeType": "ParameterList", "parameters": [], "src": "747:2:43" }, "returnParameters": { "id": 19582, "nodeType": "ParameterList", "parameters": [], "src": "759:0:43" }, "scope": 19605, "src": "730:208:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 19641, "src": "118:822:43" }, { "abstract": false, "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 19606, "name": "ReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 22242, "src": "974:15:43", "typeDescriptions": { "typeIdentifier": "t_contract$_ReentrancyGuard_$22242", "typeString": "contract ReentrancyGuard" } }, "id": 19607, "nodeType": "InheritanceSpecifier", "src": "974:15:43" } ], "contractDependencies": [ 22242 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 19640, "linearizedBaseContracts": [ 19640, 22242 ], "name": "TestReentrancyGuard", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "305f72b7", "id": 19609, "mutability": "mutable", "name": "calls", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19640, "src": "996:20:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 19608, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "996:7:43", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 19617, "nodeType": "Block", "src": "1069:22:43", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19614, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19639, "src": "1079:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19615, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1079:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19616, "nodeType": "ExpressionStatement", "src": "1079:5:43" } ] }, "documentation": null, "functionSelector": "2d4d800c", "id": 19618, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 19612, "modifierName": { "argumentTypes": null, "id": 19611, "name": "protected", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22231, "src": "1059:9:43", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1059:9:43" } ], "name": "protectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19610, "nodeType": "ParameterList", "parameters": [], "src": "1047:2:43" }, "returnParameters": { "id": 19613, "nodeType": "ParameterList", "parameters": [], "src": "1069:0:43" }, "scope": 19640, "src": "1023:68:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19624, "nodeType": "Block", "src": "1135:22:43", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19621, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19639, "src": "1145:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19622, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1145:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19623, "nodeType": "ExpressionStatement", "src": "1145:5:43" } ] }, "documentation": null, "functionSelector": "f86485d9", "id": 19625, "implemented": true, "kind": "function", "modifiers": [], "name": "unprotectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19619, "nodeType": "ParameterList", "parameters": [], "src": "1123:2:43" }, "returnParameters": { "id": 19620, "nodeType": "ParameterList", "parameters": [], "src": "1135:0:43" }, "scope": 19640, "src": "1097:60:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19638, "nodeType": "Block", "src": "1186:85:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19629, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "1196:7:43", "subExpression": { "argumentTypes": null, "id": 19628, "name": "calls", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19609, "src": "1196:5:43", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 19630, "nodeType": "ExpressionStatement", "src": "1196:7:43" }, { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 19632, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "1242:3:43", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 19633, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1242:10:43", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 19631, "name": "TestReentrancyGuardAttacker", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19605, "src": "1214:27:43", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_TestReentrancyGuardAttacker_$19605_$", "typeString": "type(contract TestReentrancyGuardAttacker)" } }, "id": 19634, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1214:39:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuardAttacker_$19605", "typeString": "contract TestReentrancyGuardAttacker" } }, "id": 19635, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "callback", "nodeType": "MemberAccess", "referencedDeclaration": 19604, "src": "1214:48:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1214:50:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19637, "nodeType": "ExpressionStatement", "src": "1214:50:43" } ] }, "documentation": null, "id": 19639, "implemented": true, "kind": "function", "modifiers": [], "name": "run", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19626, "nodeType": "ParameterList", "parameters": [], "src": "1175:2:43" }, "returnParameters": { "id": 19627, "nodeType": "ParameterList", "parameters": [], "src": "1186:0:43" }, "scope": 19640, "src": "1163:108:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "private" } ], "scope": 19641, "src": "942:331:43" } ], "src": "51:1223:43" }, "legacyAST": { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/helpers/TestReentrancyGuard.sol", "exportedSymbols": { "TestReentrancyGuard": [ 19640 ], "TestReentrancyGuardAttacker": [ 19605 ] }, "id": 19641, "license": "SEE LICENSE IN LICENSE", "nodeType": "SourceUnit", "nodes": [ { "id": 19528, "literals": [ "solidity", "0.6", ".12" ], "nodeType": "PragmaDirective", "src": "51:23:43" }, { "absolutePath": "/home/lash/src/ext/cic/grassrootseconomics/bancor-contracts/solidity/contracts/utility/ReentrancyGuard.sol", "file": "../utility/ReentrancyGuard.sol", "id": 19529, "nodeType": "ImportDirective", "scope": 19641, "sourceUnit": 22243, "src": "75:40:43", "symbolAliases": [], "unitAlias": "" }, { "abstract": false, "baseContracts": [], "contractDependencies": [], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 19605, "linearizedBaseContracts": [ 19605 ], "name": "TestReentrancyGuardAttacker", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "d4b83992", "id": 19531, "mutability": "mutable", "name": "target", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "161:33:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" }, "typeName": { "contractScope": null, "id": 19530, "name": "TestReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19640, "src": "161:19:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "e11f493e", "id": 19533, "mutability": "mutable", "name": "reentrancy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "200:22:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19532, "name": "bool", "nodeType": "ElementaryTypeName", "src": "200:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "17846e39", "id": 19535, "mutability": "mutable", "name": "callProtectedMethod", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "228:31:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19534, "name": "bool", "nodeType": "ElementaryTypeName", "src": "228:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "constant": false, "functionSelector": "3c0bbcd9", "id": 19537, "mutability": "mutable", "name": "attacking", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19605, "src": "265:21:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19536, "name": "bool", "nodeType": "ElementaryTypeName", "src": "265:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "public" }, { "body": { "id": 19546, "nodeType": "Block", "src": "341:33:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19544, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19542, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "351:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19543, "name": "_target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19539, "src": "360:7:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "src": "351:16:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19545, "nodeType": "ExpressionStatement", "src": "351:16:43" } ] }, "documentation": null, "id": 19547, "implemented": true, "kind": "constructor", "modifiers": [], "name": "", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19540, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19539, "mutability": "mutable", "name": "_target", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19547, "src": "305:27:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" }, "typeName": { "contractScope": null, "id": 19538, "name": "TestReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 19640, "src": "305:19:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "value": null, "visibility": "internal" } ], "src": "304:29:43" }, "returnParameters": { "id": 19541, "nodeType": "ParameterList", "parameters": [], "src": "341:0:43" }, "scope": 19605, "src": "293:81:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 19556, "nodeType": "Block", "src": "430:41:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19554, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19552, "name": "reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19533, "src": "440:10:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19553, "name": "_reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19549, "src": "453:11:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "440:24:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19555, "nodeType": "ExpressionStatement", "src": "440:24:43" } ] }, "documentation": null, "functionSelector": "322d5010", "id": 19557, "implemented": true, "kind": "function", "modifiers": [], "name": "setReentrancy", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19550, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19549, "mutability": "mutable", "name": "_reentrancy", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19557, "src": "403:16:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19548, "name": "bool", "nodeType": "ElementaryTypeName", "src": "403:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "402:18:43" }, "returnParameters": { "id": 19551, "nodeType": "ParameterList", "parameters": [], "src": "430:0:43" }, "scope": 19605, "src": "380:91:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19566, "nodeType": "Block", "src": "545:59:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19564, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19562, "name": "callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19535, "src": "555:19:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "id": 19563, "name": "_callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19559, "src": "577:20:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "src": "555:42:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19565, "nodeType": "ExpressionStatement", "src": "555:42:43" } ] }, "documentation": null, "functionSelector": "99563f10", "id": 19567, "implemented": true, "kind": "function", "modifiers": [], "name": "setCallProtectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19560, "nodeType": "ParameterList", "parameters": [ { "constant": false, "id": 19559, "mutability": "mutable", "name": "_callProtectedMethod", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19567, "src": "509:25:43", "stateVariable": false, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "typeName": { "id": 19558, "name": "bool", "nodeType": "ElementaryTypeName", "src": "509:4:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "value": null, "visibility": "internal" } ], "src": "508:27:43" }, "returnParameters": { "id": 19561, "nodeType": "ParameterList", "parameters": [], "src": "545:0:43" }, "scope": 19605, "src": "477:127:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19579, "nodeType": "Block", "src": "632:92:43", "statements": [ { "expression": { "argumentTypes": null, "condition": { "argumentTypes": null, "id": 19570, "name": "callProtectedMethod", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19535, "src": "642:19:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 19574, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "691:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19575, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "unprotectedMethod", "nodeType": "MemberAccess", "referencedDeclaration": 19625, "src": "691:24:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19576, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "691:26:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19577, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "Conditional", "src": "642:75:43", "trueExpression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "id": 19571, "name": "target", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19531, "src": "664:6:43", "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuard_$19640", "typeString": "contract TestReentrancyGuard" } }, "id": 19572, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "protectedMethod", "nodeType": "MemberAccess", "referencedDeclaration": 19618, "src": "664:22:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19573, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "664:24:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19578, "nodeType": "ExpressionStatement", "src": "642:75:43" } ] }, "documentation": null, "functionSelector": "c0406226", "id": 19580, "implemented": true, "kind": "function", "modifiers": [], "name": "run", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19568, "nodeType": "ParameterList", "parameters": [], "src": "622:2:43" }, "returnParameters": { "id": 19569, "nodeType": "ParameterList", "parameters": [], "src": "632:0:43" }, "scope": 19605, "src": "610:114:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "public" }, { "body": { "id": 19603, "nodeType": "Block", "src": "759:179:43", "statements": [ { "condition": { "argumentTypes": null, "id": 19584, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "773:11:43", "subExpression": { "argumentTypes": null, "id": 19583, "name": "reentrancy", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19533, "src": "774:10:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 19587, "nodeType": "IfStatement", "src": "769:48:43", "trueBody": { "id": 19586, "nodeType": "Block", "src": "786:31:43", "statements": [ { "expression": null, "functionReturnParameters": 19582, "id": 19585, "nodeType": "Return", "src": "800:7:43" } ] } }, { "condition": { "argumentTypes": null, "id": 19589, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "!", "prefix": true, "src": "831:10:43", "subExpression": { "argumentTypes": null, "id": 19588, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "832:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "falseBody": null, "id": 19598, "nodeType": "IfStatement", "src": "827:77:43", "trueBody": { "id": 19597, "nodeType": "Block", "src": "843:61:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19592, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19590, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "857:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "74727565", "id": 19591, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "869:4:43", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "true" }, "src": "857:16:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19593, "nodeType": "ExpressionStatement", "src": "857:16:43" }, { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19594, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19580, "src": "888:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19595, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "888:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19596, "nodeType": "ExpressionStatement", "src": "888:5:43" } ] } }, { "expression": { "argumentTypes": null, "id": 19601, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "leftHandSide": { "argumentTypes": null, "id": 19599, "name": "attacking", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19537, "src": "914:9:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "nodeType": "Assignment", "operator": "=", "rightHandSide": { "argumentTypes": null, "hexValue": "66616c7365", "id": 19600, "isConstant": false, "isLValue": false, "isPure": true, "kind": "bool", "lValueRequested": false, "nodeType": "Literal", "src": "926:5:43", "subdenomination": null, "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" }, "value": "false" }, "src": "914:17:43", "typeDescriptions": { "typeIdentifier": "t_bool", "typeString": "bool" } }, "id": 19602, "nodeType": "ExpressionStatement", "src": "914:17:43" } ] }, "documentation": null, "functionSelector": "083b2732", "id": 19604, "implemented": true, "kind": "function", "modifiers": [], "name": "callback", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19581, "nodeType": "ParameterList", "parameters": [], "src": "747:2:43" }, "returnParameters": { "id": 19582, "nodeType": "ParameterList", "parameters": [], "src": "759:0:43" }, "scope": 19605, "src": "730:208:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" } ], "scope": 19641, "src": "118:822:43" }, { "abstract": false, "baseContracts": [ { "arguments": null, "baseName": { "contractScope": null, "id": 19606, "name": "ReentrancyGuard", "nodeType": "UserDefinedTypeName", "referencedDeclaration": 22242, "src": "974:15:43", "typeDescriptions": { "typeIdentifier": "t_contract$_ReentrancyGuard_$22242", "typeString": "contract ReentrancyGuard" } }, "id": 19607, "nodeType": "InheritanceSpecifier", "src": "974:15:43" } ], "contractDependencies": [ 22242 ], "contractKind": "contract", "documentation": null, "fullyImplemented": true, "id": 19640, "linearizedBaseContracts": [ 19640, 22242 ], "name": "TestReentrancyGuard", "nodeType": "ContractDefinition", "nodes": [ { "constant": false, "functionSelector": "305f72b7", "id": 19609, "mutability": "mutable", "name": "calls", "nodeType": "VariableDeclaration", "overrides": null, "scope": 19640, "src": "996:20:43", "stateVariable": true, "storageLocation": "default", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" }, "typeName": { "id": 19608, "name": "uint256", "nodeType": "ElementaryTypeName", "src": "996:7:43", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "value": null, "visibility": "public" }, { "body": { "id": 19617, "nodeType": "Block", "src": "1069:22:43", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19614, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19639, "src": "1079:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19615, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1079:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19616, "nodeType": "ExpressionStatement", "src": "1079:5:43" } ] }, "documentation": null, "functionSelector": "2d4d800c", "id": 19618, "implemented": true, "kind": "function", "modifiers": [ { "arguments": null, "id": 19612, "modifierName": { "argumentTypes": null, "id": 19611, "name": "protected", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 22231, "src": "1059:9:43", "typeDescriptions": { "typeIdentifier": "t_modifier$__$", "typeString": "modifier ()" } }, "nodeType": "ModifierInvocation", "src": "1059:9:43" } ], "name": "protectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19610, "nodeType": "ParameterList", "parameters": [], "src": "1047:2:43" }, "returnParameters": { "id": 19613, "nodeType": "ParameterList", "parameters": [], "src": "1069:0:43" }, "scope": 19640, "src": "1023:68:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19624, "nodeType": "Block", "src": "1135:22:43", "statements": [ { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "id": 19621, "name": "run", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19639, "src": "1145:3:43", "typeDescriptions": { "typeIdentifier": "t_function_internal_nonpayable$__$returns$__$", "typeString": "function ()" } }, "id": 19622, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1145:5:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19623, "nodeType": "ExpressionStatement", "src": "1145:5:43" } ] }, "documentation": null, "functionSelector": "f86485d9", "id": 19625, "implemented": true, "kind": "function", "modifiers": [], "name": "unprotectedMethod", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19619, "nodeType": "ParameterList", "parameters": [], "src": "1123:2:43" }, "returnParameters": { "id": 19620, "nodeType": "ParameterList", "parameters": [], "src": "1135:0:43" }, "scope": 19640, "src": "1097:60:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "external" }, { "body": { "id": 19638, "nodeType": "Block", "src": "1186:85:43", "statements": [ { "expression": { "argumentTypes": null, "id": 19629, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "nodeType": "UnaryOperation", "operator": "++", "prefix": false, "src": "1196:7:43", "subExpression": { "argumentTypes": null, "id": 19628, "name": "calls", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19609, "src": "1196:5:43", "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "typeDescriptions": { "typeIdentifier": "t_uint256", "typeString": "uint256" } }, "id": 19630, "nodeType": "ExpressionStatement", "src": "1196:7:43" }, { "expression": { "argumentTypes": null, "arguments": [], "expression": { "argumentTypes": [], "expression": { "argumentTypes": null, "arguments": [ { "argumentTypes": null, "expression": { "argumentTypes": null, "id": 19632, "name": "msg", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": -15, "src": "1242:3:43", "typeDescriptions": { "typeIdentifier": "t_magic_message", "typeString": "msg" } }, "id": 19633, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "sender", "nodeType": "MemberAccess", "referencedDeclaration": null, "src": "1242:10:43", "typeDescriptions": { "typeIdentifier": "t_address_payable", "typeString": "address payable" } } ], "expression": { "argumentTypes": [ { "typeIdentifier": "t_address_payable", "typeString": "address payable" } ], "id": 19631, "name": "TestReentrancyGuardAttacker", "nodeType": "Identifier", "overloadedDeclarations": [], "referencedDeclaration": 19605, "src": "1214:27:43", "typeDescriptions": { "typeIdentifier": "t_type$_t_contract$_TestReentrancyGuardAttacker_$19605_$", "typeString": "type(contract TestReentrancyGuardAttacker)" } }, "id": 19634, "isConstant": false, "isLValue": false, "isPure": false, "kind": "typeConversion", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1214:39:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_contract$_TestReentrancyGuardAttacker_$19605", "typeString": "contract TestReentrancyGuardAttacker" } }, "id": 19635, "isConstant": false, "isLValue": false, "isPure": false, "lValueRequested": false, "memberName": "callback", "nodeType": "MemberAccess", "referencedDeclaration": 19604, "src": "1214:48:43", "typeDescriptions": { "typeIdentifier": "t_function_external_nonpayable$__$returns$__$", "typeString": "function () external" } }, "id": 19636, "isConstant": false, "isLValue": false, "isPure": false, "kind": "functionCall", "lValueRequested": false, "names": [], "nodeType": "FunctionCall", "src": "1214:50:43", "tryCall": false, "typeDescriptions": { "typeIdentifier": "t_tuple$__$", "typeString": "tuple()" } }, "id": 19637, "nodeType": "ExpressionStatement", "src": "1214:50:43" } ] }, "documentation": null, "id": 19639, "implemented": true, "kind": "function", "modifiers": [], "name": "run", "nodeType": "FunctionDefinition", "overrides": null, "parameters": { "id": 19626, "nodeType": "ParameterList", "parameters": [], "src": "1175:2:43" }, "returnParameters": { "id": 19627, "nodeType": "ParameterList", "parameters": [], "src": "1186:0:43" }, "scope": 19640, "src": "1163:108:43", "stateMutability": "nonpayable", "virtual": false, "visibility": "private" } ], "scope": 19641, "src": "942:331:43" } ], "src": "51:1223:43" }, "compiler": { "name": "solc", "version": "0.6.12+commit.27d51765.Emscripten.clang" }, "networks": {}, "schemaVersion": "3.2.3", "updatedAt": "2020-10-20T08:24:47.810Z", "devdoc": { "kind": "dev", "methods": {}, "version": 1 }, "userdoc": { "kind": "user", "methods": {}, "version": 1 } }