[ [ { "elements": [ { "type": "function", "name": "withdraw", "source_mapping": { "start": 671, "length": 286, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", "name": "Reentrancy", "source_mapping": { "start": 202, "length": 758, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], "starting_column": 1, "ending_column": 2 } }, "signature": "withdraw(address)" } }, { "type": "node", "name": "require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))", "source_mapping": { "start": 782, "length": 76, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 24 ], "starting_column": 9, "ending_column": 85 }, "type_specific_fields": { "parent": { "type": "function", "name": "withdraw", "source_mapping": { "start": 671, "length": 286, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", "name": "Reentrancy", "source_mapping": { "start": 202, "length": 758, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], "starting_column": 1, "ending_column": 2 } }, "signature": "withdraw(address)" } } }, "additional_fields": { "underlying_type": "external_calls" } }, { "type": "node", "name": "msg.sender.transfer(eth_deposed[token][msg.sender])", "source_mapping": { "start": 721, "length": 51, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 23 ], "starting_column": 9, "ending_column": 60 }, "type_specific_fields": { "parent": { "type": "function", "name": "withdraw", "source_mapping": { "start": 671, "length": 286, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", "name": "Reentrancy", "source_mapping": { "start": 202, "length": 758, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], "starting_column": 1, "ending_column": 2 } }, "signature": "withdraw(address)" } } }, "additional_fields": { "underlying_type": "external_calls_sending_eth" } }, { "type": "node", "name": "eth_deposed[token][msg.sender] = 0", "source_mapping": { "start": 869, "length": 34, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 26 ], "starting_column": 9, "ending_column": 43 }, "type_specific_fields": { "parent": { "type": "function", "name": "withdraw", "source_mapping": { "start": 671, "length": 286, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", "name": "Reentrancy", "source_mapping": { "start": 202, "length": 758, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], "starting_column": 1, "ending_column": 2 } }, "signature": "withdraw(address)" } } }, "additional_fields": { "underlying_type": "variables_written", "variable_name": "eth_deposed" } }, { "type": "node", "name": "token_deposed[token][msg.sender] = 0", "source_mapping": { "start": 913, "length": 36, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 27 ], "starting_column": 9, "ending_column": 45 }, "type_specific_fields": { "parent": { "type": "function", "name": "withdraw", "source_mapping": { "start": 671, "length": 286, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 22, 23, 24, 25, 26, 27, 28, 29 ], "starting_column": 5, "ending_column": 6 }, "type_specific_fields": { "parent": { "type": "contract", "name": "Reentrancy", "source_mapping": { "start": 202, "length": 758, "filename_relative": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol", "is_dependency": false, "lines": [ 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 ], "starting_column": 1, "ending_column": 2 } }, "signature": "withdraw(address)" } } }, "additional_fields": { "underlying_type": "variables_written", "variable_name": "token_deposed" } } ], "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#22-29):\n\tExternal calls:\n\t- require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender])) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#26)\n\tReentrancy.eth_deposed (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#10) can be used in cross function reentrancies:\n\t- Reentrancy.deposit_eth(address) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#13-15)\n\t- Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#22-29)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#27)\n\tReentrancy.token_deposed (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#11) can be used in cross function reentrancies:\n\t- Reentrancy.deposit_token(address,uint256) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#17-20)\n\t- Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#22-29)\n", "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L22-L29):\n\tExternal calls:\n\t- [require(bool)(Token(token).transfer(msg.sender,token_deposed[token][msg.sender]))](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L26)\n\t[Reentrancy.eth_deposed](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L10) can be used in cross function reentrancies:\n\t- [Reentrancy.deposit_eth(address)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L13-L15)\n\t- [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L22-L29)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L27)\n\t[Reentrancy.token_deposed](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L11) can be used in cross function reentrancies:\n\t- [Reentrancy.deposit_token(address,uint256)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L17-L20)\n\t- [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L22-L29)\n", "first_markdown_element": "tests/detectors/reentrancy-eth/0.5.16/reentrancy_indirect.sol#L22-L29", "id": "52cd1e82b29830aa25a1ea1bbc1b35c0e3097eab1f2922b4ecc98eae8f1ed225", "check": "reentrancy-eth", "impact": "High", "confidence": "Medium" } ] ]