From 3280291e1013e2b513cf8995b6166809676cf9d1 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 5 Apr 2021 16:24:12 +0200 Subject: [PATCH 01/13] PoC of new checklist --- slither/utils/command_line.py | 20 ++++++++++++-------- slither/utils/output.py | 10 ++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index 765bf93e0..eb0d86cc7 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -147,25 +147,29 @@ def convert_result_to_markdown(txt): def output_results_to_markdown(all_results): checks = defaultdict(list) + info = defaultdict(dict) for results in all_results: - checks[results["check"]].append(results["description"]) + checks[results["check"]].append(results) + info[results["check"]] = {"impact" : results["impact"], "confidence": results["confidence"]} print("Summary") for check in checks: print(f" - [{check}](#{check}) ({len(checks[check])} results)") + counter = 0 for (check, results) in checks.items(): print(f"## {check}") - print( - """ -| Analyzed | Description | -|----------------|-----------|""" - ) + print(f'Impact: {info[check]["impact"]}') + print(f'Confidence: {info[check]["confidence"]}') for result in results: - result_markdown = convert_result_to_markdown(result) print( - f"| | {result_markdown}" + " - [ ] ID-"+f"{counter}" ) + counter = counter + 1 + print(result["markdown"]) + if result["first_markdown_element"]: + print(result["first_markdown_element"]) + print('\n') def output_wiki(detector_classes, filter_wiki): diff --git a/slither/utils/output.py b/slither/utils/output.py index f1ded8a38..e9abce3d7 100644 --- a/slither/utils/output.py +++ b/slither/utils/output.py @@ -236,6 +236,14 @@ class Output: self._data["elements"] = [] self._data["description"] = "".join(_convert_to_description(d) for d in info) self._data["markdown"] = "".join(_convert_to_markdown(d, markdown_root) for d in info) + self._data["first_markdown_element"] = "" + self._markdown_root = markdown_root + + first_element_for_mardown = None + if info: + for elem in info: + if not isinstance(elem, str): + first_element_for_mardown = elem id_txt = "".join(_convert_to_id(d) for d in info) self._data["id"] = hashlib.sha3_256(id_txt.encode("utf-8")).hexdigest() @@ -250,6 +258,8 @@ class Output: self._data["additional_fields"] = additional_fields def add(self, add: SupportedOutput, additional_fields: Optional[Dict] = None): + if not self._data["first_markdown_element"]: + self._data["first_markdown_element"] = add.source_mapping_to_markdown(self._markdown_root) if isinstance(add, Variable): self.add_variable(add, additional_fields=additional_fields) elif isinstance(add, Contract): From c1aca4c956dbe0fd1b715384547df0223a45876f Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Fri, 9 Apr 2021 16:10:15 +0200 Subject: [PATCH 02/13] add unused-return-transfers detector + exclude transfer/transferFrom from unused-return detector --- slither/detectors/all_detectors.py | 1 + .../operations/unused_return_values.py | 8 +- .../unused_return_values_transfers.py | 96 ++++ .../unused_return_transfers.sol | 63 +++ ...sol.0.7.6.UnusedReturnValuesTransfers.json | 436 ++++++++++++++++++ .../unused-return/unused_return-sol7.sol | 78 ++++ ...urn-sol7.sol.0.7.6.UnusedReturnValues.json | 250 ++++++++++ tests/test_detectors.py | 10 + 8 files changed, 941 insertions(+), 1 deletion(-) create mode 100644 slither/detectors/operations/unused_return_values_transfers.py create mode 100644 tests/detectors/unused-return-transfers/unused_return_transfers.sol create mode 100644 tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json create mode 100644 tests/detectors/unused-return/unused_return-sol7.sol create mode 100644 tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json diff --git a/slither/detectors/all_detectors.py b/slither/detectors/all_detectors.py index e94eab330..488071ea5 100644 --- a/slither/detectors/all_detectors.py +++ b/slither/detectors/all_detectors.py @@ -21,6 +21,7 @@ from .statements.tx_origin import TxOrigin from .statements.assembly import Assembly from .operations.low_level_calls import LowLevelCalls from .operations.unused_return_values import UnusedReturnValues +from .operations.unused_return_values_transfers import UnusedReturnValuesTransfers from .naming_convention.naming_convention import NamingConvention from .functions.external_function import ExternalFunction from .statements.controlled_delegatecall import ControlledDelegateCall diff --git a/slither/detectors/operations/unused_return_values.py b/slither/detectors/operations/unused_return_values.py index 4d98f71da..8bbcf7988 100644 --- a/slither/detectors/operations/unused_return_values.py +++ b/slither/detectors/operations/unused_return_values.py @@ -5,6 +5,7 @@ Module detecting unused return values from external calls from slither.core.variables.state_variable import StateVariable from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification from slither.slithir.operations import HighLevelCall +from slither.core.declarations import Function class UnusedReturnValues(AbstractDetector): @@ -39,7 +40,12 @@ contract MyConc{ _txt_description = "external calls" def _is_instance(self, ir): # pylint: disable=no-self-use - return isinstance(ir, HighLevelCall) + return ( + isinstance(ir, HighLevelCall) + and isinstance(ir.function, Function) + and ir.function.solidity_signature + not in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] + ) def detect_unused_return_values(self, f): # pylint: disable=no-self-use """ diff --git a/slither/detectors/operations/unused_return_values_transfers.py b/slither/detectors/operations/unused_return_values_transfers.py new file mode 100644 index 000000000..ea54a1786 --- /dev/null +++ b/slither/detectors/operations/unused_return_values_transfers.py @@ -0,0 +1,96 @@ +""" +Module detecting unused transfer/transferFrom return values from external calls +""" + +from slither.core.variables.state_variable import StateVariable +from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification +from slither.slithir.operations import HighLevelCall +from slither.core.declarations import Function + + +class UnusedReturnValuesTransfers(AbstractDetector): + """ + If the return value of a transfer/transferFrom function is never used, it's likely to be bug + """ + + ARGUMENT = "unused-return-transfers" + HELP = "Unused transfer/transferFrom return values" + IMPACT = DetectorClassification.HIGH + CONFIDENCE = DetectorClassification.MEDIUM + + WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return-transfers" + + WIKI_TITLE = "Unused return" + WIKI_DESCRIPTION = ( + "The return value of an external transfer/transferFrom call is not used" + ) + WIKI_EXPLOIT_SCENARIO = """ +```solidity +contract Token { + function transfer(address _to, uint256 _value) public returns (bool success); + function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); +} +contract MyConc{ + function my_func1(Token tok, address to) public{ + tok.transfer(to, 1 ether); + } + function my_func2(Token tok, address to) public{ + tok.transferFrom(address(this), to, 1 ether); + } +} +``` +`MyConc` calls `transfer` or `transferFrom` on a token contract but does not check the return value. As a result, transfers that do not revert on failure will appear to have succeeded.""" + + WIKI_RECOMMENDATION = "Ensure that the returned boolean of all transfer and transferFrom function calls is checked." + + _txt_description = "external transfer calls" + + def _is_instance(self, ir): # pylint: disable=no-self-use + return ( + isinstance(ir, HighLevelCall) + and isinstance(ir.function, Function) + and ir.function.solidity_signature + in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] + ) + + def detect_unused_return_values(self, f): # pylint: disable=no-self-use + """ + Return the nodes where the return value of a call is unused + Args: + f (Function) + Returns: + list(Node) + """ + values_returned = [] + nodes_origin = {} + for n in f.nodes: + for ir in n.irs: + if self._is_instance(ir): + # if a return value is stored in a state variable, it's ok + if ir.lvalue and not isinstance(ir.lvalue, StateVariable): + values_returned.append(ir.lvalue) + nodes_origin[ir.lvalue] = ir + for read in ir.read: + if read in values_returned: + values_returned.remove(read) + + return [nodes_origin[value].node for value in values_returned] + + def _detect(self): + """Detect external transfer/transferFrom calls whose return value is not checked""" + results = [] + for c in self.slither.contracts: + for f in c.functions + c.modifiers: + if f.contract_declarer != c: + continue + unused_return = self.detect_unused_return_values(f) + if unused_return: + + for node in unused_return: + info = [f, " ignores return value of ", node, "\n"] + + res = self.generate_result(info) + + results.append(res) + + return results diff --git a/tests/detectors/unused-return-transfers/unused_return_transfers.sol b/tests/detectors/unused-return-transfers/unused_return_transfers.sol new file mode 100644 index 000000000..dc16943df --- /dev/null +++ b/tests/detectors/unused-return-transfers/unused_return_transfers.sol @@ -0,0 +1,63 @@ +contract Token { + function transfer(address _to, uint256 _value) public returns (bool success) { + return true; + } + function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { + return true; + } + function other() public returns (bool) { + return true; + } +} +contract C { + Token t; + + constructor() public { + t = new Token(); + } + + // calling the transfer function + function bad0() public{ + t.transfer(address(0), 1 ether); + } + function good0() public{ + bool a = t.transfer(address(0), 1 ether); + } + function good1() public{ + require(t.transfer(address(0), 1 ether), "failed"); + } + function good2() public{ + assert(t.transfer(address(0), 1 ether)); + } + function good3() public returns (bool) { + return t.transfer(address(0), 1 ether); + } + function good4() public returns (bool ret) { + ret = t.transfer(address(0), 1 ether); + } + + // calling the transferFrom function + function bad1() public { + t.transferFrom(address(this), address(0), 1 ether); + } + function good5() public{ + bool a = t.transferFrom(address(this), address(0), 1 ether); + } + function good6() public{ + require(t.transferFrom(address(this), address(0), 1 ether), "failed"); + } + function good7() public{ + assert(t.transferFrom(address(this), address(0), 1 ether)); + } + function good8() public returns (bool) { + return t.transferFrom(address(this), address(0), 1 ether); + } + function good9() public returns (bool ret) { + ret = t.transferFrom(address(this), address(0), 1 ether); + } + + // calling the other function + function good10() public { + t.other(); + } +} \ No newline at end of file diff --git a/tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json b/tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json new file mode 100644 index 000000000..69542c9cd --- /dev/null +++ b/tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json @@ -0,0 +1,436 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 461, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1456, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "t.transfer(address(0),1000000000000000000)", + "source_mapping": { + "start": 493, + "length": 31, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 21 + ], + "starting_column": 9, + "ending_column": 40 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 461, + "length": 70, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1456, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "C.bad0() (tests/detectors/unused-return-transfers/unused_return_transfers.sol#20-22) ignores return value of t.transfer(address(0),1000000000000000000) (tests/detectors/unused-return-transfers/unused_return_transfers.sol#21)\n", + "markdown": "[C.bad0()](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L20-L22) ignores return value of [t.transfer(address(0),1000000000000000000)](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L21)\n", + "id": "273f513954167c12160962f06a02a10088834be02327cd8d27edd32f28e6b930", + "check": "unused-return-transfers", + "impact": "High", + "confidence": "Medium" + }, + { + "elements": [ + { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 1043, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 40, + 41, + 42 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1456, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1()" + } + }, + { + "type": "node", + "name": "t.transferFrom(address(this),address(0),1000000000000000000)", + "source_mapping": { + "start": 1076, + "length": 50, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 41 + ], + "starting_column": 9, + "ending_column": 59 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad1", + "source_mapping": { + "start": 1043, + "length": 90, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 40, + 41, + 42 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1456, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad1()" + } + } + } + } + ], + "description": "C.bad1() (tests/detectors/unused-return-transfers/unused_return_transfers.sol#40-42) ignores return value of t.transferFrom(address(this),address(0),1000000000000000000) (tests/detectors/unused-return-transfers/unused_return_transfers.sol#41)\n", + "markdown": "[C.bad1()](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L40-L42) ignores return value of [t.transferFrom(address(this),address(0),1000000000000000000)](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L41)\n", + "id": "41be6c49206e7b40a8d6ac10260a60bff5f876839d951ac20b3a38ac5185c0ae", + "check": "unused-return-transfers", + "impact": "High", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/detectors/unused-return/unused_return-sol7.sol b/tests/detectors/unused-return/unused_return-sol7.sol new file mode 100644 index 000000000..ddbc127da --- /dev/null +++ b/tests/detectors/unused-return/unused_return-sol7.sol @@ -0,0 +1,78 @@ +contract Token { + function transfer(address _to, uint256 _value) public returns (bool success) { + return true; + } + function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { + return true; + } + function other() public returns (bool) { + return true; + } +} +contract C { + Token t; + + constructor() public { + t = new Token(); + } + + // calling the transfer function + function good0() public{ + t.transfer(address(0), 1 ether); + } + function good1() public{ + bool a = t.transfer(address(0), 1 ether); + } + function good2() public{ + require(t.transfer(address(0), 1 ether), "failed"); + } + function good3() public{ + assert(t.transfer(address(0), 1 ether)); + } + function good4() public returns (bool) { + return t.transfer(address(0), 1 ether); + } + function good5() public returns (bool ret) { + ret = t.transfer(address(0), 1 ether); + } + + // calling the transferFrom function + function good6() public { + t.transferFrom(address(this), address(0), 1 ether); + } + function good7() public{ + bool a = t.transferFrom(address(this), address(0), 1 ether); + } + function good8() public{ + require(t.transferFrom(address(this), address(0), 1 ether), "failed"); + } + function good9() public{ + assert(t.transferFrom(address(this), address(0), 1 ether)); + } + function good10() public returns (bool) { + return t.transferFrom(address(this), address(0), 1 ether); + } + function good11() public returns (bool ret) { + ret = t.transferFrom(address(this), address(0), 1 ether); + } + + // calling the other function + function bad0() public { + t.other(); + } + function good12() public{ + bool a = t.other(); + } + function good13() public{ + require(t.other(), "failed"); + } + function good14() public{ + assert(t.other()); + } + function good15() public returns (bool) { + return t.other(); + } + function good16() public returns (bool ret) { + ret = t.other(); + } +} \ No newline at end of file diff --git a/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json b/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json new file mode 100644 index 000000000..c17b605ec --- /dev/null +++ b/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json @@ -0,0 +1,250 @@ +[ + [ + { + "elements": [ + { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 1737, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/unused_return-sol7.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/unused_return-sol7.sol", + "is_dependency": false, + "lines": [ + 60, + 61, + 62 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1818, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/unused_return-sol7.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/unused_return-sol7.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + }, + { + "type": "node", + "name": "t.other()", + "source_mapping": { + "start": 1770, + "length": 9, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/unused_return-sol7.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/unused_return-sol7.sol", + "is_dependency": false, + "lines": [ + 61 + ], + "starting_column": 9, + "ending_column": 18 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "bad0", + "source_mapping": { + "start": 1737, + "length": 49, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/unused_return-sol7.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/unused_return-sol7.sol", + "is_dependency": false, + "lines": [ + 60, + 61, + 62 + ], + "starting_column": 5, + "ending_column": 6 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "C", + "source_mapping": { + "start": 330, + "length": 1818, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/unused-return/unused_return-sol7.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/unused-return/unused_return-sol7.sol", + "is_dependency": false, + "lines": [ + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79 + ], + "starting_column": 1, + "ending_column": 0 + } + }, + "signature": "bad0()" + } + } + } + } + ], + "description": "C.bad0() (tests/detectors/unused-return/unused_return-sol7.sol#60-62) ignores return value by t.other() (tests/detectors/unused-return/unused_return-sol7.sol#61)\n", + "markdown": "[C.bad0()](tests/detectors/unused-return/unused_return-sol7.sol#L60-L62) ignores return value by [t.other()](tests/detectors/unused-return/unused_return-sol7.sol#L61)\n", + "id": "f9924f5b012de6c1e91b68996bc7944585b0daab740b86c89cd157b0d22d0092", + "check": "unused-return", + "impact": "Medium", + "confidence": "Medium" + } + ] +] \ No newline at end of file diff --git a/tests/test_detectors.py b/tests/test_detectors.py index b3bb4a50e..6fd733adf 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -251,6 +251,16 @@ ALL_TESTS = [ Test( all_detectors.UnusedReturnValues, "tests/detectors/unused-return/unused_return.sol", "0.5.1" ), + Test( + all_detectors.UnusedReturnValues, + "tests/detectors/unused-return/unused_return-sol7.sol", + "0.7.6", + ), + Test( + all_detectors.UnusedReturnValuesTransfers, + "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "0.7.6", + ), Test( all_detectors.ShadowingAbstractDetection, "tests/detectors/shadowing-abstract/shadowing_abstract.sol", From 27805495f39c91392d35c3693f37682e7fcca8e4 Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Fri, 9 Apr 2021 16:13:30 +0200 Subject: [PATCH 03/13] update wiki title var --- slither/detectors/operations/unused_return_values_transfers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slither/detectors/operations/unused_return_values_transfers.py b/slither/detectors/operations/unused_return_values_transfers.py index ea54a1786..92aec9439 100644 --- a/slither/detectors/operations/unused_return_values_transfers.py +++ b/slither/detectors/operations/unused_return_values_transfers.py @@ -20,7 +20,7 @@ class UnusedReturnValuesTransfers(AbstractDetector): WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return-transfers" - WIKI_TITLE = "Unused return" + WIKI_TITLE = "Unused return transfers" WIKI_DESCRIPTION = ( "The return value of an external transfer/transferFrom call is not used" ) From 9b9879214bcf005102053b1079efe8dbe74f4b45 Mon Sep 17 00:00:00 2001 From: Alexander Remie Date: Fri, 9 Apr 2021 16:39:11 +0200 Subject: [PATCH 04/13] black fix --- .../detectors/operations/unused_return_values_transfers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/slither/detectors/operations/unused_return_values_transfers.py b/slither/detectors/operations/unused_return_values_transfers.py index 92aec9439..8a3229f60 100644 --- a/slither/detectors/operations/unused_return_values_transfers.py +++ b/slither/detectors/operations/unused_return_values_transfers.py @@ -21,9 +21,7 @@ class UnusedReturnValuesTransfers(AbstractDetector): WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return-transfers" WIKI_TITLE = "Unused return transfers" - WIKI_DESCRIPTION = ( - "The return value of an external transfer/transferFrom call is not used" - ) + WIKI_DESCRIPTION = "The return value of an external transfer/transferFrom call is not used" WIKI_EXPLOIT_SCENARIO = """ ```solidity contract Token { From c2f7773aa78d4e53ab985ba9df4afadf6a6b4a50 Mon Sep 17 00:00:00 2001 From: Josselin Date: Mon, 19 Apr 2021 15:23:53 +0200 Subject: [PATCH 05/13] Minor modif to the unchecked-return-transfer - Inherits from Unused return (avoid duplicate code) - Rename unchecked-return - Update description/recommendations Additionally removed txt_description from all the UnusedReturn derived class (its not used anymore) --- slither/detectors/all_detectors.py | 2 +- .../unchecked_low_level_return_values.py | 2 - .../operations/unchecked_send_return_value.py | 2 - .../operations/unchecked_transfer.py | 51 ++++++++++ .../operations/unused_return_values.py | 14 +-- .../unused_return_values_transfers.py | 94 ------------------- .../unused_return_transfers.sol | 0 ...ransfers.sol.0.7.6.UncheckedTransfer.json} | 56 +++++------ tests/test_detectors.py | 4 +- 9 files changed, 89 insertions(+), 136 deletions(-) create mode 100644 slither/detectors/operations/unchecked_transfer.py delete mode 100644 slither/detectors/operations/unused_return_values_transfers.py rename tests/detectors/{unused-return-transfers => unchecked-transfer}/unused_return_transfers.sol (100%) rename tests/detectors/{unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json => unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json} (87%) diff --git a/slither/detectors/all_detectors.py b/slither/detectors/all_detectors.py index 488071ea5..bbf9464d3 100644 --- a/slither/detectors/all_detectors.py +++ b/slither/detectors/all_detectors.py @@ -21,7 +21,7 @@ from .statements.tx_origin import TxOrigin from .statements.assembly import Assembly from .operations.low_level_calls import LowLevelCalls from .operations.unused_return_values import UnusedReturnValues -from .operations.unused_return_values_transfers import UnusedReturnValuesTransfers +from .operations.unchecked_transfer import UncheckedTransfer from .naming_convention.naming_convention import NamingConvention from .functions.external_function import ExternalFunction from .statements.controlled_delegatecall import ControlledDelegateCall diff --git a/slither/detectors/operations/unchecked_low_level_return_values.py b/slither/detectors/operations/unchecked_low_level_return_values.py index c2ac7f43b..8ecec9f1d 100644 --- a/slither/detectors/operations/unchecked_low_level_return_values.py +++ b/slither/detectors/operations/unchecked_low_level_return_values.py @@ -34,7 +34,5 @@ If the low level is used to prevent blocking operations, consider logging failed WIKI_RECOMMENDATION = "Ensure that the return value of a low-level call is checked or logged." - _txt_description = "low-level calls" - def _is_instance(self, ir): # pylint: disable=no-self-use return isinstance(ir, LowLevelCall) diff --git a/slither/detectors/operations/unchecked_send_return_value.py b/slither/detectors/operations/unchecked_send_return_value.py index 1c9ba11c0..d98ec3317 100644 --- a/slither/detectors/operations/unchecked_send_return_value.py +++ b/slither/detectors/operations/unchecked_send_return_value.py @@ -35,7 +35,5 @@ If `send` is used to prevent blocking operations, consider logging the failed `s WIKI_RECOMMENDATION = "Ensure that the return value of `send` is checked or logged." - _txt_description = "send calls" - def _is_instance(self, ir): # pylint: disable=no-self-use return isinstance(ir, Send) diff --git a/slither/detectors/operations/unchecked_transfer.py b/slither/detectors/operations/unchecked_transfer.py new file mode 100644 index 000000000..36456e3e0 --- /dev/null +++ b/slither/detectors/operations/unchecked_transfer.py @@ -0,0 +1,51 @@ +""" +Module detecting unused transfer/transferFrom return values from external calls +""" + +from slither.core.declarations import Function +from slither.detectors.abstract_detector import DetectorClassification +from slither.detectors.operations.unused_return_values import UnusedReturnValues +from slither.slithir.operations import HighLevelCall + + +class UncheckedTransfer(UnusedReturnValues): + """ + If the return value of a transfer/transferFrom function is never used, it's likely to be bug + """ + + ARGUMENT = "unchecked-transfer" + HELP = "Unchecked tokens transfer" + IMPACT = DetectorClassification.HIGH + CONFIDENCE = DetectorClassification.MEDIUM + + WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unchecked-transfer" + + WIKI_TITLE = "Unchecked transfer" + WIKI_DESCRIPTION = "The return value of an external transfer/transferFrom call is not checked" + WIKI_EXPLOIT_SCENARIO = """ +```solidity +contract Token { + function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); +} +contract MyBank{ + mapping(address => uint) balances; + Token token; + function deposit(uint amount) public{ + token.transferFrom(msg.sender, address(this), amount); + balances[msg.sender] += amount; + } +} +``` +Several tokens do not revert in case of failure and return false. If one of these tokens is used in `MyBank`, `deposit` will not revert if the transfer fails, and an attacker can call `deposit` for free..""" + + WIKI_RECOMMENDATION = ( + "Use `SafeERC20`, or ensure that the transfer/transferFrom return value is checked." + ) + + def _is_instance(self, ir): # pylint: disable=no-self-use + return ( + isinstance(ir, HighLevelCall) + and isinstance(ir.function, Function) + and ir.function.solidity_signature + in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] + ) diff --git a/slither/detectors/operations/unused_return_values.py b/slither/detectors/operations/unused_return_values.py index 8bbcf7988..7ba4211d8 100644 --- a/slither/detectors/operations/unused_return_values.py +++ b/slither/detectors/operations/unused_return_values.py @@ -37,14 +37,14 @@ contract MyConc{ WIKI_RECOMMENDATION = "Ensure that all the return values of the function calls are used." - _txt_description = "external calls" - def _is_instance(self, ir): # pylint: disable=no-self-use - return ( - isinstance(ir, HighLevelCall) - and isinstance(ir.function, Function) - and ir.function.solidity_signature - not in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] + return isinstance(ir, HighLevelCall) and ( + ( + isinstance(ir.function, Function) + and ir.function.solidity_signature + not in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] + ) + or not isinstance(ir.function, Function) ) def detect_unused_return_values(self, f): # pylint: disable=no-self-use diff --git a/slither/detectors/operations/unused_return_values_transfers.py b/slither/detectors/operations/unused_return_values_transfers.py deleted file mode 100644 index 8a3229f60..000000000 --- a/slither/detectors/operations/unused_return_values_transfers.py +++ /dev/null @@ -1,94 +0,0 @@ -""" -Module detecting unused transfer/transferFrom return values from external calls -""" - -from slither.core.variables.state_variable import StateVariable -from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification -from slither.slithir.operations import HighLevelCall -from slither.core.declarations import Function - - -class UnusedReturnValuesTransfers(AbstractDetector): - """ - If the return value of a transfer/transferFrom function is never used, it's likely to be bug - """ - - ARGUMENT = "unused-return-transfers" - HELP = "Unused transfer/transferFrom return values" - IMPACT = DetectorClassification.HIGH - CONFIDENCE = DetectorClassification.MEDIUM - - WIKI = "https://github.com/crytic/slither/wiki/Detector-Documentation#unused-return-transfers" - - WIKI_TITLE = "Unused return transfers" - WIKI_DESCRIPTION = "The return value of an external transfer/transferFrom call is not used" - WIKI_EXPLOIT_SCENARIO = """ -```solidity -contract Token { - function transfer(address _to, uint256 _value) public returns (bool success); - function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); -} -contract MyConc{ - function my_func1(Token tok, address to) public{ - tok.transfer(to, 1 ether); - } - function my_func2(Token tok, address to) public{ - tok.transferFrom(address(this), to, 1 ether); - } -} -``` -`MyConc` calls `transfer` or `transferFrom` on a token contract but does not check the return value. As a result, transfers that do not revert on failure will appear to have succeeded.""" - - WIKI_RECOMMENDATION = "Ensure that the returned boolean of all transfer and transferFrom function calls is checked." - - _txt_description = "external transfer calls" - - def _is_instance(self, ir): # pylint: disable=no-self-use - return ( - isinstance(ir, HighLevelCall) - and isinstance(ir.function, Function) - and ir.function.solidity_signature - in ["transfer(address,uint256)", "transferFrom(address,address,uint256)"] - ) - - def detect_unused_return_values(self, f): # pylint: disable=no-self-use - """ - Return the nodes where the return value of a call is unused - Args: - f (Function) - Returns: - list(Node) - """ - values_returned = [] - nodes_origin = {} - for n in f.nodes: - for ir in n.irs: - if self._is_instance(ir): - # if a return value is stored in a state variable, it's ok - if ir.lvalue and not isinstance(ir.lvalue, StateVariable): - values_returned.append(ir.lvalue) - nodes_origin[ir.lvalue] = ir - for read in ir.read: - if read in values_returned: - values_returned.remove(read) - - return [nodes_origin[value].node for value in values_returned] - - def _detect(self): - """Detect external transfer/transferFrom calls whose return value is not checked""" - results = [] - for c in self.slither.contracts: - for f in c.functions + c.modifiers: - if f.contract_declarer != c: - continue - unused_return = self.detect_unused_return_values(f) - if unused_return: - - for node in unused_return: - info = [f, " ignores return value of ", node, "\n"] - - res = self.generate_result(info) - - results.append(res) - - return results diff --git a/tests/detectors/unused-return-transfers/unused_return_transfers.sol b/tests/detectors/unchecked-transfer/unused_return_transfers.sol similarity index 100% rename from tests/detectors/unused-return-transfers/unused_return_transfers.sol rename to tests/detectors/unchecked-transfer/unused_return_transfers.sol diff --git a/tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json b/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json similarity index 87% rename from tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json rename to tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json index 69542c9cd..9de6e71b1 100644 --- a/tests/detectors/unused-return-transfers/unused_return_transfers.sol.0.7.6.UnusedReturnValuesTransfers.json +++ b/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json @@ -9,9 +9,9 @@ "start": 461, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 20, @@ -29,9 +29,9 @@ "start": 330, "length": 1456, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 12, @@ -102,9 +102,9 @@ "start": 493, "length": 31, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 21 @@ -120,9 +120,9 @@ "start": 461, "length": 70, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 20, @@ -140,9 +140,9 @@ "start": 330, "length": 1456, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 12, @@ -209,10 +209,10 @@ } } ], - "description": "C.bad0() (tests/detectors/unused-return-transfers/unused_return_transfers.sol#20-22) ignores return value of t.transfer(address(0),1000000000000000000) (tests/detectors/unused-return-transfers/unused_return_transfers.sol#21)\n", - "markdown": "[C.bad0()](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L20-L22) ignores return value of [t.transfer(address(0),1000000000000000000)](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L21)\n", - "id": "273f513954167c12160962f06a02a10088834be02327cd8d27edd32f28e6b930", - "check": "unused-return-transfers", + "description": "C.bad0() (tests/detectors/unchecked-transfer/unused_return_transfers.sol#20-22) ignores return value by t.transfer(address(0),1000000000000000000) (tests/detectors/unchecked-transfer/unused_return_transfers.sol#21)\n", + "markdown": "[C.bad0()](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L20-L22) ignores return value by [t.transfer(address(0),1000000000000000000)](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L21)\n", + "id": "c999626efabdf72014bbebbdecd64178176d168947ae803ebbbd873941a6ed7e", + "check": "unchecked-transfer", "impact": "High", "confidence": "Medium" }, @@ -225,9 +225,9 @@ "start": 1043, "length": 90, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 40, @@ -245,9 +245,9 @@ "start": 330, "length": 1456, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 12, @@ -318,9 +318,9 @@ "start": 1076, "length": 50, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 41 @@ -336,9 +336,9 @@ "start": 1043, "length": 90, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 40, @@ -356,9 +356,9 @@ "start": 330, "length": 1456, "filename_used": "/GENERIC_PATH", - "filename_relative": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_relative": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "filename_absolute": "/GENERIC_PATH", - "filename_short": "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + "filename_short": "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "is_dependency": false, "lines": [ 12, @@ -425,10 +425,10 @@ } } ], - "description": "C.bad1() (tests/detectors/unused-return-transfers/unused_return_transfers.sol#40-42) ignores return value of t.transferFrom(address(this),address(0),1000000000000000000) (tests/detectors/unused-return-transfers/unused_return_transfers.sol#41)\n", - "markdown": "[C.bad1()](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L40-L42) ignores return value of [t.transferFrom(address(this),address(0),1000000000000000000)](tests/detectors/unused-return-transfers/unused_return_transfers.sol#L41)\n", - "id": "41be6c49206e7b40a8d6ac10260a60bff5f876839d951ac20b3a38ac5185c0ae", - "check": "unused-return-transfers", + "description": "C.bad1() (tests/detectors/unchecked-transfer/unused_return_transfers.sol#40-42) ignores return value by t.transferFrom(address(this),address(0),1000000000000000000) (tests/detectors/unchecked-transfer/unused_return_transfers.sol#41)\n", + "markdown": "[C.bad1()](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L40-L42) ignores return value by [t.transferFrom(address(this),address(0),1000000000000000000)](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L41)\n", + "id": "d4c9ecd3753df951f9b2c890f54f981285d42500cd41e5dfc2f46f2feb1dbe6e", + "check": "unchecked-transfer", "impact": "High", "confidence": "Medium" } diff --git a/tests/test_detectors.py b/tests/test_detectors.py index 6fd733adf..5b707d7bf 100644 --- a/tests/test_detectors.py +++ b/tests/test_detectors.py @@ -257,8 +257,8 @@ ALL_TESTS = [ "0.7.6", ), Test( - all_detectors.UnusedReturnValuesTransfers, - "tests/detectors/unused-return-transfers/unused_return_transfers.sol", + all_detectors.UncheckedTransfer, + "tests/detectors/unchecked-transfer/unused_return_transfers.sol", "0.7.6", ), Test( From 047ca4071d9a7f221efa31d980c4e5802ef0d106 Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 21 Apr 2021 14:40:54 +0200 Subject: [PATCH 06/13] Fix incorrect type conversion in case of libraries lookup name collision --- .../library_implicit_conversion-0.4.0.sol | 1 + .../library_implicit_conversion-0.5.0.sol | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 tests/ast-parsing/library_implicit_conversion-0.4.0.sol create mode 100644 tests/ast-parsing/library_implicit_conversion-0.5.0.sol diff --git a/tests/ast-parsing/library_implicit_conversion-0.4.0.sol b/tests/ast-parsing/library_implicit_conversion-0.4.0.sol new file mode 100644 index 000000000..b09d2929f --- /dev/null +++ b/tests/ast-parsing/library_implicit_conversion-0.4.0.sol @@ -0,0 +1 @@ +// test only above 0.5 diff --git a/tests/ast-parsing/library_implicit_conversion-0.5.0.sol b/tests/ast-parsing/library_implicit_conversion-0.5.0.sol new file mode 100644 index 000000000..462615e19 --- /dev/null +++ b/tests/ast-parsing/library_implicit_conversion-0.5.0.sol @@ -0,0 +1,57 @@ +library LibByte{ + function t(uint, bytes1) internal returns(uint){ + return 0x1; + } + function t(uint, bytes32) internal returns(uint){ + return 0x32; + } + +} + + +contract TestByte{ + using LibByte for uint; + function test() public returns(uint){ + uint a; + return a.t(0x10); // for byte, this will match only bytes1 + } +} + +library LibUint{ + function t(uint, uint8) internal returns(uint){ + return 0x1; + } + function t(uint, uint256) internal returns(uint){ + return 0x32; + } + +} + +contract TestUint{ + + using LibUint for uint; + function test() public returns(uint){ + uint a; + return a.t(2**8); // above uint8 + } +} + +library LibInt{ + function t(uint, int8) internal returns(uint){ + return 0x1; + } + function t(uint, int256) internal returns(uint){ + return 0x32; + } + +} + +contract TestUintWithVariableiAndConversion{ + + using LibInt for uint; + function test() public returns(uint){ + uint a; + int16 v; + return a.t(v); // above uint8 + } +} From 8e4d93e9ff8acc2cd19801ee0f1f2dcfbefa04c7 Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 21 Apr 2021 14:43:10 +0200 Subject: [PATCH 07/13] Commit changes --- slither/core/declarations/__init__.py | 1 + slither/core/declarations/contract.py | 25 +- .../core/solidity_types/elementary_type.py | 12 +- slither/slithir/convert.py | 237 ++++++++++++------ slither/slithir/operations/library_call.py | 8 +- .../library_implicit_conversion-0.4.0.sol | 3 + 6 files changed, 193 insertions(+), 93 deletions(-) diff --git a/slither/core/declarations/__init__.py b/slither/core/declarations/__init__.py index d3fe3dd22..3b619c1d1 100644 --- a/slither/core/declarations/__init__.py +++ b/slither/core/declarations/__init__.py @@ -13,3 +13,4 @@ from .solidity_variables import ( from .structure import Structure from .enum_contract import EnumContract from .structure_contract import StructureContract +from .function_contract import FunctionContract diff --git a/slither/core/declarations/contract.py b/slither/core/declarations/contract.py index f16b0e70c..8c91fde28 100644 --- a/slither/core/declarations/contract.py +++ b/slither/core/declarations/contract.py @@ -25,7 +25,14 @@ from slither.utils.tests_pattern import is_test_contract # pylint: disable=too-many-lines,too-many-instance-attributes,import-outside-toplevel,too-many-nested-blocks if TYPE_CHECKING: from slither.utils.type_helpers import LibraryCallType, HighLevelCallType, InternalCallType - from slither.core.declarations import Enum, Event, Modifier, EnumContract, StructureContract + from slither.core.declarations import ( + Enum, + Event, + Modifier, + EnumContract, + StructureContract, + FunctionContract, + ) from slither.slithir.variables.variable import SlithIRVariable from slither.core.variables.variable import Variable from slither.core.variables.state_variable import StateVariable @@ -56,7 +63,7 @@ class Contract(ChildSlither, SourceMapping): # pylint: disable=too-many-public- self._variables: Dict[str, "StateVariable"] = {} self._variables_ordered: List["StateVariable"] = [] self._modifiers: Dict[str, "Modifier"] = {} - self._functions: Dict[str, "Function"] = {} + self._functions: Dict[str, "FunctionContract"] = {} self._linearizedBaseContracts = List[int] # The only str is "*" @@ -387,23 +394,23 @@ class Contract(ChildSlither, SourceMapping): # pylint: disable=too-many-public- return self._signatures_declared @property - def functions(self) -> List["Function"]: + def functions(self) -> List["FunctionContract"]: """ list(Function): List of the functions """ return list(self._functions.values()) - def available_functions_as_dict(self) -> Dict[str, "Function"]: + def available_functions_as_dict(self) -> Dict[str, "FunctionContract"]: if self._available_functions_as_dict is None: self._available_functions_as_dict = { f.full_name: f for f in self._functions.values() if not f.is_shadowed } return self._available_functions_as_dict - def add_function(self, func: "Function"): + def add_function(self, func: "FunctionContract"): self._functions[func.canonical_name] = func - def set_functions(self, functions: Dict[str, "Function"]): + def set_functions(self, functions: Dict[str, "FunctionContract"]): """ Set the functions @@ -413,21 +420,21 @@ class Contract(ChildSlither, SourceMapping): # pylint: disable=too-many-public- self._functions = functions @property - def functions_inherited(self) -> List["Function"]: + def functions_inherited(self) -> List["FunctionContract"]: """ list(Function): List of the inherited functions """ return [f for f in self.functions if f.contract_declarer != self] @property - def functions_declared(self) -> List["Function"]: + def functions_declared(self) -> List["FunctionContract"]: """ list(Function): List of the functions defined within the contract (not inherited) """ return [f for f in self.functions if f.contract_declarer == self] @property - def functions_entry_points(self) -> List["Function"]: + def functions_entry_points(self) -> List["FunctionContract"]: """ list(Functions): List of public and external functions """ diff --git a/slither/core/solidity_types/elementary_type.py b/slither/core/solidity_types/elementary_type.py index abb7852d9..dd4d3db75 100644 --- a/slither/core/solidity_types/elementary_type.py +++ b/slither/core/solidity_types/elementary_type.py @@ -85,8 +85,6 @@ Uint = [ Max_Uint = {k: 2 ** (8 * i) - 1 if i > 0 else 2 ** 256 - 1 for i, k in enumerate(Uint)} Min_Uint = {k: 0 for k in Uint} -MaxValues = dict(Max_Int, **Max_Uint) -MinValues = dict(Min_Int, **Min_Uint) Byte = [ "byte", @@ -125,6 +123,16 @@ Byte = [ "bytes32", ] +Max_Byte = {k: 2 ** (8 * (i + 1)) - 1 for i, k in enumerate(Byte[2:])} +Max_Byte["bytes"] = None +Max_Byte["byte"] = 255 +Min_Byte = {k: 1 << (4 + 8 * i) for i, k in enumerate(Byte[2:])} +Min_Byte["bytes"] = 0x0 +Min_Byte["byte"] = 0x10 + +MaxValues = dict(dict(Max_Int, **Max_Uint), **Max_Byte) +MinValues = dict(dict(Min_Int, **Min_Uint), **Min_Byte) + # https://solidity.readthedocs.io/en/v0.4.24/types.html#fixed-point-numbers M = list(range(8, 257, 8)) N = list(range(0, 81)) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index f9fdc79cf..a4ce5e217 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -1,5 +1,5 @@ import logging -from typing import List, TYPE_CHECKING +from typing import List, TYPE_CHECKING, Union, Optional # pylint: disable= too-many-lines,import-outside-toplevel,too-many-branches,too-many-statements,too-many-nested-blocks from slither.core.declarations import ( @@ -22,7 +22,12 @@ from slither.core.solidity_types import ( UserDefinedType, TypeInformation, ) -from slither.core.solidity_types.elementary_type import Int as ElementaryTypeInt +from slither.core.solidity_types.elementary_type import ( + Int as ElementaryTypeInt, + Uint, + Byte, + MaxValues, +) from slither.core.solidity_types.type import Type from slither.core.variables.function_type_variable import FunctionTypeVariable from slither.core.variables.state_variable import StateVariable @@ -60,6 +65,7 @@ from slither.slithir.operations import ( Unary, Unpack, Nop, + Operation, ) from slither.slithir.operations.codesize import CodeSize from slither.slithir.tmp_operations.argument import Argument, ArgumentType @@ -148,64 +154,111 @@ def is_gas(ins): return False -def get_sig(ir, name): - """ - Return a list of potential signature - It is a list, as Constant variables can be converted to int256 - Args: - ir (slithIR.operation) - Returns: - list(str) +def _fits_under_integer(val: int, can_be_int: bool, can_be_uint) -> List[str]: """ - sig = "{}({})" + Return the list of uint/int that can contain val - # list of list of arguments - argss = convert_arguments(ir.arguments) - return [sig.format(name, ",".join(args)) for args in argss] + :param val: + :return: + """ + ret: List[str] = [] + n = 8 + assert can_be_int | can_be_uint + while n <= 256: + if can_be_uint: + if val <= 2 ** n - 1: + ret.append(f"uint{n}") + if can_be_int: + if val <= (2 ** n) / 2 - 1: + ret.append(f"int{n}") + n = n + 8 + return ret -def get_canonical_names(ir, function_name, contract_name): +def _fits_under_byte(val: Union[int, str]) -> List[str]: """ - Return a list of potential signature - It is a list, as Constant variables can be converted to int256 - Args: - ir (slithIR.operation) - Returns: - list(str) + Return the list of byte that can contain val + + :param val: + :return: """ - sig = "{}({})" - # list of list of arguments - argss = convert_arguments(ir.arguments) - return [sig.format(f"{contract_name}.{function_name}", ",".join(args)) for args in argss] + # If the value is written as an int, it can only be saved in one byte size + # If its a string, it can be fitted under multiple values + + if isinstance(val, int): + hex_val = hex(val)[2:] + size = len(hex_val) // 2 + return [f"byte{size}"] + # val is a str + length = len(val.encode("utf-8")) + return [f"byte{f}" for f in range(length, 32)] + +def _find_function_from_parameter(ir: Call, candidates: List[Function]) -> Optional[Function]: + """ + Look for a function in candidates that can be the target of the ir's call + + Try the implicit type conversion for uint/int/bytes. Constant values can be both uint/int + While variables stick to their base type, but can changed the size -def convert_arguments(arguments): - argss = [[]] - for arg in arguments: + :param ir: + :param candidates: + :return: + """ + arguments = ir.arguments + type_args: List[str] + for idx, arg in enumerate(arguments): if isinstance(arg, (list,)): - type_arg = "{}[{}]".format(get_type(arg[0].type), len(arg)) + type_args = ["{}[{}]".format(get_type(arg[0].type), len(arg))] elif isinstance(arg, Function): - type_arg = arg.signature_str - else: - type_arg = get_type(arg.type) - if isinstance(arg, Constant) and arg.type == ElementaryType("uint256"): - # If it is a constant - # We dupplicate the existing list - # And we add uint256 and int256 cases - # There is no potential collision, as the compiler - # Prevent it with a - # "not unique after argument-dependent loopkup" issue - argss_new = [list(args) for args in argss] - for args in argss: - args.append(str(ElementaryType("uint256"))) - for args in argss_new: - args.append(str(ElementaryType("int256"))) - argss = argss + argss_new + type_args = [arg.signature_str] else: - for args in argss: - args.append(type_arg) - return argss + type_args = [get_type(arg.type)] + + if ( + isinstance(arg.type, ElementaryType) + and arg.type.type in ElementaryTypeInt + Uint + Byte + ): + if isinstance(arg, Constant): + value = arg.value + can_be_uint = True + can_be_int = True + else: + value = MaxValues[arg.type.type] + can_be_uint = False + can_be_int = False + if arg.type.type in ElementaryTypeInt: + can_be_int = True + elif arg.type.type in Uint: + can_be_uint = True + + if arg.type.type in ElementaryTypeInt + Uint: + type_args = _fits_under_integer(value, can_be_int, can_be_uint) + else: + print(value) + type_args = _fits_under_byte(value) + + not_found = True + candidates_kept = [] + for type_arg in type_args: + if not not_found: + break + candidates_kept = [] + for candidate in candidates: + param = str(candidate.parameters[idx].type) + + if param == type_arg: + not_found = False + candidates_kept.append(candidate) + + if len(candidates_kept) == 1: + return candidates_kept[0] + candidates = candidates_kept + + if len(candidates) == 1: + return candidates[0] + return None def is_temporary(ins): @@ -1205,17 +1258,34 @@ def get_type(t): return str(t) -def convert_type_library_call(ir, lib_contract): - sigs = get_sig(ir, ir.function_name) +def _can_be_implicitly_converted(source: str, target: str) -> bool: + if source in ElementaryTypeInt and target in ElementaryTypeInt: + return int(source[3:]) <= int(target[3:]) + if source in Uint and target in Uint: + return int(source[4:]) <= int(target[4:]) + return source == target + + +def convert_type_library_call(ir: HighLevelCall, lib_contract: Contract): func = None - for sig in sigs: - func = lib_contract.get_function_from_signature(sig) - if not func: - func = lib_contract.get_state_variable_from_name(ir.function_name) - if func: - # stop to explore if func is found (prevent dupplicate issue) - break + candidates = [ + f + for f in lib_contract.functions + if f.name == ir.function_name + and not f.is_shadowed + and len(f.parameters) == len(ir.arguments) + ] + + if len(candidates) == 1: + func = candidates[0] + if func is None: + # TODO: handle collision with multiple state variables/functions + func = lib_contract.get_state_variable_from_name(ir.function_name) + if func is None and candidates: + func = _find_function_from_parameter(ir, candidates) + # In case of multiple binding to the same type + # TODO: this part might not be needed with _find_function_from_parameter if not func: # specific lookup when the compiler does implicit conversion # for example @@ -1282,36 +1352,41 @@ def _convert_to_structure_to_list(return_type: Type) -> List[Type]: return [return_type.type] -def convert_type_of_high_and_internal_level_call(ir, contract): +def convert_type_of_high_and_internal_level_call(ir: Operation, contract: Contract): func = None if isinstance(ir, InternalCall): - sigs = get_canonical_names(ir, ir.function_name, ir.contract_name) - for sig in sigs: - func = contract.get_function_from_canonical_name(sig) - if func: - # stop to explore if func is found (prevent dupplicate issue) - break + candidates = [ + f + for f in contract.functions + if f.name == ir.function_name + and f.contract_declarer.name == ir.contract_name + and not f.is_shadowed + and len(f.parameters) == len(ir.arguments) + ] + + func = _find_function_from_parameter(ir, candidates) + if not func: func = contract.get_state_variable_from_name(ir.function_name) else: assert isinstance(ir, HighLevelCall) - sigs = get_sig(ir, ir.function_name) - for sig in sigs: - func = contract.get_function_from_signature(sig) - if func: - # stop to explore if func is found (prevent dupplicate issue) - break - if not func: + + candidates = [ + f + for f in contract.functions + if f.name == ir.function_name + and not f.is_shadowed + and len(f.parameters) == len(ir.arguments) + ] + + if len(candidates) == 1: + func = candidates[0] + if func is None: + # TODO: handle collision with multiple state variables/functions func = contract.get_state_variable_from_name(ir.function_name) - if not func: - # specific lookup when the compiler does implicit conversion - # for example - # myFunc(uint) - # can be called with an uint8 - for function in contract.functions: - if function.name == ir.function_name and len(function.parameters) == len(ir.arguments): - func = function - break + if func is None and candidates: + func = _find_function_from_parameter(ir, candidates) + # lowlelvel lookup needs to be done at last step if not func: if can_be_low_level(ir): @@ -1319,7 +1394,7 @@ def convert_type_of_high_and_internal_level_call(ir, contract): if can_be_solidity_func(ir): return convert_to_solidity_func(ir) if not func: - to_log = "Function not found {}".format(sig) + to_log = "Function not found {}".format(ir.function_name) logger.error(to_log) ir.function = func if isinstance(func, Function): diff --git a/slither/slithir/operations/library_call.py b/slither/slithir/operations/library_call.py index d7c89a4de..45187b290 100644 --- a/slither/slithir/operations/library_call.py +++ b/slither/slithir/operations/library_call.py @@ -1,3 +1,4 @@ +from slither.core.declarations import Function from slither.slithir.operations.high_level_call import HighLevelCall from slither.core.declarations.contract import Contract @@ -37,10 +38,15 @@ class LibraryCall(HighLevelCall): else: lvalue = "{}({}) = ".format(self.lvalue, self.lvalue.type) txt = "{}LIBRARY_CALL, dest:{}, function:{}, arguments:{} {}" + + function_name = self.function_name + if self.function: + if isinstance(self.function, Function): + function_name = self.function.canonical_name return txt.format( lvalue, self.destination, - self.function_name, + function_name, [str(x) for x in arguments], gas, ) diff --git a/tests/ast-parsing/library_implicit_conversion-0.4.0.sol b/tests/ast-parsing/library_implicit_conversion-0.4.0.sol index b09d2929f..97764c2c8 100644 --- a/tests/ast-parsing/library_implicit_conversion-0.4.0.sol +++ b/tests/ast-parsing/library_implicit_conversion-0.4.0.sol @@ -1 +1,4 @@ // test only above 0.5 +contract C{ + +} From 989e87e81a9b0086148720a3193b3832a4e1ee7d Mon Sep 17 00:00:00 2001 From: Josselin Date: Wed, 21 Apr 2021 14:52:51 +0200 Subject: [PATCH 08/13] Fix minor --- slither/slithir/convert.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/slither/slithir/convert.py b/slither/slithir/convert.py index a4ce5e217..97c6134e6 100644 --- a/slither/slithir/convert.py +++ b/slither/slithir/convert.py @@ -1360,10 +1360,8 @@ def convert_type_of_high_and_internal_level_call(ir: Operation, contract: Contra for f in contract.functions if f.name == ir.function_name and f.contract_declarer.name == ir.contract_name - and not f.is_shadowed and len(f.parameters) == len(ir.arguments) ] - func = _find_function_from_parameter(ir, candidates) if not func: From 8d823c4b6ef9d5849c640d4531181cc4bb76ae99 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 22 Apr 2021 10:35:20 +0200 Subject: [PATCH 09/13] Minor --- slither/utils/command_line.py | 8 +++----- slither/utils/output.py | 8 +++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/slither/utils/command_line.py b/slither/utils/command_line.py index eb0d86cc7..50ea4c5aa 100644 --- a/slither/utils/command_line.py +++ b/slither/utils/command_line.py @@ -150,7 +150,7 @@ def output_results_to_markdown(all_results): info = defaultdict(dict) for results in all_results: checks[results["check"]].append(results) - info[results["check"]] = {"impact" : results["impact"], "confidence": results["confidence"]} + info[results["check"]] = {"impact": results["impact"], "confidence": results["confidence"]} print("Summary") for check in checks: @@ -162,14 +162,12 @@ def output_results_to_markdown(all_results): print(f'Impact: {info[check]["impact"]}') print(f'Confidence: {info[check]["confidence"]}') for result in results: - print( - " - [ ] ID-"+f"{counter}" - ) + print(" - [ ] ID-" + f"{counter}") counter = counter + 1 print(result["markdown"]) if result["first_markdown_element"]: print(result["first_markdown_element"]) - print('\n') + print("\n") def output_wiki(detector_classes, filter_wiki): diff --git a/slither/utils/output.py b/slither/utils/output.py index e9abce3d7..140ec7427 100644 --- a/slither/utils/output.py +++ b/slither/utils/output.py @@ -239,11 +239,11 @@ class Output: self._data["first_markdown_element"] = "" self._markdown_root = markdown_root - first_element_for_mardown = None if info: for elem in info: if not isinstance(elem, str): - first_element_for_mardown = elem + self._data["first_markdown_element"] = elem + break id_txt = "".join(_convert_to_id(d) for d in info) self._data["id"] = hashlib.sha3_256(id_txt.encode("utf-8")).hexdigest() @@ -259,7 +259,9 @@ class Output: def add(self, add: SupportedOutput, additional_fields: Optional[Dict] = None): if not self._data["first_markdown_element"]: - self._data["first_markdown_element"] = add.source_mapping_to_markdown(self._markdown_root) + self._data["first_markdown_element"] = add.source_mapping_to_markdown( + self._markdown_root + ) if isinstance(add, Variable): self.add_variable(add, additional_fields=additional_fields) elif isinstance(add, Contract): From 81bf2cce9967b042ec1d07000113d260aeef6905 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 22 Apr 2021 14:07:09 +0200 Subject: [PATCH 10/13] Remove COUNTER from slithir variables classes --- slither/core/slither_core.py | 4 ++++ slither/slithir/variables/reference.py | 12 +++++++----- slither/slithir/variables/temporary.py | 12 +++++++----- slither/slithir/variables/tuple.py | 13 ++++++++----- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/slither/core/slither_core.py b/slither/core/slither_core.py index 2226b9879..d78f05358 100644 --- a/slither/core/slither_core.py +++ b/slither/core/slither_core.py @@ -90,6 +90,10 @@ class SlitherCore(Context): # pylint: disable=too-many-instance-attributes,too- self._show_ignored_findings = False + self.counter_slithir_tuple = 0 + self.counter_slithir_temporary = 0 + self.counter_slithir_reference = 0 + ################################################################################### ################################################################################### # region Source code diff --git a/slither/slithir/variables/reference.py b/slither/slithir/variables/reference.py index 8af3e85e7..d9b0e8882 100644 --- a/slither/slithir/variables/reference.py +++ b/slither/slithir/variables/reference.py @@ -1,17 +1,19 @@ +from typing import TYPE_CHECKING + from slither.core.children.child_node import ChildNode from slither.core.declarations import Contract, Enum, SolidityVariable, Function from slither.core.variables.variable import Variable +if TYPE_CHECKING: + from slither.core.cfg.node import Node class ReferenceVariable(ChildNode, Variable): - COUNTER = 0 - - def __init__(self, node, index=None): + def __init__(self, node: "Node", index=None): super().__init__() if index is None: - self._index = ReferenceVariable.COUNTER - ReferenceVariable.COUNTER += 1 + self._index = node.slither.counter_slithir_reference + node.slither.counter_slithir_reference += 1 else: self._index = index self._points_to = None diff --git a/slither/slithir/variables/temporary.py b/slither/slithir/variables/temporary.py index 761d8f966..db47973f7 100644 --- a/slither/slithir/variables/temporary.py +++ b/slither/slithir/variables/temporary.py @@ -1,16 +1,18 @@ +from typing import TYPE_CHECKING + from slither.core.children.child_node import ChildNode from slither.core.variables.variable import Variable +if TYPE_CHECKING: + from slither.core.cfg.node import Node class TemporaryVariable(ChildNode, Variable): - COUNTER = 0 - - def __init__(self, node, index=None): + def __init__(self, node: "Node", index=None): super().__init__() if index is None: - self._index = TemporaryVariable.COUNTER - TemporaryVariable.COUNTER += 1 + self._index = node.slither.counter_slithir_temporary + node.slither.counter_slithir_temporary += 1 else: self._index = index self._node = node diff --git a/slither/slithir/variables/tuple.py b/slither/slithir/variables/tuple.py index 330545889..b72f98767 100644 --- a/slither/slithir/variables/tuple.py +++ b/slither/slithir/variables/tuple.py @@ -1,16 +1,19 @@ +from typing import TYPE_CHECKING + from slither.core.children.child_node import ChildNode from slither.slithir.variables.variable import SlithIRVariable +if TYPE_CHECKING: + from slither.core.cfg.node import Node -class TupleVariable(ChildNode, SlithIRVariable): - COUNTER = 0 +class TupleVariable(ChildNode, SlithIRVariable): - def __init__(self, node, index=None): + def __init__(self, node: "Node", index=None): super().__init__() if index is None: - self._index = TupleVariable.COUNTER - TupleVariable.COUNTER += 1 + self._index = node.slither.counter_slithir_tuple + node.slither.counter_slithir_tuple += 1 else: self._index = index From 8847899a4390ef24d2427ee4b59ed92e4c5aafc8 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 22 Apr 2021 14:09:12 +0200 Subject: [PATCH 11/13] run black --- slither/slithir/variables/reference.py | 2 +- slither/slithir/variables/temporary.py | 2 +- slither/slithir/variables/tuple.py | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/slither/slithir/variables/reference.py b/slither/slithir/variables/reference.py index d9b0e8882..c65dd061e 100644 --- a/slither/slithir/variables/reference.py +++ b/slither/slithir/variables/reference.py @@ -7,8 +7,8 @@ from slither.core.variables.variable import Variable if TYPE_CHECKING: from slither.core.cfg.node import Node -class ReferenceVariable(ChildNode, Variable): +class ReferenceVariable(ChildNode, Variable): def __init__(self, node: "Node", index=None): super().__init__() if index is None: diff --git a/slither/slithir/variables/temporary.py b/slither/slithir/variables/temporary.py index db47973f7..657c95803 100644 --- a/slither/slithir/variables/temporary.py +++ b/slither/slithir/variables/temporary.py @@ -6,8 +6,8 @@ from slither.core.variables.variable import Variable if TYPE_CHECKING: from slither.core.cfg.node import Node -class TemporaryVariable(ChildNode, Variable): +class TemporaryVariable(ChildNode, Variable): def __init__(self, node: "Node", index=None): super().__init__() if index is None: diff --git a/slither/slithir/variables/tuple.py b/slither/slithir/variables/tuple.py index b72f98767..0931a8ab5 100644 --- a/slither/slithir/variables/tuple.py +++ b/slither/slithir/variables/tuple.py @@ -8,7 +8,6 @@ if TYPE_CHECKING: class TupleVariable(ChildNode, SlithIRVariable): - def __init__(self, node: "Node", index=None): super().__init__() if index is None: From 9e8e175496ffc9e9fd9cf5f4de1aa52455c9b300 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 22 Apr 2021 14:15:30 +0200 Subject: [PATCH 12/13] Update tests --- slither/utils/output.py | 6 - ...V2_array.sol.0.4.25.ABIEncoderV2Array.json | 270 +++++++++--------- ...ry_send-0.5.1.sol.0.5.1.ArbitrarySend.json | 2 + ...bitrary_send.sol.0.4.25.ArbitrarySend.json | 2 + ...reference.sol.0.4.25.ArrayByReference.json | 6 + ...bly_contract-0.5.1.sol.0.5.1.Assembly.json | 1 + ...assembly_contract.sol.0.4.25.Assembly.json | 1 + ...mbly_library-0.5.1.sol.0.5.1.Assembly.json | 2 + ..._assembly_library.sol.0.4.25.Assembly.json | 2 + ...te_change.sol.0.5.8.AssertStateChange.json | 3 + .../backdoor.sol.0.4.25.Backdoor.json | 1 + .../backdoor.sol.0.4.25.Suicidal.json | 1 + .../backdoor/backdoor.sol.0.5.1.Backdoor.json | 1 + .../backdoor/backdoor.sol.0.5.1.Suicidal.json | 1 + ...t-equality.sol.0.4.25.BooleanEquality.json | 1 + ...isuse.sol.0.6.0.BooleanConstantMisuse.json | 1 + ...n_loop.sol.0.4.25.MultipleCallsInLoop.json | 1 + ...es.sol.0.4.25.ConstCandidateStateVars.json | 6 + ...les.sol.0.5.1.ConstCandidateStateVars.json | 6 + ...stant.sol.0.4.25.ConstantFunctionsAsm.json | 1 + ...ant.sol.0.4.25.ConstantFunctionsState.json | 2 + ...ment.sol.0.4.25.ArrayLengthAssignment.json | 53 ++-- ...all.sol.0.4.25.ControlledDelegateCall.json | 2 + ...call.sol.0.5.1.ControlledDelegateCall.json | 2 + ...oop.sol.0.4.25.CostlyOperationsInLoop.json | 1 + ....0.4.25.UnindexedERC20EventParameters.json | 4 + ...4.25.IncorrectERC20InterfaceDetection.json | 6 + ....25.IncorrectERC721InterfaceDetection.json | 10 + ...ic.sol.0.5.12.MissingEventsArithmetic.json | 2 + ..._function.sol.0.4.25.ExternalFunction.json | 5 + ...l_function.sol.0.5.1.ExternalFunction.json | 5 + ...s.sol.0.4.25.FunctionInitializedState.json | 5 + ...ity.sol.0.5.1.IncorrectStrictEquality.json | 12 + ...t.sol.0.4.25.ModifierDefaultDetection.json | 3 + ....25.IncorrectUnaryExpressionDetection.json | 4 + ...ked_ether-0.5.1.sol.0.5.1.LockedEther.json | 1 + .../locked_ether.sol.0.4.25.LockedEther.json | 1 + ..._level_calls.sol.0.4.25.LowLevelCalls.json | 1 + ...w_level_calls.sol.0.5.1.LowLevelCalls.json | 1 + ...n.sol.0.4.25.MappingDeletionDetection.json | 2 + ...l.0.5.12.MissingZeroAddressValidation.json | 5 + ...onvention.sol.0.4.25.NamingConvention.json | 12 + ...convention.sol.0.5.1.NamingConvention.json | 12 + ...on_ignore.sol.0.4.25.NamingConvention.json | 1 + ...agma.0.4.24.sol.0.4.25.ConstantPragma.json | 1 + ...nested.sol.0.4.25.PublicMappingNested.json | 1 + ...ements.sol.0.4.25.RedundantStatements.json | 6 + ...ol.0.4.26.ReentrancyReadBeforeWritten.json | 2 + ...cy-benign.sol.0.4.26.ReentrancyBenign.json | 6 + ...ntrancy-0.5.1.sol.0.5.1.ReentrancyEth.json | 2 + .../reentrancy.sol.0.4.25.ReentrancyEth.json | 2 + ...ncy_indirect.sol.0.4.25.ReentrancyEth.json | 1 + ....5.1-events.sol.0.5.1.ReentrancyEvent.json | 1 + ...ctor.sol.0.4.25.ReusedBaseConstructor.json | 8 + ...erride.sol.0.4.25.RightToLeftOverride.json | 1 + ...sol.0.4.25.ShadowingAbstractDetection.json | 1 + ...ols.sol.0.4.25.BuiltinSymbolShadowing.json | 13 + ...al_variable.sol.0.4.25.LocalShadowing.json | 5 + ...te_variable.sol.0.4.25.StateShadowing.json | 1 + .../old_solc.sol.0.4.21.IncorrectSolc.json | 2 + ...on_incorrect.sol.0.4.25.IncorrectSolc.json | 3 + ..._incorrect_05.sol.0.5.7.IncorrectSolc.json | 3 + ...y.sol.0.5.8.StorageSignedIntegerArray.json | 90 +++--- .../timestamp.sol.0.4.25.Timestamp.json | 3 + .../timestamp.sol.0.5.1.Timestamp.json | 3 + ...o_many_digits.sol.0.5.1.TooManyDigits.json | 5 + .../tx_origin-0.5.1.sol.0.5.1.TxOrigin.json | 2 + .../tx_origin.sol.0.4.25.TxOrigin.json | 2 + ...vel-0.5.1.sol.0.5.1.UncheckedLowLevel.json | 1 + ...lowlevel.sol.0.4.25.UncheckedLowLevel.json | 1 + ...ed_send-0.5.1.sol.0.5.1.UncheckedSend.json | 1 + ...transfers.sol.0.7.6.UncheckedTransfer.json | 2 + ...0.4.25.UnimplementedFunctionDetection.json | 4 + ....UninitializedFunctionPtrsConstructor.json | 3 + ...ble.sol.0.4.25.UninitializedLocalVars.json | 1 + ...0.5.1.UninitializedStateVarsDetection.json | 4 + ....4.25.UninitializedStateVarsDetection.json | 4 + ...r.sol.0.4.25.UninitializedStorageVars.json | 1 + ...ggy.sol.0.6.12.UnprotectedUpgradeable.json | 1 + ...urn-sol7.sol.0.7.6.UnusedReturnValues.json | 1 + ..._return.sol.0.4.25.UnusedReturnValues.json | 2 + ...d_return.sol.0.5.1.UnusedReturnValues.json | 2 + ...used_state.sol.0.4.25.UnusedStateVars.json | 4 + ...nused_state.sol.0.5.1.UnusedStateVars.json | 4 + ...l.sol.0.4.25.PredeclarationUsageLocal.json | 5 + .../void-cst.sol.0.5.1.VoidConstructor.json | 1 + .../bad_prng.sol.0.4.25.BadPRNG.json | 4 + 87 files changed, 470 insertions(+), 207 deletions(-) diff --git a/slither/utils/output.py b/slither/utils/output.py index 140ec7427..0f9226388 100644 --- a/slither/utils/output.py +++ b/slither/utils/output.py @@ -239,12 +239,6 @@ class Output: self._data["first_markdown_element"] = "" self._markdown_root = markdown_root - if info: - for elem in info: - if not isinstance(elem, str): - self._data["first_markdown_element"] = elem - break - id_txt = "".join(_convert_to_id(d) for d in info) self._data["id"] = hashlib.sha3_256(id_txt.encode("utf-8")).hexdigest() diff --git a/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json b/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json index 5aad58406..276e78946 100644 --- a/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json +++ b/tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol.0.4.25.ABIEncoderV2Array.json @@ -4,19 +4,19 @@ "elements": [ { "type": "function", - "name": "bad3", + "name": "bad4", "source_mapping": { - "start": 1076, - "length": 154, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 39, - 40, - 41 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -136,42 +136,42 @@ "ending_column": 2 } }, - "signature": "bad3()" + "signature": "bad4()" } }, { "type": "node", - "name": "b = abi.encode(s)", + "name": "event1_bad(bad_arr)", "source_mapping": { - "start": 1195, - "length": 30, + "start": 1415, + "length": 24, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 40 + 45 ], "starting_column": 5, - "ending_column": 35 + "ending_column": 29 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad3", + "name": "bad4", "source_mapping": { - "start": 1076, - "length": 154, + "start": 1296, + "length": 148, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 39, - 40, - 41 + 44, + 45, + 46 ], "starting_column": 3, "ending_column": 4 @@ -291,15 +291,16 @@ "ending_column": 2 } }, - "signature": "bad3()" + "signature": "bad4()" } } } } ], - "description": "Function A.bad3() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#40)\n", - "markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L40)\n", - "id": "2052add742fb8dc3fa2c9ce9f9adcf8515d049c55f39f32a405ef0f6c29b9c7f", + "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#45)\n", + "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L45)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L44-L46", + "id": "a0f90ebd7deb3917f2b20550e5edc7749a3459d075ada68b6422521732674f8c", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -308,19 +309,19 @@ "elements": [ { "type": "function", - "name": "bad0", + "name": "bad2", "source_mapping": { - "start": 540, - "length": 61, + "start": 852, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -440,42 +441,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad2()" } }, { "type": "node", - "name": "this.bad0_external(bad_arr)", + "name": "b = abi.encode(bad_arr)", "source_mapping": { - "start": 569, - "length": 27, + "start": 971, + "length": 36, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 22 + 35 ], "starting_column": 5, - "ending_column": 32 + "ending_column": 41 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad2", "source_mapping": { - "start": 540, - "length": 61, + "start": 852, + "length": 160, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 21, - 22, - 23 + 34, + 35, + 36 ], "starting_column": 3, "ending_column": 4 @@ -595,15 +596,16 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad2()" } } } } ], - "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#22)\n", - "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L22)\n", - "id": "42e7d1c56e5298ef4ddfcc69b4e6119d356b34740cde285337501b656b0d2e04", + "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#35)\n", + "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L35)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L34-L36", + "id": "767bd12bc81a7530972b0f2b069fb167efe0f2d6b6ec6d1b95aa39d1dd836a5d", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -612,19 +614,19 @@ "elements": [ { "type": "function", - "name": "bad2", + "name": "bad0", "source_mapping": { - "start": 852, - "length": 160, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -744,42 +746,42 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad0()" } }, { "type": "node", - "name": "b = abi.encode(bad_arr)", + "name": "this.bad0_external(bad_arr)", "source_mapping": { - "start": 971, - "length": 36, + "start": 569, + "length": 27, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 35 + 22 ], "starting_column": 5, - "ending_column": 41 + "ending_column": 32 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad2", + "name": "bad0", "source_mapping": { - "start": 852, - "length": 160, + "start": 540, + "length": 61, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 34, - 35, - 36 + 21, + 22, + 23 ], "starting_column": 3, "ending_column": 4 @@ -899,15 +901,16 @@ "ending_column": 2 } }, - "signature": "bad2()" + "signature": "bad0()" } } } } ], - "description": "Function A.bad2() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#34-36) trigger an abi encoding bug:\n\t- b = abi.encode(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#35)\n", - "markdown": "Function [A.bad2()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L34-L36) trigger an abi encoding bug:\n\t- [b = abi.encode(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L35)\n", - "id": "767bd12bc81a7530972b0f2b069fb167efe0f2d6b6ec6d1b95aa39d1dd836a5d", + "description": "Function A.bad0() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#21-23) trigger an abi encoding bug:\n\t- this.bad0_external(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#22)\n", + "markdown": "Function [A.bad0()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L21-L23) trigger an abi encoding bug:\n\t- [this.bad0_external(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L22)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L21-L23", + "id": "42e7d1c56e5298ef4ddfcc69b4e6119d356b34740cde285337501b656b0d2e04", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -916,19 +919,19 @@ "elements": [ { "type": "function", - "name": "bad4", + "name": "bad3", "source_mapping": { - "start": 1296, - "length": 148, + "start": 1076, + "length": 154, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 39, + 40, + 41 ], "starting_column": 3, "ending_column": 4 @@ -1048,42 +1051,42 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad3()" } }, { "type": "node", - "name": "event1_bad(bad_arr)", + "name": "b = abi.encode(s)", "source_mapping": { - "start": 1415, - "length": 24, + "start": 1195, + "length": 30, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 45 + 40 ], "starting_column": 5, - "ending_column": 29 + "ending_column": 35 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad4", + "name": "bad3", "source_mapping": { - "start": 1296, - "length": 148, + "start": 1076, + "length": 154, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 44, - 45, - 46 + 39, + 40, + 41 ], "starting_column": 3, "ending_column": 4 @@ -1203,15 +1206,16 @@ "ending_column": 2 } }, - "signature": "bad4()" + "signature": "bad3()" } } } } ], - "description": "Function A.bad4() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#44-46) trigger an abi encoding bug:\n\t- event1_bad(bad_arr) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#45)\n", - "markdown": "Function [A.bad4()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L44-L46) trigger an abi encoding bug:\n\t- [event1_bad(bad_arr)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L45)\n", - "id": "a0f90ebd7deb3917f2b20550e5edc7749a3459d075ada68b6422521732674f8c", + "description": "Function A.bad3() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#39-41) trigger an abi encoding bug:\n\t- b = abi.encode(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#40)\n", + "markdown": "Function [A.bad3()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L39-L41) trigger an abi encoding bug:\n\t- [b = abi.encode(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L40)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L39-L41", + "id": "2052add742fb8dc3fa2c9ce9f9adcf8515d049c55f39f32a405ef0f6c29b9c7f", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1220,19 +1224,19 @@ "elements": [ { "type": "function", - "name": "bad1", + "name": "bad5", "source_mapping": { - "start": 726, - "length": 63, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1352,42 +1356,42 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad5()" } }, { "type": "node", - "name": "this.bad1_external(s)", + "name": "event2_bad(s)", "source_mapping": { - "start": 763, - "length": 21, + "start": 1630, + "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 30 + 50 ], "starting_column": 5, - "ending_column": 26 + "ending_column": 23 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad5", "source_mapping": { - "start": 726, - "length": 63, + "start": 1511, + "length": 142, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 29, - 30, - 31 + 49, + 50, + 51 ], "starting_column": 3, "ending_column": 4 @@ -1507,15 +1511,16 @@ "ending_column": 2 } }, - "signature": "bad1(A.S[3])" + "signature": "bad5()" } } } } ], - "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#30)\n", - "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L30)\n", - "id": "b57e7fe9f889943ab7d2d9879a1b13f52d3ed64db56ae2f14cbea6e8dafcd70b", + "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#50)\n", + "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L50)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L49-L51", + "id": "1bb85eee97769e9220dcde2102945a4a66fb96f01f789049334828e9f002aef5", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" @@ -1524,19 +1529,19 @@ "elements": [ { "type": "function", - "name": "bad5", + "name": "bad1", "source_mapping": { - "start": 1511, - "length": 142, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -1656,42 +1661,42 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad1(A.S[3])" } }, { "type": "node", - "name": "event2_bad(s)", + "name": "this.bad1_external(s)", "source_mapping": { - "start": 1630, - "length": 18, + "start": 763, + "length": 21, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 50 + 30 ], "starting_column": 5, - "ending_column": 23 + "ending_column": 26 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad5", + "name": "bad1", "source_mapping": { - "start": 1511, - "length": 142, + "start": 726, + "length": 63, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol", "is_dependency": false, "lines": [ - 49, - 50, - 51 + 29, + 30, + 31 ], "starting_column": 3, "ending_column": 4 @@ -1811,15 +1816,16 @@ "ending_column": 2 } }, - "signature": "bad5()" + "signature": "bad1(A.S[3])" } } } } ], - "description": "Function A.bad5() (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#49-51) trigger an abi encoding bug:\n\t- event2_bad(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#50)\n", - "markdown": "Function [A.bad5()](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L49-L51) trigger an abi encoding bug:\n\t- [event2_bad(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L50)\n", - "id": "1bb85eee97769e9220dcde2102945a4a66fb96f01f789049334828e9f002aef5", + "description": "Function A.bad1(A.S[3]) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#29-31) trigger an abi encoding bug:\n\t- this.bad1_external(s) (tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#30)\n", + "markdown": "Function [A.bad1(A.S[3])](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L29-L31) trigger an abi encoding bug:\n\t- [this.bad1_external(s)](tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L30)\n", + "first_markdown_element": "tests/detectors/abiencoderv2-array/storage_ABIEncoderV2_array.sol#L29-L31", + "id": "b57e7fe9f889943ab7d2d9879a1b13f52d3ed64db56ae2f14cbea6e8dafcd70b", "check": "abiencoderv2-array", "impact": "High", "confidence": "High" diff --git a/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json b/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json index 2d5442d5a..9064f326a 100644 --- a/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json +++ b/tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol.0.5.1.ArbitrarySend.json @@ -187,6 +187,7 @@ ], "description": "Test.direct() (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#12)\n", "markdown": "[Test.direct()](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L12)\n", + "first_markdown_element": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L11-L13", "id": "f541c43a03086c95960bfcf05b8d4941008505120331df11a91d0187dc4640c5", "check": "arbitrary-send", "impact": "High", @@ -379,6 +380,7 @@ ], "description": "Test.indirect() (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#20)\n", "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L20)\n", + "first_markdown_element": "tests/detectors/arbitrary-send/arbitrary_send-0.5.1.sol#L19-L21", "id": "6399c3b0638ef3e8fb62de3d7ad760649d315b03ebdf5a11d2674970f12452d9", "check": "arbitrary-send", "impact": "High", diff --git a/tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json b/tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json index 2ead6ce0c..7709c1aff 100644 --- a/tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json +++ b/tests/detectors/arbitrary-send/arbitrary_send.sol.0.4.25.ArbitrarySend.json @@ -187,6 +187,7 @@ ], "description": "Test.direct() (tests/detectors/arbitrary-send/arbitrary_send.sol#11-13) sends eth to arbitrary user\n\tDangerous calls:\n\t- msg.sender.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send.sol#12)\n", "markdown": "[Test.direct()](tests/detectors/arbitrary-send/arbitrary_send.sol#L11-L13) sends eth to arbitrary user\n\tDangerous calls:\n\t- [msg.sender.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send.sol#L12)\n", + "first_markdown_element": "tests/detectors/arbitrary-send/arbitrary_send.sol#L11-L13", "id": "62016ac9363a509bd815fc0bb31b326b235dad50d7771dea249037d40169138e", "check": "arbitrary-send", "impact": "High", @@ -379,6 +380,7 @@ ], "description": "Test.indirect() (tests/detectors/arbitrary-send/arbitrary_send.sol#19-21) sends eth to arbitrary user\n\tDangerous calls:\n\t- destination.send(address(this).balance) (tests/detectors/arbitrary-send/arbitrary_send.sol#20)\n", "markdown": "[Test.indirect()](tests/detectors/arbitrary-send/arbitrary_send.sol#L19-L21) sends eth to arbitrary user\n\tDangerous calls:\n\t- [destination.send(address(this).balance)](tests/detectors/arbitrary-send/arbitrary_send.sol#L20)\n", + "first_markdown_element": "tests/detectors/arbitrary-send/arbitrary_send.sol#L19-L21", "id": "62a25f56dfce54ce59cdf81a1821f2ea8a8eb7d12a6a794b9c4f09ba7f7bc543", "check": "arbitrary-send", "impact": "High", diff --git a/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json b/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json index ecbba2da3..b27aca34a 100644 --- a/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json +++ b/tests/detectors/array-by-reference/array_by_reference.sol.0.4.25.ArrayByReference.json @@ -211,6 +211,7 @@ ], "description": "C.f() (tests/detectors/array-by-reference/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/array_by_reference.sol#2)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", "markdown": "[C.f()](tests/detectors/array-by-reference/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/array_by_reference.sol#L2)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L4-L8", "id": "79a462bf06ae529ad099f2170100298da30766fcc06884e03436d2b53110d208", "check": "array-by-reference", "impact": "High", @@ -428,6 +429,7 @@ ], "description": "C.f() (tests/detectors/array-by-reference/array_by_reference.sol#4-8) passes array C.x (tests/detectors/array-by-reference/array_by_reference.sol#2)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", "markdown": "[C.f()](tests/detectors/array-by-reference/array_by_reference.sol#L4-L8) passes array [C.x](tests/detectors/array-by-reference/array_by_reference.sol#L2)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L4-L8", "id": "7f1eda9be40002affd2e8e31d172d3ee3374f37b1106118c79f4add7a133bbd0", "check": "array-by-reference", "impact": "High", @@ -671,6 +673,7 @@ ], "description": "C.g() (tests/detectors/array-by-reference/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/array_by_reference.sol#11)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", "markdown": "[C.g()](tests/detectors/array-by-reference/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/array_by_reference.sol#L11)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L10-L15", "id": "d039169712808e785bf2e53f322c1c6fcd6b93a0a0c17f1a701addd09ed83996", "check": "array-by-reference", "impact": "High", @@ -915,6 +918,7 @@ ], "description": "C.g() (tests/detectors/array-by-reference/array_by_reference.sol#10-15) passes array C.g().y (tests/detectors/array-by-reference/array_by_reference.sol#11)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", "markdown": "[C.g()](tests/detectors/array-by-reference/array_by_reference.sol#L10-L15) passes array [C.g().y](tests/detectors/array-by-reference/array_by_reference.sol#L11)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L10-L15", "id": "8655e8acd84a6e8152acd2d9730ea0dfdda0723e09b2dcbfdbbeb8da8bd04fa5", "check": "array-by-reference", "impact": "High", @@ -1119,6 +1123,7 @@ ], "description": "D.f() (tests/detectors/array-by-reference/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/array_by_reference.sol#39)by reference to C.setByValue(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#21-23)which only takes arrays by value\n", "markdown": "[D.f()](tests/detectors/array-by-reference/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/array_by_reference.sol#L39)by reference to [C.setByValue(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L21-L23)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L42-L48", "id": "1520955a53c36e391abbaf648a91a5a12d432f0f4746b0a8187d0988a6a66846", "check": "array-by-reference", "impact": "High", @@ -1324,6 +1329,7 @@ ], "description": "D.f() (tests/detectors/array-by-reference/array_by_reference.sol#42-48) passes array D.x (tests/detectors/array-by-reference/array_by_reference.sol#39)by reference to C.setByValueAndReturn(uint256[1]) (tests/detectors/array-by-reference/array_by_reference.sol#25-28)which only takes arrays by value\n", "markdown": "[D.f()](tests/detectors/array-by-reference/array_by_reference.sol#L42-L48) passes array [D.x](tests/detectors/array-by-reference/array_by_reference.sol#L39)by reference to [C.setByValueAndReturn(uint256[1])](tests/detectors/array-by-reference/array_by_reference.sol#L25-L28)which only takes arrays by value\n", + "first_markdown_element": "tests/detectors/array-by-reference/array_by_reference.sol#L42-L48", "id": "019912974eabe7e8b1e67ca05b342e5106de13fa93fa0adf599a4259c425bd54", "check": "array-by-reference", "impact": "High", diff --git a/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json b/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json index 3d4b64198..f1f0659ff 100644 --- a/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json +++ b/tests/detectors/assembly/inline_assembly_contract-0.5.1.sol.0.5.1.Assembly.json @@ -176,6 +176,7 @@ ], "description": "GetCode.at(address) (tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#7-20)\n", "markdown": "[GetCode.at(address)](tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#L7-L20)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_contract-0.5.1.sol#L6-L20", "id": "a454219cba72113d0a6d0d732b998ba66db41cc59910efea1862a05d4d27f385", "check": "assembly", "impact": "Informational", diff --git a/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json b/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json index 36e35794e..773b0ca7f 100644 --- a/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json +++ b/tests/detectors/assembly/inline_assembly_contract.sol.0.4.25.Assembly.json @@ -176,6 +176,7 @@ ], "description": "GetCode.at(address) (tests/detectors/assembly/inline_assembly_contract.sol#6-20) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_contract.sol#7-20)\n", "markdown": "[GetCode.at(address)](tests/detectors/assembly/inline_assembly_contract.sol#L6-L20) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_contract.sol#L7-L20)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_contract.sol#L6-L20", "id": "076a663af9edac0ed5fd4b04bb521be77206cde70d71f430b80d13896d7ad54d", "check": "assembly", "impact": "Informational", diff --git a/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json b/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json index 199c3f22d..97f1b84e2 100644 --- a/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json +++ b/tests/detectors/assembly/inline_assembly_library-0.5.1.sol.0.5.1.Assembly.json @@ -204,6 +204,7 @@ ], "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#18-21)\n", "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L18-L21)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L16-L22", "id": "86a697fcaa68e521bef3fcba0cf80a381efeb961011f90562eab06ca08b8dc00", "check": "assembly", "impact": "Informational", @@ -463,6 +464,7 @@ ], "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library-0.5.1.sol#26-47)\n", "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L26-L47)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_library-0.5.1.sol#L25-L47", "id": "e18b822185c318b5197d4704d8524a2f025a68be527e542392467920f35723b8", "check": "assembly", "impact": "Informational", diff --git a/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json b/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json index 7438f7d37..9f5fe65cf 100644 --- a/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json +++ b/tests/detectors/assembly/inline_assembly_library.sol.0.4.25.Assembly.json @@ -204,6 +204,7 @@ ], "description": "VectorSum.sumAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library.sol#16-22) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library.sol#18-21)\n", "markdown": "[VectorSum.sumAsm(uint256[])](tests/detectors/assembly/inline_assembly_library.sol#L16-L22) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library.sol#L18-L21)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_library.sol#L16-L22", "id": "bb3664625e0b8ea9d3b3a564687e6ec0b403f90fe433eae80801a31e51a390b6", "check": "assembly", "impact": "Informational", @@ -463,6 +464,7 @@ ], "description": "VectorSum.sumPureAsm(uint256[]) (tests/detectors/assembly/inline_assembly_library.sol#25-47) uses assembly\n\t- INLINE ASM (tests/detectors/assembly/inline_assembly_library.sol#26-47)\n", "markdown": "[VectorSum.sumPureAsm(uint256[])](tests/detectors/assembly/inline_assembly_library.sol#L25-L47) uses assembly\n\t- [INLINE ASM](tests/detectors/assembly/inline_assembly_library.sol#L26-L47)\n", + "first_markdown_element": "tests/detectors/assembly/inline_assembly_library.sol#L25-L47", "id": "3d84d91aaec8956d18b205c8fb9c0ae40794c87060ed0bbbb0dc94eecf5b8fcb", "check": "assembly", "impact": "Informational", diff --git a/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json b/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json index a0be936fb..55f18d3cd 100644 --- a/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json +++ b/tests/detectors/assert-state-change/assert_state_change.sol.0.5.8.AssertStateChange.json @@ -183,6 +183,7 @@ ], "description": "A.bad0() (tests/detectors/assert-state-change/assert_state_change.sol#6-8) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += 1) > 10) (tests/detectors/assert-state-change/assert_state_change.sol#7)\nConsider using require() or change the invariant to not modify the state.\n", "markdown": "[A.bad0()](tests/detectors/assert-state-change/assert_state_change.sol#L6-L8) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += 1) > 10)](tests/detectors/assert-state-change/assert_state_change.sol#L7)\nConsider using require() or change the invariant to not modify the state.\n", + "first_markdown_element": "tests/detectors/assert-state-change/assert_state_change.sol#L6-L8", "id": "a4f5ea904ad28f8c83aa1bab8284b485e1fe638545b500ca0c8a0fa8e442203e", "check": "assert-state-change", "impact": "Informational", @@ -371,6 +372,7 @@ ], "description": "A.bad1(uint256) (tests/detectors/assert-state-change/assert_state_change.sol#11-13) has an assert() call which possibly changes state.\n\t-assert(bool)((s_a += a) > 10) (tests/detectors/assert-state-change/assert_state_change.sol#12)\nConsider using require() or change the invariant to not modify the state.\n", "markdown": "[A.bad1(uint256)](tests/detectors/assert-state-change/assert_state_change.sol#L11-L13) has an assert() call which possibly changes state.\n\t-[assert(bool)((s_a += a) > 10)](tests/detectors/assert-state-change/assert_state_change.sol#L12)\nConsider using require() or change the invariant to not modify the state.\n", + "first_markdown_element": "tests/detectors/assert-state-change/assert_state_change.sol#L11-L13", "id": "2b42e9f701ebd94656a026702bf90f31c62710a301600e0c05cfed04bfefabf9", "check": "assert-state-change", "impact": "Informational", @@ -559,6 +561,7 @@ ], "description": "A.bad2() (tests/detectors/assert-state-change/assert_state_change.sol#19-21) has an assert() call which possibly changes state.\n\t-assert(bool)(bad2_callee()) (tests/detectors/assert-state-change/assert_state_change.sol#20)\nConsider using require() or change the invariant to not modify the state.\n", "markdown": "[A.bad2()](tests/detectors/assert-state-change/assert_state_change.sol#L19-L21) has an assert() call which possibly changes state.\n\t-[assert(bool)(bad2_callee())](tests/detectors/assert-state-change/assert_state_change.sol#L20)\nConsider using require() or change the invariant to not modify the state.\n", + "first_markdown_element": "tests/detectors/assert-state-change/assert_state_change.sol#L19-L21", "id": "a72f3e7eef408be55123fbf5c290bfd20aed4f095d659f5df0857d64d61df011", "check": "assert-state-change", "impact": "Informational", diff --git a/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json b/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json index ba5a9f15a..95a3f889c 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json +++ b/tests/detectors/backdoor/backdoor.sol.0.4.25.Backdoor.json @@ -52,6 +52,7 @@ ], "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6)\n", "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6)\n", + "first_markdown_element": "tests/detectors/backdoor/backdoor.sol#L4-L6", "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", "check": "backdoor", "impact": "High", diff --git a/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json b/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json index a2d2e8d70..051043973 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json +++ b/tests/detectors/backdoor/backdoor.sol.0.4.25.Suicidal.json @@ -52,6 +52,7 @@ ], "description": "C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6) allows anyone to destruct the contract\n", "markdown": "[C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6) allows anyone to destruct the contract\n", + "first_markdown_element": "tests/detectors/backdoor/backdoor.sol#L4-L6", "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", "check": "suicidal", "impact": "High", diff --git a/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json b/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json index ba5a9f15a..95a3f889c 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json +++ b/tests/detectors/backdoor/backdoor.sol.0.5.1.Backdoor.json @@ -52,6 +52,7 @@ ], "description": "Backdoor function found in C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6)\n", "markdown": "Backdoor function found in [C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6)\n", + "first_markdown_element": "tests/detectors/backdoor/backdoor.sol#L4-L6", "id": "8a9008f2f5cd23b34feb0235dcc30ecb8d09a10eff151b522939caead117ef7a", "check": "backdoor", "impact": "High", diff --git a/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json b/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json index a2d2e8d70..051043973 100644 --- a/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json +++ b/tests/detectors/backdoor/backdoor.sol.0.5.1.Suicidal.json @@ -52,6 +52,7 @@ ], "description": "C.i_am_a_backdoor() (tests/detectors/backdoor/backdoor.sol#4-6) allows anyone to destruct the contract\n", "markdown": "[C.i_am_a_backdoor()](tests/detectors/backdoor/backdoor.sol#L4-L6) allows anyone to destruct the contract\n", + "first_markdown_element": "tests/detectors/backdoor/backdoor.sol#L4-L6", "id": "bb1e4596537b6e2c29f4221e733692fd6dac8555095181718e440ca525016eb7", "check": "suicidal", "impact": "High", diff --git a/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json b/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json index 72c1bcbbe..d95f49d12 100644 --- a/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json +++ b/tests/detectors/boolean-constant-equality/boolean-constant-equality.sol.0.4.25.BooleanEquality.json @@ -161,6 +161,7 @@ ], "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#7-9) compares to a boolean constant:\n\t-(b == true) (tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#8)\n", "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#L7-L9) compares to a boolean constant:\n\t-[(b == true)](tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#L8)\n", + "first_markdown_element": "tests/detectors/boolean-constant-equality/boolean-constant-equality.sol#L7-L9", "id": "4a53e773c88b730f07c2e4106545df03b44679c56ee0d9dbd75dca010320e69c", "check": "boolean-equal", "impact": "Informational", diff --git a/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json b/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json index a4bf8607d..fd601033c 100644 --- a/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json +++ b/tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol.0.6.0.BooleanConstantMisuse.json @@ -199,6 +199,7 @@ ], "description": "MyConc.bad1(bool) (tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#9-11) uses a Boolean constant improperly:\n\t-(b || true) (tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#10)\n", "markdown": "[MyConc.bad1(bool)](tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#L9-L11) uses a Boolean constant improperly:\n\t-[(b || true)](tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#L10)\n", + "first_markdown_element": "tests/detectors/boolean-constant-misuse/boolean-constant-misuse.sol#L9-L11", "id": "12517fed0ec8f0a2232b467a6add9fd94a6a84325017e02e8a48794fc9112c6b", "check": "boolean-cst", "impact": "Medium", diff --git a/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json b/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json index e36eaaa64..3a61a19a7 100644 --- a/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json +++ b/tests/detectors/calls-loop/multiple_calls_in_loop.sol.0.4.25.MultipleCallsInLoop.json @@ -139,6 +139,7 @@ ], "description": "CallInLoop.bad() (tests/detectors/calls-loop/multiple_calls_in_loop.sol#9-13) has external calls inside a loop: destinations[i].transfer(i) (tests/detectors/calls-loop/multiple_calls_in_loop.sol#11)\n", "markdown": "[CallInLoop.bad()](tests/detectors/calls-loop/multiple_calls_in_loop.sol#L9-L13) has external calls inside a loop: [destinations[i].transfer(i)](tests/detectors/calls-loop/multiple_calls_in_loop.sol#L11)\n", + "first_markdown_element": "tests/detectors/calls-loop/multiple_calls_in_loop.sol#L9-L13", "id": "b5ddb0f2f8ab2160ca8a3f429672693f7a82cb9c5b69c571aa114385b13005e7", "check": "calls-loop", "impact": "Low", diff --git a/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json b/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json index 2fa7ffab4..d801c6b0f 100644 --- a/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json +++ b/tests/detectors/constable-states/const_state_variables.sol.0.4.25.ConstCandidateStateVars.json @@ -60,6 +60,7 @@ ], "description": "A.myFriendsAddress (tests/detectors/constable-states/const_state_variables.sol#7) should be constant\n", "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/const_state_variables.sol#L7) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L7", "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", "check": "constable-states", "impact": "Optimization", @@ -125,6 +126,7 @@ ], "description": "A.test (tests/detectors/constable-states/const_state_variables.sol#10) should be constant\n", "markdown": "[A.test](tests/detectors/constable-states/const_state_variables.sol#L10) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L10", "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", "check": "constable-states", "impact": "Optimization", @@ -190,6 +192,7 @@ ], "description": "A.text2 (tests/detectors/constable-states/const_state_variables.sol#14) should be constant\n", "markdown": "[A.text2](tests/detectors/constable-states/const_state_variables.sol#L14) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L14", "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", "check": "constable-states", "impact": "Optimization", @@ -251,6 +254,7 @@ ], "description": "B.mySistersAddress (tests/detectors/constable-states/const_state_variables.sol#26) should be constant\n", "markdown": "[B.mySistersAddress](tests/detectors/constable-states/const_state_variables.sol#L26) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L26", "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", "check": "constable-states", "impact": "Optimization", @@ -312,6 +316,7 @@ ], "description": "MyConc.should_be_constant (tests/detectors/constable-states/const_state_variables.sol#42) should be constant\n", "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/const_state_variables.sol#L42) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L42", "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", "check": "constable-states", "impact": "Optimization", @@ -373,6 +378,7 @@ ], "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/const_state_variables.sol#43) should be constant\n", "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/const_state_variables.sol#L43) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L43", "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", "check": "constable-states", "impact": "Optimization", diff --git a/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json b/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json index 2fa7ffab4..d801c6b0f 100644 --- a/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json +++ b/tests/detectors/constable-states/const_state_variables.sol.0.5.1.ConstCandidateStateVars.json @@ -60,6 +60,7 @@ ], "description": "A.myFriendsAddress (tests/detectors/constable-states/const_state_variables.sol#7) should be constant\n", "markdown": "[A.myFriendsAddress](tests/detectors/constable-states/const_state_variables.sol#L7) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L7", "id": "1454db80653b732bf6acbe54ff0ae4707002207a2a8216708c12d61c88a43e5f", "check": "constable-states", "impact": "Optimization", @@ -125,6 +126,7 @@ ], "description": "A.test (tests/detectors/constable-states/const_state_variables.sol#10) should be constant\n", "markdown": "[A.test](tests/detectors/constable-states/const_state_variables.sol#L10) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L10", "id": "5d9e3fb413322b71a93e90f7e89bd8c83cd4884d577d039598c681fe9db38b1d", "check": "constable-states", "impact": "Optimization", @@ -190,6 +192,7 @@ ], "description": "A.text2 (tests/detectors/constable-states/const_state_variables.sol#14) should be constant\n", "markdown": "[A.text2](tests/detectors/constable-states/const_state_variables.sol#L14) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L14", "id": "df11e6201c4558a8c5cd90b55b134b9ca8f07203b2264d3aa93bd7745e8cb4ba", "check": "constable-states", "impact": "Optimization", @@ -251,6 +254,7 @@ ], "description": "B.mySistersAddress (tests/detectors/constable-states/const_state_variables.sol#26) should be constant\n", "markdown": "[B.mySistersAddress](tests/detectors/constable-states/const_state_variables.sol#L26) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L26", "id": "bee93a722c8eae4a48aade67d8ef537d84c106f48fc9eb738c795fce10d3bc63", "check": "constable-states", "impact": "Optimization", @@ -312,6 +316,7 @@ ], "description": "MyConc.should_be_constant (tests/detectors/constable-states/const_state_variables.sol#42) should be constant\n", "markdown": "[MyConc.should_be_constant](tests/detectors/constable-states/const_state_variables.sol#L42) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L42", "id": "cbcafa2a3efba4d21ac1b51b4b823e5082d556bc3d6cf3fd2ab3188f9f218fc1", "check": "constable-states", "impact": "Optimization", @@ -373,6 +378,7 @@ ], "description": "MyConc.should_be_constant_2 (tests/detectors/constable-states/const_state_variables.sol#43) should be constant\n", "markdown": "[MyConc.should_be_constant_2](tests/detectors/constable-states/const_state_variables.sol#L43) should be constant\n", + "first_markdown_element": "tests/detectors/constable-states/const_state_variables.sol#L43", "id": "9a48a4122de1a6a4774a9f1e0d4917bd0fa08f17b4af41b86ba07689e51bf711", "check": "constable-states", "impact": "Optimization", diff --git a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json b/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json index e50e063b0..10d5d0d12 100644 --- a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json +++ b/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsAsm.json @@ -70,6 +70,7 @@ ], "description": "Constant.test_assembly_bug() (tests/detectors/constant/constant.sol#22-24) is declared view but contains assembly code\n", "markdown": "[Constant.test_assembly_bug()](tests/detectors/constant/constant.sol#L22-L24) is declared view but contains assembly code\n", + "first_markdown_element": "tests/detectors/constant/constant.sol#L22-L24", "id": "1f892cae08b89096bdc4d6ecdf55a3adc4b4314390e054fe2547d9c8e9f76e23", "additional_fields": { "contains_assembly": true diff --git a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json b/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json index 7e1d3916a..2e77b7cee 100644 --- a/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json +++ b/tests/detectors/constant/constant.sol.0.4.25.ConstantFunctionsState.json @@ -132,6 +132,7 @@ ], "description": "Constant.test_view_bug() (tests/detectors/constant/constant.sol#5-7) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/constant.sol#3)\n", "markdown": "[Constant.test_view_bug()](tests/detectors/constant/constant.sol#L5-L7) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/constant.sol#L3)\n", + "first_markdown_element": "tests/detectors/constant/constant.sol#L5-L7", "id": "4dee61d8835d20c6f1f7c195d8bd1e9de5dbcc096396a5b8db391136f9f5fdf1", "additional_fields": { "contains_assembly": false @@ -272,6 +273,7 @@ ], "description": "Constant.test_constant_bug() (tests/detectors/constant/constant.sol#9-11) is declared view but changes state variables:\n\t- Constant.a (tests/detectors/constant/constant.sol#3)\n", "markdown": "[Constant.test_constant_bug()](tests/detectors/constant/constant.sol#L9-L11) is declared view but changes state variables:\n\t- [Constant.a](tests/detectors/constant/constant.sol#L3)\n", + "first_markdown_element": "tests/detectors/constant/constant.sol#L9-L11", "id": "145e2d34dfc5b932c8d67d480c0eaec9baa8c728e2a310529572c0c4a5c6046a", "additional_fields": { "contains_assembly": false diff --git a/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json b/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json index 61e98c59c..d7c617515 100644 --- a/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json +++ b/tests/detectors/controlled-array-length/array_length_assignment.sol.0.4.25.ArrayLengthAssignment.json @@ -67,20 +67,20 @@ }, { "type": "node", - "name": "b.subStruct.x.length = param + 1", + "name": "a.x.length = param", "source_mapping": { - "start": 964, - "length": 32, + "start": 818, + "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", "is_dependency": false, "lines": [ - 41 + 36 ], "starting_column": 9, - "ending_column": 41 + "ending_column": 27 }, "type_specific_fields": { "parent": { @@ -193,9 +193,10 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/array_length_assignment.sol#41)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/array_length_assignment.sol#L41)\n", - "id": "15164b2025ba6106829ae6e7baa9a73e931c0aa3e16a8d95ee30158667b4b7f5", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#36)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L36)\n", + "first_markdown_element": "tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46", + "id": "6a72386e40ef24dd02adf92179022559e26da5e66be4bb925d02756f90f38953", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -267,20 +268,20 @@ }, { "type": "node", - "name": "arr.length = param", + "name": "b.subStruct.x.length = param + 1", "source_mapping": { - "start": 527, - "length": 18, + "start": 964, + "length": 32, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", "is_dependency": false, "lines": [ - 26 + 41 ], - "starting_column": 13, - "ending_column": 31 + "starting_column": 9, + "ending_column": 41 }, "type_specific_fields": { "parent": { @@ -393,9 +394,10 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#26)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L26)\n", - "id": "cb96ef1555863b421997853215ad3533faaffd35215987c6a2ebf21716d9bd1a", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- b.subStruct.x.length = param + 1 (tests/detectors/controlled-array-length/array_length_assignment.sol#41)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [b.subStruct.x.length = param + 1](tests/detectors/controlled-array-length/array_length_assignment.sol#L41)\n", + "first_markdown_element": "tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46", + "id": "15164b2025ba6106829ae6e7baa9a73e931c0aa3e16a8d95ee30158667b4b7f5", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" @@ -467,9 +469,9 @@ }, { "type": "node", - "name": "a.x.length = param", + "name": "arr.length = param", "source_mapping": { - "start": 818, + "start": 527, "length": 18, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/controlled-array-length/array_length_assignment.sol", @@ -477,10 +479,10 @@ "filename_short": "tests/detectors/controlled-array-length/array_length_assignment.sol", "is_dependency": false, "lines": [ - 36 + 26 ], - "starting_column": 9, - "ending_column": 27 + "starting_column": 13, + "ending_column": 31 }, "type_specific_fields": { "parent": { @@ -593,9 +595,10 @@ } } ], - "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- a.x.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#36)\n", - "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [a.x.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L36)\n", - "id": "6a72386e40ef24dd02adf92179022559e26da5e66be4bb925d02756f90f38953", + "description": "ArrayLengthAssignment (tests/detectors/controlled-array-length/array_length_assignment.sol#1-46) contract sets array length with a user-controlled value:\n\t- arr.length = param (tests/detectors/controlled-array-length/array_length_assignment.sol#26)\n", + "markdown": "[ArrayLengthAssignment](tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46) contract sets array length with a user-controlled value:\n\t- [arr.length = param](tests/detectors/controlled-array-length/array_length_assignment.sol#L26)\n", + "first_markdown_element": "tests/detectors/controlled-array-length/array_length_assignment.sol#L1-L46", + "id": "cb96ef1555863b421997853215ad3533faaffd35215987c6a2ebf21716d9bd1a", "check": "controlled-array-length", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json index 114ba8299..ce7e82989 100644 --- a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json +++ b/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.4.25.ControlledDelegateCall.json @@ -157,6 +157,7 @@ ], "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#10)\n", "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L10)\n", + "first_markdown_element": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11", "id": "d4aa9719b93dc4f3a3ec9b915071763b38d6881ddee6eaa86dade09f3caa1e5e", "check": "controlled-delegatecall", "impact": "High", @@ -317,6 +318,7 @@ ], "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#19)\n", "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L19)\n", + "first_markdown_element": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20", "id": "3358bd7774f1a574c5521fe2e084afa81e866adf9a77f3f25e3009f17d8c9fe7", "check": "controlled-delegatecall", "impact": "High", diff --git a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json b/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json index 114ba8299..ce7e82989 100644 --- a/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json +++ b/tests/detectors/controlled-delegatecall/controlled_delegatecall.sol.0.5.1.ControlledDelegateCall.json @@ -157,6 +157,7 @@ ], "description": "C.bad_delegate_call(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#8-11) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(data) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#10)\n", "markdown": "[C.bad_delegate_call(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(data)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L10)\n", + "first_markdown_element": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L8-L11", "id": "d4aa9719b93dc4f3a3ec9b915071763b38d6881ddee6eaa86dade09f3caa1e5e", "check": "controlled-delegatecall", "impact": "High", @@ -317,6 +318,7 @@ ], "description": "C.bad_delegate_call2(bytes) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#18-20) uses delegatecall to a input-controlled function id\n\t- addr_bad.delegatecall(abi.encode(func_id,data)) (tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#19)\n", "markdown": "[C.bad_delegate_call2(bytes)](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20) uses delegatecall to a input-controlled function id\n\t- [addr_bad.delegatecall(abi.encode(func_id,data))](tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L19)\n", + "first_markdown_element": "tests/detectors/controlled-delegatecall/controlled_delegatecall.sol#L18-L20", "id": "3358bd7774f1a574c5521fe2e084afa81e866adf9a77f3f25e3009f17d8c9fe7", "check": "controlled-delegatecall", "impact": "High", diff --git a/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json b/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json index e9662ab31..3bd1f7e78 100644 --- a/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json +++ b/tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol.0.4.25.CostlyOperationsInLoop.json @@ -175,6 +175,7 @@ ], "description": "CostlyOperationsInLoop.bad() (tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#10-14) has costly operations inside a loop:\n\t- state_variable ++ (tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#12)\n", "markdown": "[CostlyOperationsInLoop.bad()](tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#L10-L14) has costly operations inside a loop:\n\t- [state_variable ++](tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#L12)\n", + "first_markdown_element": "tests/detectors/costly-loop/multiple_costly_operations_in_loop.sol#L10-L14", "id": "245dbe07302f785326efd84e8b711d1691f045726e1098601f7e1058f1e72b2a", "check": "costly-loop", "impact": "Informational", diff --git a/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json b/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json index e721dfaca..468f6d24b 100644 --- a/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json +++ b/tests/detectors/erc20-indexed/erc20_indexed.sol.0.4.25.UnindexedERC20EventParameters.json @@ -56,6 +56,7 @@ ], "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#19)does not index parameter from\n", "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L19)does not index parameter from\n", + "first_markdown_element": "tests/detectors/erc20-indexed/erc20_indexed.sol#L19", "id": "a86c7a54115f270548e82d71570dc4d2900b622b0f82c6fce137f3a35314af53", "check": "erc20-indexed", "impact": "Informational", @@ -117,6 +118,7 @@ ], "description": "ERC20 event IERC20BadTransfer(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#19)does not index parameter to\n", "markdown": "ERC20 event [IERC20BadTransfer(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L19)does not index parameter to\n", + "first_markdown_element": "tests/detectors/erc20-indexed/erc20_indexed.sol#L19", "id": "29c46eb3a4695004959847ae09377729cdf3aa583de95560090b9bd49977c49b", "check": "erc20-indexed", "impact": "Informational", @@ -178,6 +180,7 @@ ], "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#20)does not index parameter owner\n", "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L20)does not index parameter owner\n", + "first_markdown_element": "tests/detectors/erc20-indexed/erc20_indexed.sol#L20", "id": "7d72b56a71ca96db304878f25484c496af1d283a9b777dc788f1473974057025", "check": "erc20-indexed", "impact": "Informational", @@ -239,6 +242,7 @@ ], "description": "ERC20 event IERC20BadApproval(address,address,uint256) (tests/detectors/erc20-indexed/erc20_indexed.sol#20)does not index parameter spender\n", "markdown": "ERC20 event [IERC20BadApproval(address,address,uint256)](tests/detectors/erc20-indexed/erc20_indexed.sol#L20)does not index parameter spender\n", + "first_markdown_element": "tests/detectors/erc20-indexed/erc20_indexed.sol#L20", "id": "df4d927d202bdca1fc411d6960d3f62ed2784f5eca7435cb0503f4154f2e3bc6", "check": "erc20-indexed", "impact": "Informational", diff --git a/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json b/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json index f95b04675..5d63e66cf 100644 --- a/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json +++ b/tests/detectors/erc20-interface/incorrect_erc20_interface.sol.0.4.25.IncorrectERC20InterfaceDetection.json @@ -76,6 +76,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transfer(address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#4)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transfer(address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L4)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "d3df2e48ae6e8a1b05b275de574b480853a0839c272ce889e8a1664ae432698e", "check": "erc20-interface", "impact": "Medium", @@ -157,6 +158,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.approve(address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#5)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.approve(address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L5)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "0fced3029cf59cf348a6b79c58dbb032d837fdd5a5f355600edebda1878e9e2e", "check": "erc20-interface", "impact": "Medium", @@ -238,6 +240,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#6)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L6)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "ba13a1588595032984a3fad39610a2414bb8fcb522d1e632d52fa947ff207d73", "check": "erc20-interface", "impact": "Medium", @@ -319,6 +322,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.totalSupply() (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#7)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.totalSupply()](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L7)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "c951e429e546af28ac08e241d391e874c1c9c70b0732ccfb63f3bbfb3eaac16e", "check": "erc20-interface", "impact": "Medium", @@ -400,6 +404,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.balanceOf(address) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#8)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.balanceOf(address)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L8)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "758ca2456030a36dbd6115f2ccb1a43f53f1dabd66ed079806df0f6b7b4d21ef", "check": "erc20-interface", "impact": "Medium", @@ -481,6 +486,7 @@ ], "description": "Token (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#3-10) has incorrect ERC20 function interface:Token.allowance(address,address) (tests/detectors/erc20-interface/incorrect_erc20_interface.sol#9)\n", "markdown": "[Token](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10) has incorrect ERC20 function interface:[Token.allowance(address,address)](tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L9)\n", + "first_markdown_element": "tests/detectors/erc20-interface/incorrect_erc20_interface.sol#L3-L10", "id": "1286abfe21b09e21e1cec8b991f73664e104fa39f7f4190690ece3af45bc0c7a", "check": "erc20-interface", "impact": "Medium", diff --git a/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json b/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json index 973dcf35f..22c31e795 100644 --- a/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json +++ b/tests/detectors/erc721-interface/incorrect_erc721_interface.sol.0.4.25.IncorrectERC721InterfaceDetection.json @@ -74,6 +74,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:IERC165.supportsInterface(bytes4) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#4)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[IERC165.supportsInterface(bytes4)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L4)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "a8593587ca70c51a9ab827843babec3b3eb7f9a08d76eea1e5528e668f7b291d", "check": "erc721-interface", "impact": "Medium", @@ -161,6 +162,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.balanceOf(address) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#7)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.balanceOf(address)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L7)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "6fb9d0320e0b63e2c70f9844d5bea2be958e73beb6eaa4ccb2323ead0c7ef991", "check": "erc721-interface", "impact": "Medium", @@ -248,6 +250,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.ownerOf(uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#8)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.ownerOf(uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L8)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "7d9235dd4ef8bc29a3b7700597cc1e4efb846377c928e5e50c5f49cb37f288d2", "check": "erc721-interface", "impact": "Medium", @@ -335,6 +338,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256,bytes) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#9)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256,bytes)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L9)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "ccec612c4b5db00ab59b766b5dde3f8d3a8c6408ef595ab08bff21628587e2a1", "check": "erc721-interface", "impact": "Medium", @@ -422,6 +426,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.safeTransferFrom(address,address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#10)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.safeTransferFrom(address,address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L10)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "50ab7b0f39f327ac6deccf3c16b4e6fee1dc249072ac41a4bd485ccf0c12315b", "check": "erc721-interface", "impact": "Medium", @@ -509,6 +514,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.transferFrom(address,address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#11)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.transferFrom(address,address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L11)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "847b11227f3bfc9b120e0ea573f385a4bbc61c4b7f89f434864612a679b1133e", "check": "erc721-interface", "impact": "Medium", @@ -596,6 +602,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.approve(address,uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#12)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.approve(address,uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L12)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "439c95972d0e084aff057161164b13ab63f85bee31d80b568b7155e58eac4b5d", "check": "erc721-interface", "impact": "Medium", @@ -683,6 +690,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.setApprovalForAll(address,bool) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#13)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.setApprovalForAll(address,bool)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L13)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "b95e9bb000fb073c25fdbd9fff7bf0a3c44e04e70fc1a7da27c94c6b7fb8be40", "check": "erc721-interface", "impact": "Medium", @@ -770,6 +778,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.getApproved(uint256) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#14)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.getApproved(uint256)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L14)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "2dce4891c7abea0fa8a8a20a8b8482e7e1d46d54bfd750701c604d5dadd8b937", "check": "erc721-interface", "impact": "Medium", @@ -857,6 +866,7 @@ ], "description": "Token (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#6-16) has incorrect ERC721 function interface:Token.isApprovedForAll(address,address) (tests/detectors/erc721-interface/incorrect_erc721_interface.sol#15)\n", "markdown": "[Token](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16) has incorrect ERC721 function interface:[Token.isApprovedForAll(address,address)](tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L15)\n", + "first_markdown_element": "tests/detectors/erc721-interface/incorrect_erc721_interface.sol#L6-L16", "id": "fa9985c505689f9a45d1ac51e1dd8cf79eeb2c939946abfb5ac78f46e692d0eb", "check": "erc721-interface", "impact": "Medium", diff --git a/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json b/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json index d7929eb4b..d6edbf61d 100644 --- a/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json +++ b/tests/detectors/events-maths/missing_events_arithmetic.sol.0.5.12.MissingEventsArithmetic.json @@ -249,6 +249,7 @@ ], "description": "Bug.bad0(uint8) (tests/detectors/events-maths/missing_events_arithmetic.sol#22-24) should emit an event for: \n\t- uprice8 = _price (tests/detectors/events-maths/missing_events_arithmetic.sol#23) \n", "markdown": "[Bug.bad0(uint8)](tests/detectors/events-maths/missing_events_arithmetic.sol#L22-L24) should emit an event for: \n\t- [uprice8 = _price](tests/detectors/events-maths/missing_events_arithmetic.sol#L23) \n", + "first_markdown_element": "tests/detectors/events-maths/missing_events_arithmetic.sol#L22-L24", "id": "d06657a1dc1f8c46e77dbcdd93667a379d95d84ca14ca94351c3a1eb799b9f3b", "check": "events-maths", "impact": "Low", @@ -503,6 +504,7 @@ ], "description": "Bug.bad1(int16) (tests/detectors/events-maths/missing_events_arithmetic.sol#30-32) should emit an event for: \n\t- iprice16 = _price (tests/detectors/events-maths/missing_events_arithmetic.sol#31) \n", "markdown": "[Bug.bad1(int16)](tests/detectors/events-maths/missing_events_arithmetic.sol#L30-L32) should emit an event for: \n\t- [iprice16 = _price](tests/detectors/events-maths/missing_events_arithmetic.sol#L31) \n", + "first_markdown_element": "tests/detectors/events-maths/missing_events_arithmetic.sol#L30-L32", "id": "d155849bc5f174fe5fe9619b4722bdbb9e99282f0ace605cf629b48862ca0195", "check": "events-maths", "impact": "Low", diff --git a/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json b/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json index 11c3b7d3a..6ab14377f 100644 --- a/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json +++ b/tests/detectors/external-function/external_function.sol.0.4.25.ExternalFunction.json @@ -64,6 +64,7 @@ ], "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/external_function.sol#13-15)\n", "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/external_function.sol#L13-L15)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L13-L15", "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", "check": "external-function", "impact": "Optimization", @@ -133,6 +134,7 @@ ], "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/external_function.sol#17-19)\n", "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/external_function.sol#L17-L19)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L17-L19", "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", "check": "external-function", "impact": "Optimization", @@ -202,6 +204,7 @@ ], "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/external_function.sol#21-23)\n", "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/external_function.sol#L21-L23)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L21-L23", "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", "check": "external-function", "impact": "Optimization", @@ -267,6 +270,7 @@ ], "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/external_function.sol#32-39)\n", "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/external_function.sol#L32-L39)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L32-L39", "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", "check": "external-function", "impact": "Optimization", @@ -328,6 +332,7 @@ ], "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/external_function.sol#74-76)\n", "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/external_function.sol#L74-L76)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L74-L76", "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", "check": "external-function", "impact": "Optimization", diff --git a/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json b/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json index 11c3b7d3a..6ab14377f 100644 --- a/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json +++ b/tests/detectors/external-function/external_function.sol.0.5.1.ExternalFunction.json @@ -64,6 +64,7 @@ ], "description": "funcNotCalled3() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled3() (tests/detectors/external-function/external_function.sol#13-15)\n", "markdown": "funcNotCalled3() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled3()](tests/detectors/external-function/external_function.sol#L13-L15)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L13-L15", "id": "026d9a579ea0304e58c8a5174296494f4b672e4ea032f4e17504f3dac327c4e6", "check": "external-function", "impact": "Optimization", @@ -133,6 +134,7 @@ ], "description": "funcNotCalled2() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled2() (tests/detectors/external-function/external_function.sol#17-19)\n", "markdown": "funcNotCalled2() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled2()](tests/detectors/external-function/external_function.sol#L17-L19)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L17-L19", "id": "1ef1f19a92a8ab8d27df156d50dd75628ec3057b5f5eb16b7d1faa0e5c3850a0", "check": "external-function", "impact": "Optimization", @@ -202,6 +204,7 @@ ], "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled.funcNotCalled() (tests/detectors/external-function/external_function.sol#21-23)\n", "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled.funcNotCalled()](tests/detectors/external-function/external_function.sol#L21-L23)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L21-L23", "id": "369a2f3d071735755ff4f5bc43081fe858bbfb07eed94e5c6dda3c8daa22ba26", "check": "external-function", "impact": "Optimization", @@ -267,6 +270,7 @@ ], "description": "funcNotCalled() should be declared external:\n\t- ContractWithFunctionNotCalled2.funcNotCalled() (tests/detectors/external-function/external_function.sol#32-39)\n", "markdown": "funcNotCalled() should be declared external:\n\t- [ContractWithFunctionNotCalled2.funcNotCalled()](tests/detectors/external-function/external_function.sol#L32-L39)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L32-L39", "id": "80a0a3a3954cc6e314079a1d8d96d6739d521ddbcf738e63078d7f210e443562", "check": "external-function", "impact": "Optimization", @@ -328,6 +332,7 @@ ], "description": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- FunctionParameterWrite.parameter_read_ok_for_external(uint256) (tests/detectors/external-function/external_function.sol#74-76)\n", "markdown": "parameter_read_ok_for_external(uint256) should be declared external:\n\t- [FunctionParameterWrite.parameter_read_ok_for_external(uint256)](tests/detectors/external-function/external_function.sol#L74-L76)\n", + "first_markdown_element": "tests/detectors/external-function/external_function.sol#L74-L76", "id": "3a0a42d128eff9fb04d8f7605bf2d6f7574c2cbbdffa2dcabbae66d7568ecc59", "check": "external-function", "impact": "Optimization", diff --git a/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json b/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json index af973568f..8d69c163a 100644 --- a/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json +++ b/tests/detectors/function-init-state/function_init_state_variables.sol.0.4.25.FunctionInitializedState.json @@ -87,6 +87,7 @@ ], "description": "StateVarInitFromFunction.v (tests/detectors/function-init-state/function_init_state_variables.sol#5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", "markdown": "[StateVarInitFromFunction.v](tests/detectors/function-init-state/function_init_state_variables.sol#L5) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "first_markdown_element": "tests/detectors/function-init-state/function_init_state_variables.sol#L5", "id": "4b87ea4c0a3b72be79ffde12c56c9dc7440445b79ff4b228e0937b3a05540e4b", "check": "function-init-state", "impact": "Informational", @@ -179,6 +180,7 @@ ], "description": "StateVarInitFromFunction.x (tests/detectors/function-init-state/function_init_state_variables.sol#7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", "markdown": "[StateVarInitFromFunction.x](tests/detectors/function-init-state/function_init_state_variables.sol#L7) is set pre-construction with a non-constant function or state variable:\n\t- set()\n", + "first_markdown_element": "tests/detectors/function-init-state/function_init_state_variables.sol#L7", "id": "adfa394934c8669a556cfa10c364fe526dd1e295a63959e1e88fe84a919ef354", "check": "function-init-state", "impact": "Informational", @@ -271,6 +273,7 @@ ], "description": "StateVarInitFromFunction.y1 (tests/detectors/function-init-state/function_init_state_variables.sol#9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", "markdown": "[StateVarInitFromFunction.y1](tests/detectors/function-init-state/function_init_state_variables.sol#L9) is set pre-construction with a non-constant function or state variable:\n\t- 5 + get()\n", + "first_markdown_element": "tests/detectors/function-init-state/function_init_state_variables.sol#L9", "id": "b26f83c06e9aca87637dea02a0f4080fd4226c1ed90c6c2c63da85cb142d67ab", "check": "function-init-state", "impact": "Informational", @@ -363,6 +366,7 @@ ], "description": "StateVarInitFromFunction.y2 (tests/detectors/function-init-state/function_init_state_variables.sol#10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", "markdown": "[StateVarInitFromFunction.y2](tests/detectors/function-init-state/function_init_state_variables.sol#L10) is set pre-construction with a non-constant function or state variable:\n\t- (10 + (5 + get()))\n", + "first_markdown_element": "tests/detectors/function-init-state/function_init_state_variables.sol#L10", "id": "b6e231b9b735794e00b73dddb86b2ba8f7a738d916c99f302fb32b1095c67472", "check": "function-init-state", "impact": "Informational", @@ -455,6 +459,7 @@ ], "description": "StateVarInitFromFunction.z4 (tests/detectors/function-init-state/function_init_state_variables.sol#17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", "markdown": "[StateVarInitFromFunction.z4](tests/detectors/function-init-state/function_init_state_variables.sol#L17) is set pre-construction with a non-constant function or state variable:\n\t- z3 + 5\n", + "first_markdown_element": "tests/detectors/function-init-state/function_init_state_variables.sol#L17", "id": "8b7eb9ab16397c2f23479d2c3043a675ab5e2b1da07e2697631812d6d7b68525", "check": "function-init-state", "impact": "Informational", diff --git a/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json b/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json index 3f651bcb3..9b38a5ad6 100644 --- a/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json +++ b/tests/detectors/incorrect-equality/incorrect_equality.sol.0.5.1.IncorrectStrictEquality.json @@ -143,6 +143,7 @@ ], "description": "ERC20TestBalance.bad0(ERC20Function) (tests/detectors/incorrect-equality/incorrect_equality.sol#21-23) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(address(this)) == 10) (tests/detectors/incorrect-equality/incorrect_equality.sol#22)\n", "markdown": "[ERC20TestBalance.bad0(ERC20Function)](tests/detectors/incorrect-equality/incorrect_equality.sol#L21-L23) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(address(this)) == 10)](tests/detectors/incorrect-equality/incorrect_equality.sol#L22)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L21-L23", "id": "294a51197ec2777645430044c421cfe296f6407dd6bc867cd4420397548ac6a0", "check": "incorrect-equality", "impact": "Medium", @@ -291,6 +292,7 @@ ], "description": "ERC20TestBalance.bad1(ERC20Variable) (tests/detectors/incorrect-equality/incorrect_equality.sol#25-27) uses a dangerous strict equality:\n\t- require(bool)(erc.balanceOf(msg.sender) == 10) (tests/detectors/incorrect-equality/incorrect_equality.sol#26)\n", "markdown": "[ERC20TestBalance.bad1(ERC20Variable)](tests/detectors/incorrect-equality/incorrect_equality.sol#L25-L27) uses a dangerous strict equality:\n\t- [require(bool)(erc.balanceOf(msg.sender) == 10)](tests/detectors/incorrect-equality/incorrect_equality.sol#L26)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L25-L27", "id": "640263d06fa2e0c7166f3e674530f15e8742bf273f242187fbb82ad0e609b4ab", "check": "incorrect-equality", "impact": "Medium", @@ -539,6 +541,7 @@ ], "description": "TestContractBalance.bad0() (tests/detectors/incorrect-equality/incorrect_equality.sol#32-35) uses a dangerous strict equality:\n\t- require(bool)(address(address(this)).balance == 10000000000000000000) (tests/detectors/incorrect-equality/incorrect_equality.sol#33)\n", "markdown": "[TestContractBalance.bad0()](tests/detectors/incorrect-equality/incorrect_equality.sol#L32-L35) uses a dangerous strict equality:\n\t- [require(bool)(address(address(this)).balance == 10000000000000000000)](tests/detectors/incorrect-equality/incorrect_equality.sol#L33)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L32-L35", "id": "b0f68fc1884acee397d2f83064b7a096d432f82b6dad75efd852eb4cfc58c3e1", "check": "incorrect-equality", "impact": "Medium", @@ -787,6 +790,7 @@ ], "description": "TestContractBalance.bad1() (tests/detectors/incorrect-equality/incorrect_equality.sol#37-40) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(address(this)).balance) (tests/detectors/incorrect-equality/incorrect_equality.sol#38)\n", "markdown": "[TestContractBalance.bad1()](tests/detectors/incorrect-equality/incorrect_equality.sol#L37-L40) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(address(this)).balance)](tests/detectors/incorrect-equality/incorrect_equality.sol#L38)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L37-L40", "id": "448f29d6485c6cd2719c07c9152520610973e1be01c8b99cb6dc7c2d857aeb42", "check": "incorrect-equality", "impact": "Medium", @@ -1035,6 +1039,7 @@ ], "description": "TestContractBalance.bad2() (tests/detectors/incorrect-equality/incorrect_equality.sol#42-45) uses a dangerous strict equality:\n\t- require(bool)(address(this).balance == 10000000000000000000) (tests/detectors/incorrect-equality/incorrect_equality.sol#43)\n", "markdown": "[TestContractBalance.bad2()](tests/detectors/incorrect-equality/incorrect_equality.sol#L42-L45) uses a dangerous strict equality:\n\t- [require(bool)(address(this).balance == 10000000000000000000)](tests/detectors/incorrect-equality/incorrect_equality.sol#L43)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L42-L45", "id": "8fd870cb63ea7244cabccdce377d3ab3d7821e47c1cd1db26ec67d1a0ead433f", "check": "incorrect-equality", "impact": "Medium", @@ -1283,6 +1288,7 @@ ], "description": "TestContractBalance.bad3() (tests/detectors/incorrect-equality/incorrect_equality.sol#47-50) uses a dangerous strict equality:\n\t- require(bool)(10000000000000000000 == address(this).balance) (tests/detectors/incorrect-equality/incorrect_equality.sol#48)\n", "markdown": "[TestContractBalance.bad3()](tests/detectors/incorrect-equality/incorrect_equality.sol#L47-L50) uses a dangerous strict equality:\n\t- [require(bool)(10000000000000000000 == address(this).balance)](tests/detectors/incorrect-equality/incorrect_equality.sol#L48)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L47-L50", "id": "e66548a0ff1d43d4fdc9eff9d88483b677cd5147c38618d8d10db3a212daf801", "check": "incorrect-equality", "impact": "Medium", @@ -1535,6 +1541,7 @@ ], "description": "TestContractBalance.bad4() (tests/detectors/incorrect-equality/incorrect_equality.sol#52-57) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/incorrect_equality.sol#54)\n", "markdown": "[TestContractBalance.bad4()](tests/detectors/incorrect-equality/incorrect_equality.sol#L52-L57) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/incorrect_equality.sol#L54)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L52-L57", "id": "feb30557490c10419bfd41c37e25f98d8927a1831f8e58da24b2c327e622d410", "check": "incorrect-equality", "impact": "Medium", @@ -1787,6 +1794,7 @@ ], "description": "TestContractBalance.bad5() (tests/detectors/incorrect-equality/incorrect_equality.sol#59-64) uses a dangerous strict equality:\n\t- 10000000000000000000 == balance (tests/detectors/incorrect-equality/incorrect_equality.sol#61)\n", "markdown": "[TestContractBalance.bad5()](tests/detectors/incorrect-equality/incorrect_equality.sol#L59-L64) uses a dangerous strict equality:\n\t- [10000000000000000000 == balance](tests/detectors/incorrect-equality/incorrect_equality.sol#L61)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L59-L64", "id": "ef5acc7638533a4c3851662c1a1deb26737ee655c997bd66609e5f8f44450537", "check": "incorrect-equality", "impact": "Medium", @@ -2039,6 +2047,7 @@ ], "description": "TestContractBalance.bad6() (tests/detectors/incorrect-equality/incorrect_equality.sol#66-71) uses a dangerous strict equality:\n\t- balance == 10000000000000000000 (tests/detectors/incorrect-equality/incorrect_equality.sol#68)\n", "markdown": "[TestContractBalance.bad6()](tests/detectors/incorrect-equality/incorrect_equality.sol#L66-L71) uses a dangerous strict equality:\n\t- [balance == 10000000000000000000](tests/detectors/incorrect-equality/incorrect_equality.sol#L68)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L66-L71", "id": "5515950c15517f81d4973f0937db8199d9515c3ef5cc8f4e2459a1f5f2b10519", "check": "incorrect-equality", "impact": "Medium", @@ -2223,6 +2232,7 @@ ], "description": "TestSolidityKeyword.bad0() (tests/detectors/incorrect-equality/incorrect_equality.sol#123-125) uses a dangerous strict equality:\n\t- require(bool)(now == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#124)\n", "markdown": "[TestSolidityKeyword.bad0()](tests/detectors/incorrect-equality/incorrect_equality.sol#L123-L125) uses a dangerous strict equality:\n\t- [require(bool)(now == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L124)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L123-L125", "id": "3c0287d7827cffc855ee2366a85204a9840c570f3df2a946ee8fef4ae7020f67", "check": "incorrect-equality", "impact": "Medium", @@ -2407,6 +2417,7 @@ ], "description": "TestSolidityKeyword.bad1() (tests/detectors/incorrect-equality/incorrect_equality.sol#127-129) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#128)\n", "markdown": "[TestSolidityKeyword.bad1()](tests/detectors/incorrect-equality/incorrect_equality.sol#L127-L129) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L128)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L127-L129", "id": "ad2bdecc821ce70ea7719cb08115739f7c2dfa5d78588b928dc6c41498c3b94f", "check": "incorrect-equality", "impact": "Medium", @@ -2591,6 +2602,7 @@ ], "description": "TestSolidityKeyword.bad2() (tests/detectors/incorrect-equality/incorrect_equality.sol#131-133) uses a dangerous strict equality:\n\t- require(bool)(block.number == 0) (tests/detectors/incorrect-equality/incorrect_equality.sol#132)\n", "markdown": "[TestSolidityKeyword.bad2()](tests/detectors/incorrect-equality/incorrect_equality.sol#L131-L133) uses a dangerous strict equality:\n\t- [require(bool)(block.number == 0)](tests/detectors/incorrect-equality/incorrect_equality.sol#L132)\n", + "first_markdown_element": "tests/detectors/incorrect-equality/incorrect_equality.sol#L131-L133", "id": "7f5d37ef2678b64eb2b3a0745a348e7571b58afac6a3037430c23c7b5d4c5422", "check": "incorrect-equality", "impact": "Medium", diff --git a/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json b/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json index 5047bd9a9..4b2966b77 100644 --- a/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json +++ b/tests/detectors/incorrect-modifier/modifier_default.sol.0.4.25.ModifierDefaultDetection.json @@ -99,6 +99,7 @@ ], "description": "Modifier Test.noResult() (tests/detectors/incorrect-modifier/modifier_default.sol#2-6) does not always execute _; or revert", "markdown": "Modifier [Test.noResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L2-L6) does not always execute _; or revert", + "first_markdown_element": "tests/detectors/incorrect-modifier/modifier_default.sol#L2-L6", "id": "e83e0a544940d3ddd9ea8fe0ae0277bec4660926110809cfd28153817969c3a3", "check": "incorrect-modifier", "impact": "Low", @@ -203,6 +204,7 @@ ], "description": "Modifier Test.requireAssertNoResult() (tests/detectors/incorrect-modifier/modifier_default.sol#18-22) does not always execute _; or revert", "markdown": "Modifier [Test.requireAssertNoResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L18-L22) does not always execute _; or revert", + "first_markdown_element": "tests/detectors/incorrect-modifier/modifier_default.sol#L18-L22", "id": "35d07e11ee69abb8fb0e63dddefc1ab059bf450c71c992f70c5f96e484fbcbcc", "check": "incorrect-modifier", "impact": "Low", @@ -314,6 +316,7 @@ ], "description": "Modifier Test.loopsNoResult() (tests/detectors/incorrect-modifier/modifier_default.sol#30-41) does not always execute _; or revert", "markdown": "Modifier [Test.loopsNoResult()](tests/detectors/incorrect-modifier/modifier_default.sol#L30-L41) does not always execute _; or revert", + "first_markdown_element": "tests/detectors/incorrect-modifier/modifier_default.sol#L30-L41", "id": "0ba95ef5faf2a00c06d4f83c5159220d1cd06bc346a1287a6634334b7a0c433f", "check": "incorrect-modifier", "impact": "Low", diff --git a/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json b/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json index 066ae397b..8e9d41744 100644 --- a/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json +++ b/tests/detectors/incorrect-unary/invalid_unary_expression.sol.0.4.25.IncorrectUnaryExpressionDetection.json @@ -57,6 +57,7 @@ ], "description": "C.c (tests/detectors/incorrect-unary/invalid_unary_expression.sol#4) uses an dangerous unary operator: (b = + 1)\n", "markdown": "[C.c](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L4) uses an dangerous unary operator: (b = + 1)\n", + "first_markdown_element": "tests/detectors/incorrect-unary/invalid_unary_expression.sol#L4", "id": "98d05a4acbe13ff0e6fa795af35dc2002541cc7607f3f4d7ffb356f9d33681bd", "check": "incorrect-unary", "impact": "Low", @@ -209,6 +210,7 @@ ], "description": "C.f() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = + 144444 (tests/detectors/incorrect-unary/invalid_unary_expression.sol#8)\n", "markdown": "[C.f()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = + 144444](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L8)\n", + "first_markdown_element": "tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14", "id": "7595a3dac85785e5438d50c6b51b74329ce67fb73e71db0557eddd7fe0b20a75", "check": "incorrect-unary", "impact": "Low", @@ -361,6 +363,7 @@ ], "description": "C.f() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#6-14) uses an dangerous unary operator: x = (x = + 1) (tests/detectors/incorrect-unary/invalid_unary_expression.sol#9)\n", "markdown": "[C.f()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14) uses an dangerous unary operator: [x = (x = + 1)](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L9)\n", + "first_markdown_element": "tests/detectors/incorrect-unary/invalid_unary_expression.sol#L6-L14", "id": "2a34e309de20d52cb8b386d6f5f166ae6847f1abfe840f0fe50f5801799f2425", "check": "incorrect-unary", "impact": "Low", @@ -525,6 +528,7 @@ ], "description": "C.slitherConstructorVariables() (tests/detectors/incorrect-unary/invalid_unary_expression.sol#1-15) uses an dangerous unary operator: c = (b = + 1) (tests/detectors/incorrect-unary/invalid_unary_expression.sol#4)\n", "markdown": "[C.slitherConstructorVariables()](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L1-L15) uses an dangerous unary operator: [c = (b = + 1)](tests/detectors/incorrect-unary/invalid_unary_expression.sol#L4)\n", + "first_markdown_element": "tests/detectors/incorrect-unary/invalid_unary_expression.sol#L1-L15", "id": "44f9cc4f47d5a925b4aceeff067e3d849153ee6577a1f41fb25b329156050b80", "check": "incorrect-unary", "impact": "Low", diff --git a/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json b/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json index 50ace190c..de6d41715 100644 --- a/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json +++ b/tests/detectors/locked-ether/locked_ether-0.5.1.sol.0.5.1.LockedEther.json @@ -70,6 +70,7 @@ ], "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/locked_ether-0.5.1.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/locked_ether-0.5.1.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/locked_ether-0.5.1.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/locked_ether-0.5.1.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "first_markdown_element": "tests/detectors/locked-ether/locked_ether-0.5.1.sol#L26", "id": "38b2d47301e59ffa598ec48a8e874e6a7070d6cf4e4ab2909f33a8b72fc28a4b", "check": "locked-ether", "impact": "Medium", diff --git a/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json b/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json index 9a081738d..b515162ee 100644 --- a/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json +++ b/tests/detectors/locked-ether/locked_ether.sol.0.4.25.LockedEther.json @@ -70,6 +70,7 @@ ], "description": "Contract locking ether found in :\n\tContract OnlyLocked (tests/detectors/locked-ether/locked_ether.sol#26) has payable functions:\n\t - Locked.receive() (tests/detectors/locked-ether/locked_ether.sol#4-6)\n\tBut does not have a function to withdraw the ether\n", "markdown": "Contract locking ether found in :\n\tContract [OnlyLocked](tests/detectors/locked-ether/locked_ether.sol#L26) has payable functions:\n\t - [Locked.receive()](tests/detectors/locked-ether/locked_ether.sol#L4-L6)\n\tBut does not have a function to withdraw the ether\n", + "first_markdown_element": "tests/detectors/locked-ether/locked_ether.sol#L26", "id": "38b2d47301e59ffa598ec48a8e874e6a7070d6cf4e4ab2909f33a8b72fc28a4b", "check": "locked-ether", "impact": "Medium", diff --git a/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json b/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json index 77c4d1c13..75a5ba5a3 100644 --- a/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json +++ b/tests/detectors/low-level-calls/low_level_calls.sol.0.4.25.LowLevelCalls.json @@ -115,6 +115,7 @@ ], "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/low_level_calls.sol#6)\n", "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/low_level_calls.sol#L6)\n", + "first_markdown_element": "tests/detectors/low-level-calls/low_level_calls.sol#L5-L7", "id": "d017cb7447192393962f70f0ae2db6a8add9289b5cf4d4afbab9f41dec07f613", "check": "low-level-calls", "impact": "Informational", diff --git a/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json b/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json index 77c4d1c13..75a5ba5a3 100644 --- a/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json +++ b/tests/detectors/low-level-calls/low_level_calls.sol.0.5.1.LowLevelCalls.json @@ -115,6 +115,7 @@ ], "description": "Low level call in Sender.send(address) (tests/detectors/low-level-calls/low_level_calls.sol#5-7):\n\t- _receiver.call.value(msg.value).gas(7777)() (tests/detectors/low-level-calls/low_level_calls.sol#6)\n", "markdown": "Low level call in [Sender.send(address)](tests/detectors/low-level-calls/low_level_calls.sol#L5-L7):\n\t- [_receiver.call.value(msg.value).gas(7777)()](tests/detectors/low-level-calls/low_level_calls.sol#L6)\n", + "first_markdown_element": "tests/detectors/low-level-calls/low_level_calls.sol#L5-L7", "id": "d017cb7447192393962f70f0ae2db6a8add9289b5cf4d4afbab9f41dec07f613", "check": "low-level-calls", "impact": "Informational", diff --git a/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json b/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json index fc6c7243b..df658ca0d 100644 --- a/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json +++ b/tests/detectors/mapping-deletion/MappingDeletion.sol.0.4.25.MappingDeletionDetection.json @@ -177,6 +177,7 @@ ], "description": "Lib.deleteSt(Lib.MyStruct[1]) (tests/detectors/mapping-deletion/MappingDeletion.sol#9-11) deletes Lib.MyStruct (tests/detectors/mapping-deletion/MappingDeletion.sol#5-7) which contains a mapping:\n\t-delete st[0] (tests/detectors/mapping-deletion/MappingDeletion.sol#10)\n", "markdown": "[Lib.deleteSt(Lib.MyStruct[1])](tests/detectors/mapping-deletion/MappingDeletion.sol#L9-L11) deletes [Lib.MyStruct](tests/detectors/mapping-deletion/MappingDeletion.sol#L5-L7) which contains a mapping:\n\t-[delete st[0]](tests/detectors/mapping-deletion/MappingDeletion.sol#L10)\n", + "first_markdown_element": "tests/detectors/mapping-deletion/MappingDeletion.sol#L9-L11", "id": "d618551637c257938461c33070c5339207b75de2bb11ff88d92bd9679252f307", "check": "mapping-deletion", "impact": "Medium", @@ -416,6 +417,7 @@ ], "description": "Balances.deleteBalance(uint256) (tests/detectors/mapping-deletion/MappingDeletion.sol#28-31) deletes Balances.BalancesStruct (tests/detectors/mapping-deletion/MappingDeletion.sol#17-20) which contains a mapping:\n\t-delete stackBalance[idx] (tests/detectors/mapping-deletion/MappingDeletion.sol#30)\n", "markdown": "[Balances.deleteBalance(uint256)](tests/detectors/mapping-deletion/MappingDeletion.sol#L28-L31) deletes [Balances.BalancesStruct](tests/detectors/mapping-deletion/MappingDeletion.sol#L17-L20) which contains a mapping:\n\t-[delete stackBalance[idx]](tests/detectors/mapping-deletion/MappingDeletion.sol#L30)\n", + "first_markdown_element": "tests/detectors/mapping-deletion/MappingDeletion.sol#L28-L31", "id": "a1e8bc34ec8ef7969409701b3c851749c4ba00dcbbef2cabcdf7e3f49724034e", "check": "mapping-deletion", "impact": "Medium", diff --git a/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json b/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json index c5086a742..ef0bd6011 100644 --- a/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json +++ b/tests/detectors/missing-zero-check/missing_zero_address_validation.sol.0.5.12.MissingZeroAddressValidation.json @@ -267,6 +267,7 @@ ], "description": "C.bad0_set_owner(address).new_owner (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#10) lacks a zero-check on :\n\t\t- owner = new_owner (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#11)\n", "markdown": "[C.bad0_set_owner(address).new_owner](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L10) lacks a zero-check on :\n\t\t- [owner = new_owner](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L11)\n", + "first_markdown_element": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L10", "id": "168903dd25312ca9d856795d30f3a7d5ae7bf7fd19db47b70bc50aaef5769e67", "check": "missing-zero-check", "impact": "Low", @@ -673,6 +674,7 @@ ], "description": "C.bad1_send(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#14) lacks a zero-check on :\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#15)\n\t\t- addr.send(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#16)\n", "markdown": "[C.bad1_send(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L14) lacks a zero-check on :\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L15)\n\t\t- [addr.send(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L16)\n", + "first_markdown_element": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L14", "id": "1c75c9e23f21886747d738e7fb033b4faf60cbeec7e7bc10b30cad6e05150323", "check": "missing-zero-check", "impact": "Low", @@ -945,6 +947,7 @@ ], "description": "C.bad2_transfer(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#19) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#20)\n", "markdown": "[C.bad2_transfer(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L19) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L20)\n", + "first_markdown_element": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L19", "id": "cf8492ece629b57e628dd585c402012a4f4ee997e3d1ffb1c7f9cf18490c9b8b", "check": "missing-zero-check", "impact": "Low", @@ -1219,6 +1222,7 @@ ], "description": "C.bad3_transfer(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#23) lacks a zero-check on :\n\t\t- addr.transfer(msg.value) (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#24)\n", "markdown": "[C.bad3_transfer(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L23) lacks a zero-check on :\n\t\t- [addr.transfer(msg.value)](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L24)\n", + "first_markdown_element": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L23", "id": "f4a3088c9894fad3e98137cc3751ac06bbac74f5428ad0e20728d738044ce365", "check": "missing-zero-check", "impact": "Low", @@ -1491,6 +1495,7 @@ ], "description": "C.bad4_call(address).addr (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#28) lacks a zero-check on :\n\t\t- addr.call.value(msg.value)() (tests/detectors/missing-zero-check/missing_zero_address_validation.sol#29)\n", "markdown": "[C.bad4_call(address).addr](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L28) lacks a zero-check on :\n\t\t- [addr.call.value(msg.value)()](tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L29)\n", + "first_markdown_element": "tests/detectors/missing-zero-check/missing_zero_address_validation.sol#L28", "id": "ff8eb251a6d4b6de4f1c4fa3602968a4c69b232892dbc1d9d6adac5cb744f081", "check": "missing-zero-check", "impact": "Low", diff --git a/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json b/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json index b4c8e78d9..c98e7cf47 100644 --- a/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json +++ b/tests/detectors/naming-convention/naming_convention.sol.0.4.25.NamingConvention.json @@ -72,6 +72,7 @@ ], "description": "Contract naming (tests/detectors/naming-convention/naming_convention.sol#3-48) is not in CapWords\n", "markdown": "Contract [naming](tests/detectors/naming-convention/naming_convention.sol#L3-L48) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L3-L48", "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", "check": "naming-convention", "impact": "Informational", @@ -171,6 +172,7 @@ ], "description": "Struct naming.test (tests/detectors/naming-convention/naming_convention.sol#14-16) is not in CapWords\n", "markdown": "Struct [naming.test](tests/detectors/naming-convention/naming_convention.sol#L14-L16) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L14-L16", "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", "check": "naming-convention", "impact": "Informational", @@ -269,6 +271,7 @@ ], "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/naming_convention.sol#23) is not in CapWords\n", "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/naming_convention.sol#L23) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L23", "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", "check": "naming-convention", "impact": "Informational", @@ -370,6 +373,7 @@ ], "description": "Function naming.GetOne() (tests/detectors/naming-convention/naming_convention.sol#30-33) is not in mixedCase\n", "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/naming_convention.sol#L30-L33) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L30-L33", "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", "check": "naming-convention", "impact": "Informational", @@ -491,6 +495,7 @@ ], "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/naming_convention.sol#35) is not in mixedCase\n", "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/naming_convention.sol#L35) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L35", "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", "check": "naming-convention", "impact": "Informational", @@ -588,6 +593,7 @@ ], "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L9", "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", "check": "naming-convention", "impact": "Informational", @@ -685,6 +691,7 @@ ], "description": "Variable naming.Var_One (tests/detectors/naming-convention/naming_convention.sol#11) is not in mixedCase\n", "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/naming_convention.sol#L11) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L11", "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", "check": "naming-convention", "impact": "Informational", @@ -782,6 +789,7 @@ ], "description": "Enum naming.numbers (tests/detectors/naming-convention/naming_convention.sol#6) is not in CapWords\n", "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/naming_convention.sol#L6) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L6", "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", "check": "naming-convention", "impact": "Informational", @@ -882,6 +890,7 @@ ], "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/naming_convention.sol#41-43) is not in mixedCase\n", "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/naming_convention.sol#L41-L43) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L41-L43", "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", "check": "naming-convention", "impact": "Informational", @@ -970,6 +979,7 @@ ], "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/naming_convention.sol#59) is not in mixedCase\n", "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/naming_convention.sol#L59) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L59", "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", "check": "naming-convention", "impact": "Informational", @@ -1036,6 +1046,7 @@ ], "description": "Variable T._myPublicVar (tests/detectors/naming-convention/naming_convention.sol#56) is not in mixedCase\n", "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/naming_convention.sol#L56) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L56", "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", "check": "naming-convention", "impact": "Informational", @@ -1102,6 +1113,7 @@ ], "description": "Variable T.l (tests/detectors/naming-convention/naming_convention.sol#67) used l, O, I, which should not be used\n", "markdown": "Variable [T.l](tests/detectors/naming-convention/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L67", "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json b/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json index b4c8e78d9..c98e7cf47 100644 --- a/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json +++ b/tests/detectors/naming-convention/naming_convention.sol.0.5.1.NamingConvention.json @@ -72,6 +72,7 @@ ], "description": "Contract naming (tests/detectors/naming-convention/naming_convention.sol#3-48) is not in CapWords\n", "markdown": "Contract [naming](tests/detectors/naming-convention/naming_convention.sol#L3-L48) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L3-L48", "id": "7247d550fb327e3aeb21c82714137e5b45a7e9eeaa6a1bc878102c8081033f85", "check": "naming-convention", "impact": "Informational", @@ -171,6 +172,7 @@ ], "description": "Struct naming.test (tests/detectors/naming-convention/naming_convention.sol#14-16) is not in CapWords\n", "markdown": "Struct [naming.test](tests/detectors/naming-convention/naming_convention.sol#L14-L16) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L14-L16", "id": "0ef3ea412cb30b1f0df5fa2af4a7a06e2bf0373fae0770fd9e301aed12c209cf", "check": "naming-convention", "impact": "Informational", @@ -269,6 +271,7 @@ ], "description": "Event namingevent_(uint256) (tests/detectors/naming-convention/naming_convention.sol#23) is not in CapWords\n", "markdown": "Event [namingevent_(uint256)](tests/detectors/naming-convention/naming_convention.sol#L23) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L23", "id": "978ecf4a2c8b96d947e60f6601cf60d0e25e07ebe80ebbc37a7e7f279afd1405", "check": "naming-convention", "impact": "Informational", @@ -370,6 +373,7 @@ ], "description": "Function naming.GetOne() (tests/detectors/naming-convention/naming_convention.sol#30-33) is not in mixedCase\n", "markdown": "Function [naming.GetOne()](tests/detectors/naming-convention/naming_convention.sol#L30-L33) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L30-L33", "id": "bf6f97d6a82b84284efdade52d01bd6112007426e2e88d1568190d63c5c4a049", "check": "naming-convention", "impact": "Informational", @@ -491,6 +495,7 @@ ], "description": "Parameter naming.setInt(uint256,uint256).Number2 (tests/detectors/naming-convention/naming_convention.sol#35) is not in mixedCase\n", "markdown": "Parameter [naming.setInt(uint256,uint256).Number2](tests/detectors/naming-convention/naming_convention.sol#L35) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L35", "id": "f03bff0b488524254e19ff7d688d34211cd2f29934e22417c9f1fa43fc4a08ad", "check": "naming-convention", "impact": "Informational", @@ -588,6 +593,7 @@ ], "description": "Constant naming.MY_other_CONSTANT (tests/detectors/naming-convention/naming_convention.sol#9) is not in UPPER_CASE_WITH_UNDERSCORES\n", "markdown": "Constant [naming.MY_other_CONSTANT](tests/detectors/naming-convention/naming_convention.sol#L9) is not in UPPER_CASE_WITH_UNDERSCORES\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L9", "id": "596c2e8064f8f2df55cd5c878eb59c0a74ac7f20719c420d8af307f2431a1a90", "check": "naming-convention", "impact": "Informational", @@ -685,6 +691,7 @@ ], "description": "Variable naming.Var_One (tests/detectors/naming-convention/naming_convention.sol#11) is not in mixedCase\n", "markdown": "Variable [naming.Var_One](tests/detectors/naming-convention/naming_convention.sol#L11) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L11", "id": "34b7c817201b3f3086fc3541f140898d9e9aabe999b1c0a6ef8639ec04351f26", "check": "naming-convention", "impact": "Informational", @@ -782,6 +789,7 @@ ], "description": "Enum naming.numbers (tests/detectors/naming-convention/naming_convention.sol#6) is not in CapWords\n", "markdown": "Enum [naming.numbers](tests/detectors/naming-convention/naming_convention.sol#L6) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L6", "id": "7c87b076ea2865060182cf11d155caadb1dcea415ccce0ca8563a74a01611fc2", "check": "naming-convention", "impact": "Informational", @@ -882,6 +890,7 @@ ], "description": "Modifier naming.CantDo() (tests/detectors/naming-convention/naming_convention.sol#41-43) is not in mixedCase\n", "markdown": "Modifier [naming.CantDo()](tests/detectors/naming-convention/naming_convention.sol#L41-L43) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L41-L43", "id": "b8a754a01bd47127f00032cdedd0ade3e27e6543631d8f5bc9e44365ab732895", "check": "naming-convention", "impact": "Informational", @@ -970,6 +979,7 @@ ], "description": "Parameter T.test(uint256,uint256)._used (tests/detectors/naming-convention/naming_convention.sol#59) is not in mixedCase\n", "markdown": "Parameter [T.test(uint256,uint256)._used](tests/detectors/naming-convention/naming_convention.sol#L59) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L59", "id": "818962ad9f50f13eb87b5c7deade22666431945fb60055f572b38246cfbf311e", "check": "naming-convention", "impact": "Informational", @@ -1036,6 +1046,7 @@ ], "description": "Variable T._myPublicVar (tests/detectors/naming-convention/naming_convention.sol#56) is not in mixedCase\n", "markdown": "Variable [T._myPublicVar](tests/detectors/naming-convention/naming_convention.sol#L56) is not in mixedCase\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L56", "id": "8acd53815786acad5b92b51366daf79182a67ab438daa41a6e1ec8a9601fa9a3", "check": "naming-convention", "impact": "Informational", @@ -1102,6 +1113,7 @@ ], "description": "Variable T.l (tests/detectors/naming-convention/naming_convention.sol#67) used l, O, I, which should not be used\n", "markdown": "Variable [T.l](tests/detectors/naming-convention/naming_convention.sol#L67) used l, O, I, which should not be used\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention.sol#L67", "id": "b595f9e6d03b8b501b7c4a9bf8ff0ad9bf11448a25f53d63ab5031c95f8ae89c", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json b/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json index 547e6aef8..b4dd91676 100644 --- a/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json +++ b/tests/detectors/naming-convention/naming_convention_ignore.sol.0.4.25.NamingConvention.json @@ -67,6 +67,7 @@ ], "description": "Struct naming.test3 (tests/detectors/naming-convention/naming_convention_ignore.sol#18-20) is not in CapWords\n", "markdown": "Struct [naming.test3](tests/detectors/naming-convention/naming_convention_ignore.sol#L18-L20) is not in CapWords\n", + "first_markdown_element": "tests/detectors/naming-convention/naming_convention_ignore.sol#L18-L20", "id": "34b66b0b5acf6c00b066dd7f5bbcdbc6f3879ab5ece850f113d00e3318eac10f", "check": "naming-convention", "impact": "Informational", diff --git a/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json b/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json index f4126bd95..584ac2838 100644 --- a/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json +++ b/tests/detectors/pragma/pragma.0.4.24.sol.0.4.25.ConstantPragma.json @@ -57,6 +57,7 @@ ], "description": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.23', '^0.4.24']\n\t- ^0.4.23 (tests/detectors/pragma/pragma.0.4.23.sol#1)\n\t- ^0.4.24 (tests/detectors/pragma/pragma.0.4.24.sol#1)\n", "markdown": "Different versions of Solidity is used in :\n\t- Version used: ['^0.4.23', '^0.4.24']\n\t- [^0.4.23](tests/detectors/pragma/pragma.0.4.23.sol#L1)\n\t- [^0.4.24](tests/detectors/pragma/pragma.0.4.24.sol#L1)\n", + "first_markdown_element": "tests/detectors/pragma/pragma.0.4.23.sol#L1", "id": "1379d7b43e8c8bc939547079131e06fc888bb82740880718f8ff3409a6d5173e", "check": "pragma", "impact": "Informational", diff --git a/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json b/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json index d7e8d40ea..bc77188ec 100644 --- a/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json +++ b/tests/detectors/public-mappings-nested/public_mappings_nested.sol.0.4.25.PublicMappingNested.json @@ -60,6 +60,7 @@ ], "description": "Bug.testMapping (tests/detectors/public-mappings-nested/public_mappings_nested.sol#14) is a public mapping with nested variables\n", "markdown": "[Bug.testMapping](tests/detectors/public-mappings-nested/public_mappings_nested.sol#L14) is a public mapping with nested variables\n", + "first_markdown_element": "tests/detectors/public-mappings-nested/public_mappings_nested.sol#L14", "id": "100978112524def620b003331f34b2b51eb78cae6f7eb2793d9671b4b7bb858a", "check": "public-mappings-nested", "impact": "High", diff --git a/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json b/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json index ce0198f8c..1e6e017ab 100644 --- a/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json +++ b/tests/detectors/redundant-statements/redundant_statements.sol.0.4.25.RedundantStatements.json @@ -116,6 +116,7 @@ ], "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/redundant_statements.sol#6)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/redundant_statements.sol#L6)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L6", "id": "cff54481eae76053f9cae0d4f77a2e5092461dc3fcb9e4e2f8605afb6aa832aa", "check": "redundant-statements", "impact": "Informational", @@ -237,6 +238,7 @@ ], "description": "Redundant expression \"bool (tests/detectors/redundant-statements/redundant_statements.sol#7)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[bool](tests/detectors/redundant-statements/redundant_statements.sol#L7)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L7", "id": "bd643774adde96fa093cf2ec70d9a80fc2999dba8b61b60d0df19366003d74d5", "check": "redundant-statements", "impact": "Informational", @@ -358,6 +360,7 @@ ], "description": "Redundant expression \"RedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#8)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L8)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L8", "id": "d93991180e8fe3accc3157f286d3a6781ed5c03398d68c0b9fde918a01d65ede", "check": "redundant-statements", "impact": "Informational", @@ -480,6 +483,7 @@ ], "description": "Redundant expression \"uint256 (tests/detectors/redundant-statements/redundant_statements.sol#12)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[uint256](tests/detectors/redundant-statements/redundant_statements.sol#L12)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L12", "id": "262267538723f822ebe065e5976738ef3f564c791aaddb26867d202602de1eea", "check": "redundant-statements", "impact": "Informational", @@ -602,6 +606,7 @@ ], "description": "Redundant expression \"assert(bool) (tests/detectors/redundant-statements/redundant_statements.sol#13)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[assert(bool)](tests/detectors/redundant-statements/redundant_statements.sol#L13)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L13", "id": "00295b0d55ceb6d73eec5a4905d137edf751e11c951252b54cd42c43ace68ffd", "check": "redundant-statements", "impact": "Informational", @@ -724,6 +729,7 @@ ], "description": "Redundant expression \"test (tests/detectors/redundant-statements/redundant_statements.sol#14)\" inRedundantStatementsContract (tests/detectors/redundant-statements/redundant_statements.sol#3-18)\n", "markdown": "Redundant expression \"[test](tests/detectors/redundant-statements/redundant_statements.sol#L14)\" in[RedundantStatementsContract](tests/detectors/redundant-statements/redundant_statements.sol#L3-L18)\n", + "first_markdown_element": "tests/detectors/redundant-statements/redundant_statements.sol#L14", "id": "ac50e063af6ebd33a702aa136415f7babc5fef3dc5212730b054d8a089b04e23", "check": "redundant-statements", "impact": "Informational", diff --git a/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json b/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json index 7c944fc9e..581bc9824 100644 --- a/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json +++ b/tests/detectors/reentrancy-before-write/reentrancy-write.sol.0.4.26.ReentrancyReadBeforeWritten.json @@ -265,6 +265,7 @@ ], "description": "Reentrancy in ReentrancyWrite.bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#6-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- notCalled = false (tests/detectors/reentrancy-before-write/reentrancy-write.sol#11)\n", "markdown": "Reentrancy in [ReentrancyWrite.bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L6-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [notCalled = false](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L11)\n", + "first_markdown_element": "tests/detectors/reentrancy-before-write/reentrancy-write.sol#L6-L12", "id": "e078084eca02a4723da5dcb8a78af564de225e53ecc5cb8d98262c19296f7233", "check": "reentrancy-no-eth", "impact": "Medium", @@ -814,6 +815,7 @@ ], "description": "Reentrancy in ReentrancyWrite.bad1(address) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#14-19):\n\tExternal calls:\n\t- success = msg.sender.call() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#16)\n\t- bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#18)\n\t\t- ! (msg.sender.call()) (tests/detectors/reentrancy-before-write/reentrancy-write.sol#8)\n\tState variables written after the call(s):\n\t- bad0() (tests/detectors/reentrancy-before-write/reentrancy-write.sol#18)\n\t\t- notCalled = false (tests/detectors/reentrancy-before-write/reentrancy-write.sol#11)\n", "markdown": "Reentrancy in [ReentrancyWrite.bad1(address)](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L14-L19):\n\tExternal calls:\n\t- [success = msg.sender.call()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L16)\n\t- [bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L18)\n\t\t- [! (msg.sender.call())](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L8)\n\tState variables written after the call(s):\n\t- [bad0()](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L18)\n\t\t- [notCalled = false](tests/detectors/reentrancy-before-write/reentrancy-write.sol#L11)\n", + "first_markdown_element": "tests/detectors/reentrancy-before-write/reentrancy-write.sol#L14-L19", "id": "2ee9fea9a2fa34c6702dcb539c392ab810468f83a66fb21a2df33a1f3d4747cf", "check": "reentrancy-no-eth", "impact": "Medium", diff --git a/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json b/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json index 46c1bb4f3..f62708fa0 100644 --- a/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json +++ b/tests/detectors/reentrancy-benign/reentrancy-benign.sol.0.4.26.ReentrancyBenign.json @@ -487,6 +487,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad0() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#7-12):\n\tExternal calls:\n\t- ! (msg.sender.call()) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#8)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#11)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad0()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L7-L12):\n\tExternal calls:\n\t- [! (msg.sender.call())](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L8)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L11)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L7-L12", "id": "23f4fbdccaa9fd4c46c12759d22b8f19d92b6652303c84f8a9e59012a83cbf9c", "check": "reentrancy-benign", "impact": "Low", @@ -975,6 +976,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad1(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#14-18):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#15)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#17)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad1(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L14-L18):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L15)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L17)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L14-L18", "id": "404eb3881e9d5765548d023eeacff9a2147786601b5d7eaa204c3838b7d665d9", "check": "reentrancy-benign", "impact": "Low", @@ -1743,6 +1745,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad2(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#20-29):\n\tExternal calls:\n\t- success = target.call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#21)\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#23)\n\tExternal calls sending eth:\n\t- address(target).call.value(1000)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#23)\n\tState variables written after the call(s):\n\t- counter += 1 (tests/detectors/reentrancy-benign/reentrancy-benign.sol#24)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad2(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L20-L29):\n\tExternal calls:\n\t- [success = target.call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L21)\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L23)\n\tExternal calls sending eth:\n\t- [address(target).call.value(1000)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L23)\n\tState variables written after the call(s):\n\t- [counter += 1](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L24)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L20-L29", "id": "cf749257747679a6caaf9ae293360de238a17a22a13320f189e438e4e226276f", "check": "reentrancy-benign", "impact": "Low", @@ -2601,6 +2604,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad3(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#31-35):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#32)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#51)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#33)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad3(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L31-L35):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L32)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L51)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L33)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L31-L35", "id": "5419993a97881c5ada3458672ea5955e9eefae288ac2d4fd84854499ff1569b5", "check": "reentrancy-benign", "impact": "Low", @@ -3961,6 +3965,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad4(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#37-42):\n\tExternal calls:\n\t- externalCaller(target) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#38)\n\t\t- address(target).call() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#51)\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tExternal calls sending eth:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#39)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#40)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad4(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L37-L42):\n\tExternal calls:\n\t- [externalCaller(target)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L38)\n\t\t- [address(target).call()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L51)\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tExternal calls sending eth:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L39)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L40)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L37-L42", "id": "fa81e2a2e03ed4653b8e905384a02bfa7fedc6f9dbbcfed919c9c7e7d39958eb", "check": "reentrancy-benign", "impact": "Low", @@ -4571,6 +4576,7 @@ ], "description": "Reentrancy in ReentrancyBenign.bad5(address) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#44-48):\n\tExternal calls:\n\t- ethSender(address(0)) (tests/detectors/reentrancy-benign/reentrancy-benign.sol#45)\n\t\t- address(target).call.value(1)() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#55)\n\tState variables written after the call(s):\n\t- varChanger() (tests/detectors/reentrancy-benign/reentrancy-benign.sol#46)\n\t\t- anotherVariableToChange ++ (tests/detectors/reentrancy-benign/reentrancy-benign.sol#59)\n", "markdown": "Reentrancy in [ReentrancyBenign.bad5(address)](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L44-L48):\n\tExternal calls:\n\t- [ethSender(address(0))](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L45)\n\t\t- [address(target).call.value(1)()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L55)\n\tState variables written after the call(s):\n\t- [varChanger()](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L46)\n\t\t- [anotherVariableToChange ++](tests/detectors/reentrancy-benign/reentrancy-benign.sol#L59)\n", + "first_markdown_element": "tests/detectors/reentrancy-benign/reentrancy-benign.sol#L44-L48", "id": "ef84aa3ab4543f3983d06b6aa80c190924de70eb4e679a9a4330efa67f406ae6", "check": "reentrancy-benign", "impact": "Low", diff --git a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json b/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json index e34e42b89..779072ed7 100644 --- a/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol.0.5.1.ReentrancyEth.json @@ -346,6 +346,7 @@ ], "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#14-22):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(userBalance[msg.sender])() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#21)\n", "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L14-L22):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(userBalance[msg.sender])()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L21)\n", + "first_markdown_element": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L14-L22", "id": "66c3cae6d50c9acab59408e70acfdedb029bd341d87629b67032dc07fb75e97d", "check": "reentrancy-eth", "impact": "High", @@ -700,6 +701,7 @@ ], "description": "Reentrancy in Reentrancy.withdrawBalance_fixed_3() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#44-53):\n\tExternal calls:\n\t- (ret,mem) = msg.sender.call.value(amount)() (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#49)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = amount (tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#51)\n", "markdown": "Reentrancy in [Reentrancy.withdrawBalance_fixed_3()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L44-L53):\n\tExternal calls:\n\t- [(ret,mem) = msg.sender.call.value(amount)()](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L49)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = amount](tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L51)\n", + "first_markdown_element": "tests/detectors/reentrancy-eth/reentrancy-0.5.1.sol#L44-L53", "id": "25b8576f6e42ebf79ffdbcd1ed96283f587bc88f3d0712bac71d5b786a14bbb9", "check": "reentrancy-eth", "impact": "High", diff --git a/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json b/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json index 82bee4271..bc7077294 100644 --- a/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/reentrancy.sol.0.4.25.ReentrancyEth.json @@ -397,6 +397,7 @@ ], "description": "Reentrancy in Reentrancy.withdrawBalance() (tests/detectors/reentrancy-eth/reentrancy.sol#14-21):\n\tExternal calls:\n\t- ! (msg.sender.call.value(userBalance[msg.sender])()) (tests/detectors/reentrancy-eth/reentrancy.sol#17)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy.sol#20)\n", "markdown": "Reentrancy in [Reentrancy.withdrawBalance()](tests/detectors/reentrancy-eth/reentrancy.sol#L14-L21):\n\tExternal calls:\n\t- [! (msg.sender.call.value(userBalance[msg.sender])())](tests/detectors/reentrancy-eth/reentrancy.sol#L17)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy.sol#L20)\n", + "first_markdown_element": "tests/detectors/reentrancy-eth/reentrancy.sol#L14-L21", "id": "6269e8974e176ba8871cdc851f735af4651f431dead223d867e770705c3d3306", "check": "reentrancy-eth", "impact": "High", @@ -796,6 +797,7 @@ ], "description": "Reentrancy in Reentrancy.withdrawBalance_nested() (tests/detectors/reentrancy-eth/reentrancy.sol#64-70):\n\tExternal calls:\n\t- msg.sender.call.value(amount / 2)() (tests/detectors/reentrancy-eth/reentrancy.sol#67)\n\tState variables written after the call(s):\n\t- userBalance[msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy.sol#68)\n", "markdown": "Reentrancy in [Reentrancy.withdrawBalance_nested()](tests/detectors/reentrancy-eth/reentrancy.sol#L64-L70):\n\tExternal calls:\n\t- [msg.sender.call.value(amount / 2)()](tests/detectors/reentrancy-eth/reentrancy.sol#L67)\n\tState variables written after the call(s):\n\t- [userBalance[msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy.sol#L68)\n", + "first_markdown_element": "tests/detectors/reentrancy-eth/reentrancy.sol#L64-L70", "id": "2fb2fe1e62bcd0c2921b856a9d4f2da8575a311b140d47dd3eb1a34ed1c5f69c", "check": "reentrancy-eth", "impact": "High", diff --git a/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json b/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json index e9929d1a8..b2733e9ec 100644 --- a/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json +++ b/tests/detectors/reentrancy-eth/reentrancy_indirect.sol.0.4.25.ReentrancyEth.json @@ -444,6 +444,7 @@ ], "description": "Reentrancy in Reentrancy.withdraw(address) (tests/detectors/reentrancy-eth/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/reentrancy_indirect.sol#24)\n\tExternal calls sending eth:\n\t- msg.sender.transfer(eth_deposed[token][msg.sender]) (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#23)\n\tState variables written after the call(s):\n\t- eth_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#26)\n\t- token_deposed[token][msg.sender] = 0 (tests/detectors/reentrancy-eth/reentrancy_indirect.sol#27)\n", "markdown": "Reentrancy in [Reentrancy.withdraw(address)](tests/detectors/reentrancy-eth/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/reentrancy_indirect.sol#L24)\n\tExternal calls sending eth:\n\t- [msg.sender.transfer(eth_deposed[token][msg.sender])](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L23)\n\tState variables written after the call(s):\n\t- [eth_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L26)\n\t- [token_deposed[token][msg.sender] = 0](tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L27)\n", + "first_markdown_element": "tests/detectors/reentrancy-eth/reentrancy_indirect.sol#L22-L29", "id": "6e23805ff4c3ce23f8f3ae167941b4a67257de1c0708934494dd826c2e62a5b3", "check": "reentrancy-eth", "impact": "High", diff --git a/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json b/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json index 0d9a91767..ed5861806 100644 --- a/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json +++ b/tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol.0.5.1.ReentrancyEvent.json @@ -216,6 +216,7 @@ ], "description": "Reentrancy in Test.bug(C) (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#14-17):\n\tExternal calls:\n\t- c.f() (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#15)\n\tEvent emitted after the call(s):\n\t- E() (tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#16)\n", "markdown": "Reentrancy in [Test.bug(C)](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L14-L17):\n\tExternal calls:\n\t- [c.f()](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L15)\n\tEvent emitted after the call(s):\n\t- [E()](tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L16)\n", + "first_markdown_element": "tests/detectors/reentrancy-events/reentrancy-0.5.1-events.sol#L14-L17", "id": "8b509fb9b9264baf213e2f3959b4d88d285f4591752f1cfbf0eb3c2da13e0e3e", "check": "reentrancy-events", "impact": "Low", diff --git a/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json b/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json index 078cbc3b5..74403ad4b 100644 --- a/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json +++ b/tests/detectors/reused-constructor/reused_base_constructor.sol.0.4.25.ReusedBaseConstructor.json @@ -117,6 +117,7 @@ ], "description": "C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", "markdown": "[C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18", "id": "2d9d2b1b6d2540f86fd909f9766e128da573e659f40a50835cc9adef3c4dbee8", "check": "reused-constructor", "impact": "Medium", @@ -238,6 +239,7 @@ ], "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24", "id": "5f3b188e7d6c737684f829c3fde96f739cd502b4aba8f3f6e3ceab7decffa618", "check": "reused-constructor", "impact": "Medium", @@ -359,6 +361,7 @@ ], "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24", "id": "b579da8996b6a1a35169bcae74ad8126c68fb0a1819d3977cea3e0e295ff2d5c", "check": "reused-constructor", "impact": "Medium", @@ -481,6 +484,7 @@ ], "description": "D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", "markdown": "[D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24", "id": "1f85bf19873eaee39a8f703b0c783aa86e34c91fad5556ee831eb7c6adcfdb77", "check": "reused-constructor", "impact": "Medium", @@ -646,6 +650,7 @@ ], "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor B.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#9-11) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) contract definition\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [B.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L9-L11) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) contract definition\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30", "id": "ee7d44329ffb81dc06e2a2f1b3a166a5115287a1175b32cf828b57479afbc4ae", "check": "reused-constructor", "impact": "Medium", @@ -789,6 +794,7 @@ ], "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor C.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#15-17) arguments more than once in inheritance hierarchy:\n\t- From E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) constructor definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) contract definition\n\t- From D (tests/detectors/reused-constructor/reused_base_constructor.sol#20-24) constructor definition\n", "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [C.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L15-L17) arguments more than once in inheritance hierarchy:\n\t- From [E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) constructor definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) contract definition\n\t- From [D](tests/detectors/reused-constructor/reused_base_constructor.sol#L20-L24) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30", "id": "33b16377cf3026b60d644e79d92682e6e626d7ad6598387440c9b20fd8aa44fe", "check": "reused-constructor", "impact": "Medium", @@ -911,6 +917,7 @@ ], "description": "E (tests/detectors/reused-constructor/reused_base_constructor.sol#26-30) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From C (tests/detectors/reused-constructor/reused_base_constructor.sol#14-18) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", "markdown": "[E](tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [C](tests/detectors/reused-constructor/reused_base_constructor.sol#L14-L18) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L26-L30", "id": "f5c86955c15d44fe9471680d12d37843a15ba934cbb124786cadab0919ea68d1", "check": "reused-constructor", "impact": "Medium", @@ -1035,6 +1042,7 @@ ], "description": "F (tests/detectors/reused-constructor/reused_base_constructor.sol#33-38) gives base constructor A.constructor(uint256) (tests/detectors/reused-constructor/reused_base_constructor.sol#3-5) arguments more than once in inheritance hierarchy:\n\t- From F (tests/detectors/reused-constructor/reused_base_constructor.sol#33-38) constructor definition\n\t- From B (tests/detectors/reused-constructor/reused_base_constructor.sol#8-12) constructor definition\n", "markdown": "[F](tests/detectors/reused-constructor/reused_base_constructor.sol#L33-L38) gives base constructor [A.constructor(uint256)](tests/detectors/reused-constructor/reused_base_constructor.sol#L3-L5) arguments more than once in inheritance hierarchy:\n\t- From [F](tests/detectors/reused-constructor/reused_base_constructor.sol#L33-L38) constructor definition\n\t- From [B](tests/detectors/reused-constructor/reused_base_constructor.sol#L8-L12) constructor definition\n", + "first_markdown_element": "tests/detectors/reused-constructor/reused_base_constructor.sol#L33-L38", "id": "b74eb2b11af7a004b623d28b035228963f09aed588c95efed636021f426c5cdc", "check": "reused-constructor", "impact": "Medium", diff --git a/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json b/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json index 54f3dc14a..ba9af9260 100644 --- a/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json +++ b/tests/detectors/rtlo/right_to_left_override.sol.0.4.25.RightToLeftOverride.json @@ -23,6 +23,7 @@ ], "description": "tests/detectors/rtlo/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", "markdown": "tests/detectors/rtlo/right_to_left_override.sol contains a unicode right-to-left-override character at byte offset 96:\n\t- b' test1(/*A\\xe2\\x80\\xae/*B*/2 , 1/*\\xe2\\x80\\xad'\n", + "first_markdown_element": "", "id": "37c4d2e4e10885656018f0bfd41fd410efa58869ae79a3937bfa6c2f41ac4027", "check": "rtlo", "impact": "High", diff --git a/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json b/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json index 2e0952218..5c8f5254c 100644 --- a/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json +++ b/tests/detectors/shadowing-abstract/shadowing_abstract.sol.0.4.25.ShadowingAbstractDetection.json @@ -87,6 +87,7 @@ ], "description": "DerivedContract.owner (tests/detectors/shadowing-abstract/shadowing_abstract.sol#7) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-abstract/shadowing_abstract.sol#2)\n", "markdown": "[DerivedContract.owner](tests/detectors/shadowing-abstract/shadowing_abstract.sol#L7) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-abstract/shadowing_abstract.sol#L2)\n", + "first_markdown_element": "tests/detectors/shadowing-abstract/shadowing_abstract.sol#L7", "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", "check": "shadowing-abstract", "impact": "Medium", diff --git a/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json b/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json index d526e730b..1b160b18b 100644 --- a/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json +++ b/tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol.0.4.25.BuiltinSymbolShadowing.json @@ -48,6 +48,7 @@ ], "description": "BaseContract.blockhash (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#4) (state variable) shadows built-in symbol\"\n", "markdown": "[BaseContract.blockhash](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L4) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L4", "id": "61d1c1452e694c321d00576decdf35c62efbe8860f664273955fadce5e063cc8", "check": "shadowing-builtin", "impact": "Low", @@ -101,6 +102,7 @@ ], "description": "BaseContract.now (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#5) (state variable) shadows built-in symbol\"\n", "markdown": "[BaseContract.now](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L5) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L5", "id": "942ad0405af0bc533374dded6e2474c53892747c98d2df14d59cbb6840fa18b3", "check": "shadowing-builtin", "impact": "Low", @@ -155,6 +157,7 @@ ], "description": "BaseContractrevert(bool) (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#7) (event) shadows built-in symbol\"\n", "markdown": "[BaseContractrevert(bool)](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L7) (event) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L7", "id": "9c428e61cb4832d899b2bb711c8d428154425dbadf5dfc2e2d857254824d8f72", "check": "shadowing-builtin", "impact": "Low", @@ -212,6 +215,7 @@ ], "description": "ExtendedContract.assert(bool) (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#13-15) (function) shadows built-in symbol\"\n", "markdown": "[ExtendedContract.assert(bool)](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L13-L15) (function) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L13-L15", "id": "b3a1b23c1daed52b1a2ff5fb76d4fcdf2bc0b2126524303321cf8e7835116d6f", "check": "shadowing-builtin", "impact": "Low", @@ -289,6 +293,7 @@ ], "description": "ExtendedContract.assert(bool).msg (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#14) (local variable) shadows built-in symbol\"\n", "markdown": "[ExtendedContract.assert(bool).msg](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L14) (local variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L14", "id": "a2a7e1e27320d38e52b51c9b1ec67cca0a403673ff6fdd59652f9cd8425d011f", "check": "shadowing-builtin", "impact": "Low", @@ -343,6 +348,7 @@ ], "description": "ExtendedContract.ecrecover (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#11) (state variable) shadows built-in symbol\"\n", "markdown": "[ExtendedContract.ecrecover](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L11) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L11", "id": "39737925cf3bd4ebf9a1c7bbe39da8b80ba28e5a3d93a938d1a4cca78a6a436d", "check": "shadowing-builtin", "impact": "Low", @@ -408,6 +414,7 @@ ], "description": "FurtherExtendedContract.require() (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#23-28) (modifier) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.require()](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L23-L28) (modifier) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L23-L28", "id": "db6c26c9a7c319c1a34c486e6e625c0906a2b118f8cd72f38a38c167832aab4f", "check": "shadowing-builtin", "impact": "Low", @@ -493,6 +500,7 @@ ], "description": "FurtherExtendedContract.require().keccak256 (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#25) (local variable) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.require().keccak256](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L25) (local variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L25", "id": "40f0453d27abf2d9ed76fe60853b6e2e0cd9a443d639e9da457460ea02b2bdc7", "check": "shadowing-builtin", "impact": "Low", @@ -578,6 +586,7 @@ ], "description": "FurtherExtendedContract.require().sha3 (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#26) (local variable) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.require().sha3](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L26) (local variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L26", "id": "c481dbbf77c99cb337740a656ebabae1c89bf13b9d7b7d315dcf54feeab1cd63", "check": "shadowing-builtin", "impact": "Low", @@ -637,6 +646,7 @@ ], "description": "FurtherExtendedContract.blockhash (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#19) (state variable) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.blockhash](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L19) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L19", "id": "d405ccbec679f921252d475591a890a89a023b375dc4994119967693692f8da9", "check": "shadowing-builtin", "impact": "Low", @@ -696,6 +706,7 @@ ], "description": "FurtherExtendedContract.this (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#20) (state variable) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.this](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L20) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L20", "id": "87e1cc0cb95181dd120d3e6e55d89fdc7b5cd01da2f89cd7a3d105738f57c10b", "check": "shadowing-builtin", "impact": "Low", @@ -755,6 +766,7 @@ ], "description": "FurtherExtendedContract.abi (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#21) (state variable) shadows built-in symbol\"\n", "markdown": "[FurtherExtendedContract.abi](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L21) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L21", "id": "4665243a2df090e3543ab26447528fa3401916f4669fe1264145891846d4bc40", "check": "shadowing-builtin", "impact": "Low", @@ -806,6 +818,7 @@ ], "description": "Reserved.mutable (tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#32) (state variable) shadows built-in symbol\"\n", "markdown": "[Reserved.mutable](tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L32) (state variable) shadows built-in symbol\"\n", + "first_markdown_element": "tests/detectors/shadowing-builtin/shadowing_builtin_symbols.sol#L32", "id": "11840553a9e11623596d7a07275814e65a5b1d90277ae0e2954cd8ce74d6a6d2", "check": "shadowing-builtin", "impact": "Low", diff --git a/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json b/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json index a91c08f6a..e1b04d998 100644 --- a/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json +++ b/tests/detectors/shadowing-local/shadowing_local_variable.sol.0.4.25.LocalShadowing.json @@ -207,6 +207,7 @@ ], "description": "FurtherExtendedContract.shadowingParent(uint256).x (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#17) (state variable)\n\t- ExtendedContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#9) (state variable)\n\t- BaseContract.x (tests/detectors/shadowing-local/shadowing_local_variable.sol#4) (state variable)\n", "markdown": "[FurtherExtendedContract.shadowingParent(uint256).x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L17) (state variable)\n\t- [ExtendedContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L9) (state variable)\n\t- [BaseContract.x](tests/detectors/shadowing-local/shadowing_local_variable.sol#L4) (state variable)\n", + "first_markdown_element": "tests/detectors/shadowing-local/shadowing_local_variable.sol#L25", "id": "0991435c12aa2d6f15e8da2a00a18e9c58ef65dcf31137cdb561655317353247", "check": "shadowing-local", "impact": "Low", @@ -327,6 +328,7 @@ ], "description": "FurtherExtendedContract.shadowingParent(uint256).y (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- BaseContract.y (tests/detectors/shadowing-local/shadowing_local_variable.sol#5) (state variable)\n", "markdown": "[FurtherExtendedContract.shadowingParent(uint256).y](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [BaseContract.y](tests/detectors/shadowing-local/shadowing_local_variable.sol#L5) (state variable)\n", + "first_markdown_element": "tests/detectors/shadowing-local/shadowing_local_variable.sol#L25", "id": "465bd81cbb09a3d2cc84ea6102fb059296f1970e85e2d86a171f8219f1a34508", "check": "shadowing-local", "impact": "Low", @@ -451,6 +453,7 @@ ], "description": "FurtherExtendedContract.shadowingParent(uint256).z (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContract.z() (tests/detectors/shadowing-local/shadowing_local_variable.sol#11) (function)\n", "markdown": "[FurtherExtendedContract.shadowingParent(uint256).z](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContract.z()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L11) (function)\n", + "first_markdown_element": "tests/detectors/shadowing-local/shadowing_local_variable.sol#L25", "id": "e3d2948e9c1252fe84e0d7e58f6682af7af84ef209f6e71f039faccabf07b0bd", "check": "shadowing-local", "impact": "Low", @@ -582,6 +585,7 @@ ], "description": "FurtherExtendedContract.shadowingParent(uint256).w (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- FurtherExtendedContract.w() (tests/detectors/shadowing-local/shadowing_local_variable.sol#20-23) (modifier)\n", "markdown": "[FurtherExtendedContract.shadowingParent(uint256).w](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [FurtherExtendedContract.w()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L20-L23) (modifier)\n", + "first_markdown_element": "tests/detectors/shadowing-local/shadowing_local_variable.sol#L25", "id": "a94a2b9331482c75582868e6d3cc5c9b01487e7505f219abcf36a20d76e0b089", "check": "shadowing-local", "impact": "Low", @@ -706,6 +710,7 @@ ], "description": "FurtherExtendedContract.shadowingParent(uint256).v (tests/detectors/shadowing-local/shadowing_local_variable.sol#25) shadows:\n\t- ExtendedContractv() (tests/detectors/shadowing-local/shadowing_local_variable.sol#13) (event)\n", "markdown": "[FurtherExtendedContract.shadowingParent(uint256).v](tests/detectors/shadowing-local/shadowing_local_variable.sol#L25) shadows:\n\t- [ExtendedContractv()](tests/detectors/shadowing-local/shadowing_local_variable.sol#L13) (event)\n", + "first_markdown_element": "tests/detectors/shadowing-local/shadowing_local_variable.sol#L25", "id": "973e31cc30dc7a3e1f089dfa5848234075f237f78fa492c772b1083e12c79054", "check": "shadowing-local", "impact": "Low", diff --git a/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json b/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json index 80bdc98c6..73d3d2600 100644 --- a/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json +++ b/tests/detectors/shadowing-state/shadowing_state_variable.sol.0.4.25.StateShadowing.json @@ -99,6 +99,7 @@ ], "description": "DerivedContract.owner (tests/detectors/shadowing-state/shadowing_state_variable.sol#12) shadows:\n\t- BaseContract.owner (tests/detectors/shadowing-state/shadowing_state_variable.sol#2)\n", "markdown": "[DerivedContract.owner](tests/detectors/shadowing-state/shadowing_state_variable.sol#L12) shadows:\n\t- [BaseContract.owner](tests/detectors/shadowing-state/shadowing_state_variable.sol#L2)\n", + "first_markdown_element": "tests/detectors/shadowing-state/shadowing_state_variable.sol#L12", "id": "9c5c3fc5091b9ecd6ec271fdbb3036d9d3426cdf9a09d6cc293fd7de9240e4ab", "check": "shadowing-state", "impact": "High", diff --git a/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json b/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json index fd534aa0b..241b07d92 100644 --- a/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json +++ b/tests/detectors/solc-version/old_solc.sol.0.4.21.IncorrectSolc.json @@ -30,6 +30,7 @@ ], "description": "Pragma version0.4.21 (tests/detectors/solc-version/old_solc.sol#1) allows old versions\n", "markdown": "Pragma version[0.4.21](tests/detectors/solc-version/old_solc.sol#L1) allows old versions\n", + "first_markdown_element": "tests/detectors/solc-version/old_solc.sol#L1", "id": "5ee25540b8c3544f4c954ad10f5f76ad54f790ee070d9d9c7d203df01a40d859", "check": "solc-version", "impact": "Informational", @@ -39,6 +40,7 @@ "elements": [], "description": "solc-0.4.21 is not recommended for deployment\n", "markdown": "solc-0.4.21 is not recommended for deployment\n", + "first_markdown_element": "", "id": "11c23ced8dbc94c44bd7809b5adfe4054fff8cd744f85723555d37f0b714b15f", "check": "solc-version", "impact": "Informational", diff --git a/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json b/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json index 0bb35a99e..82f830402 100644 --- a/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json +++ b/tests/detectors/solc-version/solc_version_incorrect.sol.0.4.25.IncorrectSolc.json @@ -31,6 +31,7 @@ ], "description": "Pragma version^0.4.23 (tests/detectors/solc-version/solc_version_incorrect.sol#2) allows old versions\n", "markdown": "Pragma version[^0.4.23](tests/detectors/solc-version/solc_version_incorrect.sol#L2) allows old versions\n", + "first_markdown_element": "tests/detectors/solc-version/solc_version_incorrect.sol#L2", "id": "9e8a7bb5987ce0fe4737630abd296ce35c96b7f0a7ad285234713e22354e5fa8", "check": "solc-version", "impact": "Informational", @@ -70,6 +71,7 @@ ], "description": "Pragma version>=0.4.0<0.6.0 (tests/detectors/solc-version/solc_version_incorrect.sol#3) allows old versions\n", "markdown": "Pragma version[>=0.4.0<0.6.0](tests/detectors/solc-version/solc_version_incorrect.sol#L3) allows old versions\n", + "first_markdown_element": "tests/detectors/solc-version/solc_version_incorrect.sol#L3", "id": "70f700a75d3fbd63be6d884dc523f5722dcc2289ad87207e9f69e0cbb218df6b", "check": "solc-version", "impact": "Informational", @@ -79,6 +81,7 @@ "elements": [], "description": "solc-0.4.25 is not recommended for deployment\n", "markdown": "solc-0.4.25 is not recommended for deployment\n", + "first_markdown_element": "", "id": "4d64003d70a62b1c6963f871e841b6cbd633d07d95554e1a50e0f25d9b71ebb3", "check": "solc-version", "impact": "Informational", diff --git a/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json b/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json index 68c11d0b9..980bfa06a 100644 --- a/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json +++ b/tests/detectors/solc-version/solc_version_incorrect_05.sol.0.5.7.IncorrectSolc.json @@ -31,6 +31,7 @@ ], "description": "Pragma version^0.5.5 (tests/detectors/solc-version/solc_version_incorrect_05.sol#2) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", "markdown": "Pragma version[^0.5.5](tests/detectors/solc-version/solc_version_incorrect_05.sol#L2) is known to contain severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)\n", + "first_markdown_element": "tests/detectors/solc-version/solc_version_incorrect_05.sol#L2", "id": "bdfe04d54ea5e3c3450dfcc88d663e870410def39c0eff26e9ca106855268e40", "check": "solc-version", "impact": "Informational", @@ -66,6 +67,7 @@ ], "description": "Pragma version0.5.7 (tests/detectors/solc-version/solc_version_incorrect_05.sol#3) allows old versions\n", "markdown": "Pragma version[0.5.7](tests/detectors/solc-version/solc_version_incorrect_05.sol#L3) allows old versions\n", + "first_markdown_element": "tests/detectors/solc-version/solc_version_incorrect_05.sol#L3", "id": "bf922f94b9333a8f10fca8ea8bed93e8ee8ed5b398b0e730a361f9bc42570a92", "check": "solc-version", "impact": "Informational", @@ -75,6 +77,7 @@ "elements": [], "description": "solc-0.5.7 is not recommended for deployment\n", "markdown": "solc-0.5.7 is not recommended for deployment\n", + "first_markdown_element": "", "id": "198d7f1df469662424720d03245311877e3b860e9b1ef666447ec8b3c03d557b", "check": "solc-version", "impact": "Informational", diff --git a/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json b/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json index d5a591b75..e40a128eb 100644 --- a/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json +++ b/tests/detectors/storage-array/storage_signed_integer_array.sol.0.5.8.StorageSignedIntegerArray.json @@ -64,19 +64,19 @@ }, { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 355, - "length": 132, + "start": 601, + "length": 170, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 10, - 11, - 12 + 15, + 16, + 17 ], "starting_column": 3, "ending_column": 4 @@ -142,42 +142,42 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(int128[3])" } }, { "type": "node", - "name": "intArray = (- 1,- 2,- 3)", + "name": "intArray = userArray", "source_mapping": { - "start": 384, - "length": 23, + "start": 746, + "length": 20, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 11 + 16 ], "starting_column": 5, - "ending_column": 28 + "ending_column": 25 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad0", + "name": "bad1", "source_mapping": { - "start": 355, - "length": 132, + "start": 601, + "length": 170, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 10, - 11, - 12 + 15, + 16, + 17 ], "starting_column": 3, "ending_column": 4 @@ -243,15 +243,16 @@ "ending_column": 2 } }, - "signature": "bad0()" + "signature": "bad1(int128[3])" } } } } ], - "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n", - "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n", - "id": "9301f6205d07f9bc40477e940ab7093092a8616caab1c78a2b84412ff6dd2eb1", + "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n", + "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n", + "first_markdown_element": "tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45", + "id": "e91a19803d53092184a9c091054f1ef371c8e5f9db15c5be6979bc4d06b70362", "check": "storage-array", "impact": "High", "confidence": "Medium" @@ -320,19 +321,19 @@ }, { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 601, - "length": 170, + "start": 355, + "length": 132, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 15, - 16, - 17 + 10, + 11, + 12 ], "starting_column": 3, "ending_column": 4 @@ -398,42 +399,42 @@ "ending_column": 2 } }, - "signature": "bad1(int128[3])" + "signature": "bad0()" } }, { "type": "node", - "name": "intArray = userArray", + "name": "intArray = (- 1,- 2,- 3)", "source_mapping": { - "start": 746, - "length": 20, + "start": 384, + "length": 23, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 16 + 11 ], "starting_column": 5, - "ending_column": 25 + "ending_column": 28 }, "type_specific_fields": { "parent": { "type": "function", - "name": "bad1", + "name": "bad0", "source_mapping": { - "start": 601, - "length": 170, + "start": 355, + "length": 132, "filename_used": "/GENERIC_PATH", "filename_relative": "tests/detectors/storage-array/storage_signed_integer_array.sol", "filename_absolute": "/GENERIC_PATH", "filename_short": "tests/detectors/storage-array/storage_signed_integer_array.sol", "is_dependency": false, "lines": [ - 15, - 16, - 17 + 10, + 11, + 12 ], "starting_column": 3, "ending_column": 4 @@ -499,15 +500,16 @@ "ending_column": 2 } }, - "signature": "bad1(int128[3])" + "signature": "bad0()" } } } } ], - "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad1(int128[3]) (tests/detectors/storage-array/storage_signed_integer_array.sol#15-17)\n\t\t- intArray = userArray (tests/detectors/storage-array/storage_signed_integer_array.sol#16) has a storage signed integer array assignment\n", - "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad1(int128[3])](tests/detectors/storage-array/storage_signed_integer_array.sol#L15-L17)\n\t\t- [intArray = userArray](tests/detectors/storage-array/storage_signed_integer_array.sol#L16) has a storage signed integer array assignment\n", - "id": "e91a19803d53092184a9c091054f1ef371c8e5f9db15c5be6979bc4d06b70362", + "description": "Contract A (tests/detectors/storage-array/storage_signed_integer_array.sol#3-45) \n\t- Function A.bad0() (tests/detectors/storage-array/storage_signed_integer_array.sol#10-12)\n\t\t- intArray = (- 1,- 2,- 3) (tests/detectors/storage-array/storage_signed_integer_array.sol#11) has a storage signed integer array assignment\n", + "markdown": "Contract [A](tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45) \n\t- Function [A.bad0()](tests/detectors/storage-array/storage_signed_integer_array.sol#L10-L12)\n\t\t- [intArray = (- 1,- 2,- 3)](tests/detectors/storage-array/storage_signed_integer_array.sol#L11) has a storage signed integer array assignment\n", + "first_markdown_element": "tests/detectors/storage-array/storage_signed_integer_array.sol#L3-L45", + "id": "9301f6205d07f9bc40477e940ab7093092a8616caab1c78a2b84412ff6dd2eb1", "check": "storage-array", "impact": "High", "confidence": "Medium" diff --git a/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json b/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json index 2086e0864..50b06187b 100644 --- a/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json +++ b/tests/detectors/timestamp/timestamp.sol.0.4.25.Timestamp.json @@ -145,6 +145,7 @@ ], "description": "Timestamp.bad0() (tests/detectors/timestamp/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/timestamp.sol#5)\n", "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/timestamp.sol#L5)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L4-L6", "id": "46e99f9c2bab1735f57c130340547f097ca1a8513c2dd374d3cd756da65d2cdf", "check": "timestamp", "impact": "Low", @@ -297,6 +298,7 @@ ], "description": "Timestamp.bad1() (tests/detectors/timestamp/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/timestamp.sol#10)\n", "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/timestamp.sol#L10)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L8-L11", "id": "b05a8b6947761eb595359596ba4ab88c750a4936836c8a5fed948fe92b2577f0", "check": "timestamp", "impact": "Low", @@ -447,6 +449,7 @@ ], "description": "Timestamp.bad2() (tests/detectors/timestamp/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/timestamp.sol#14)\n", "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/timestamp.sol#L14)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L13-L15", "id": "81e4ce4ef359ffa86d6c5dec7f465b84cc71668139ce31ee5c41ecd2fb327179", "check": "timestamp", "impact": "Low", diff --git a/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json b/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json index 2086e0864..50b06187b 100644 --- a/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json +++ b/tests/detectors/timestamp/timestamp.sol.0.5.1.Timestamp.json @@ -145,6 +145,7 @@ ], "description": "Timestamp.bad0() (tests/detectors/timestamp/timestamp.sol#4-6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(block.timestamp == 0) (tests/detectors/timestamp/timestamp.sol#5)\n", "markdown": "[Timestamp.bad0()](tests/detectors/timestamp/timestamp.sol#L4-L6) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(block.timestamp == 0)](tests/detectors/timestamp/timestamp.sol#L5)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L4-L6", "id": "46e99f9c2bab1735f57c130340547f097ca1a8513c2dd374d3cd756da65d2cdf", "check": "timestamp", "impact": "Low", @@ -297,6 +298,7 @@ ], "description": "Timestamp.bad1() (tests/detectors/timestamp/timestamp.sol#8-11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- require(bool)(time == 0) (tests/detectors/timestamp/timestamp.sol#10)\n", "markdown": "[Timestamp.bad1()](tests/detectors/timestamp/timestamp.sol#L8-L11) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [require(bool)(time == 0)](tests/detectors/timestamp/timestamp.sol#L10)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L8-L11", "id": "b05a8b6947761eb595359596ba4ab88c750a4936836c8a5fed948fe92b2577f0", "check": "timestamp", "impact": "Low", @@ -447,6 +449,7 @@ ], "description": "Timestamp.bad2() (tests/detectors/timestamp/timestamp.sol#13-15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- block.timestamp > 0 (tests/detectors/timestamp/timestamp.sol#14)\n", "markdown": "[Timestamp.bad2()](tests/detectors/timestamp/timestamp.sol#L13-L15) uses timestamp for comparisons\n\tDangerous comparisons:\n\t- [block.timestamp > 0](tests/detectors/timestamp/timestamp.sol#L14)\n", + "first_markdown_element": "tests/detectors/timestamp/timestamp.sol#L13-L15", "id": "81e4ce4ef359ffa86d6c5dec7f465b84cc71668139ce31ee5c41ecd2fb327179", "check": "timestamp", "impact": "Low", diff --git a/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json b/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json index 011afd607..6ded4b6eb 100644 --- a/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json +++ b/tests/detectors/too-many-digits/too_many_digits.sol.0.5.1.TooManyDigits.json @@ -189,6 +189,7 @@ ], "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x1 = 0x000001 (tests/detectors/too-many-digits/too_many_digits.sol#10)\n", "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x1 = 0x000001](tests/detectors/too-many-digits/too_many_digits.sol#L10)\n", + "first_markdown_element": "tests/detectors/too-many-digits/too_many_digits.sol#L9-L15", "id": "143f9fb2446f58c0fc141b8c4900a65f67afd5c4921b9fe0632d0b42993c632e", "check": "too-many-digits", "impact": "Informational", @@ -383,6 +384,7 @@ ], "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x2 = 0x0000000000001 (tests/detectors/too-many-digits/too_many_digits.sol#11)\n", "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x2 = 0x0000000000001](tests/detectors/too-many-digits/too_many_digits.sol#L11)\n", + "first_markdown_element": "tests/detectors/too-many-digits/too_many_digits.sol#L9-L15", "id": "7c264e2e13d1ba736400d6aba40570901b6b3209a66f8beb768fe56eb59c0501", "check": "too-many-digits", "impact": "Informational", @@ -577,6 +579,7 @@ ], "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x3 = 1000000000000000000 (tests/detectors/too-many-digits/too_many_digits.sol#12)\n", "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x3 = 1000000000000000000](tests/detectors/too-many-digits/too_many_digits.sol#L12)\n", + "first_markdown_element": "tests/detectors/too-many-digits/too_many_digits.sol#L9-L15", "id": "b2fbfafaa08d4f8e156369f0f00d386623e9d2af78356ed8f7f60c5274bb964d", "check": "too-many-digits", "impact": "Informational", @@ -771,6 +774,7 @@ ], "description": "C.f() (tests/detectors/too-many-digits/too_many_digits.sol#9-15) uses literals with too many digits:\n\t- x4 = 100000 (tests/detectors/too-many-digits/too_many_digits.sol#13)\n", "markdown": "[C.f()](tests/detectors/too-many-digits/too_many_digits.sol#L9-L15) uses literals with too many digits:\n\t- [x4 = 100000](tests/detectors/too-many-digits/too_many_digits.sol#L13)\n", + "first_markdown_element": "tests/detectors/too-many-digits/too_many_digits.sol#L9-L15", "id": "7194744ba0e788c1ded916dead1010c888619e3a7044c1aca5637c5a4b5d7e9e", "check": "too-many-digits", "impact": "Informational", @@ -961,6 +965,7 @@ ], "description": "C.h() (tests/detectors/too-many-digits/too_many_digits.sol#20-24) uses literals with too many digits:\n\t- x2 = 100000 (tests/detectors/too-many-digits/too_many_digits.sol#22)\n", "markdown": "[C.h()](tests/detectors/too-many-digits/too_many_digits.sol#L20-L24) uses literals with too many digits:\n\t- [x2 = 100000](tests/detectors/too-many-digits/too_many_digits.sol#L22)\n", + "first_markdown_element": "tests/detectors/too-many-digits/too_many_digits.sol#L20-L24", "id": "0c73f2851303eef65586504c4f6a9c78c6bb8aa48f44e775c6f5a8520227a757", "check": "too-many-digits", "impact": "Informational", diff --git a/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json b/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json index cebf24f41..69ffcf889 100644 --- a/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json +++ b/tests/detectors/tx-origin/tx_origin-0.5.1.sol.0.5.1.TxOrigin.json @@ -153,6 +153,7 @@ ], "description": "TxOrigin.bug0() (tests/detectors/tx-origin/tx_origin-0.5.1.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/tx_origin-0.5.1.sol#10)\n", "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L10)\n", + "first_markdown_element": "tests/detectors/tx-origin/tx_origin-0.5.1.sol#L9-L11", "id": "c69888e2e14c1a2f3eb49efce81b6561fd48ff4ca0dfe6b21db2ddd3e962b59f", "check": "tx-origin", "impact": "Medium", @@ -315,6 +316,7 @@ ], "description": "TxOrigin.bug2() (tests/detectors/tx-origin/tx_origin-0.5.1.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/tx_origin-0.5.1.sol#14)\n", "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/tx_origin-0.5.1.sol#L14)\n", + "first_markdown_element": "tests/detectors/tx-origin/tx_origin-0.5.1.sol#L13-L17", "id": "e54f32cd947c1bad4e54940df6613f466962e03d5a7b6f5c98ea8bc14b0518a6", "check": "tx-origin", "impact": "Medium", diff --git a/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json b/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json index 82e8278ec..5d9756aa7 100644 --- a/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json +++ b/tests/detectors/tx-origin/tx_origin.sol.0.4.25.TxOrigin.json @@ -153,6 +153,7 @@ ], "description": "TxOrigin.bug0() (tests/detectors/tx-origin/tx_origin.sol#9-11) uses tx.origin for authorization: require(bool)(tx.origin == owner) (tests/detectors/tx-origin/tx_origin.sol#10)\n", "markdown": "[TxOrigin.bug0()](tests/detectors/tx-origin/tx_origin.sol#L9-L11) uses tx.origin for authorization: [require(bool)(tx.origin == owner)](tests/detectors/tx-origin/tx_origin.sol#L10)\n", + "first_markdown_element": "tests/detectors/tx-origin/tx_origin.sol#L9-L11", "id": "15f4bed606e91476b860841a00a8e55b0badb541c03728c869daf4cad3b504a3", "check": "tx-origin", "impact": "Medium", @@ -315,6 +316,7 @@ ], "description": "TxOrigin.bug2() (tests/detectors/tx-origin/tx_origin.sol#13-17) uses tx.origin for authorization: tx.origin != owner (tests/detectors/tx-origin/tx_origin.sol#14)\n", "markdown": "[TxOrigin.bug2()](tests/detectors/tx-origin/tx_origin.sol#L13-L17) uses tx.origin for authorization: [tx.origin != owner](tests/detectors/tx-origin/tx_origin.sol#L14)\n", + "first_markdown_element": "tests/detectors/tx-origin/tx_origin.sol#L13-L17", "id": "e1cc314e4bb02ab50d7d084278ab9305addf818716e02d5e46fffbc341718a63", "check": "tx-origin", "impact": "Medium", diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json index b610e6934..65e8061b2 100644 --- a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json +++ b/tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol.0.5.1.UncheckedLowLevel.json @@ -127,6 +127,7 @@ ], "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#3)\n", "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#L3)\n", + "first_markdown_element": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel-0.5.1.sol#L2-L4", "id": "718dbfef93c02e3e663e9300449dc30b53bb9dc132882f1e63e2a84b2f7cdf2e", "check": "unchecked-lowlevel", "impact": "Medium", diff --git a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json b/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json index 873defd43..55609ef20 100644 --- a/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json +++ b/tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol.0.4.25.UncheckedLowLevel.json @@ -125,6 +125,7 @@ ], "description": "MyConc.bad(address) (tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#2-4) ignores return value by dst.call.value(msg.value)() (tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#3)\n", "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#L2-L4) ignores return value by [dst.call.value(msg.value)()](tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#L3)\n", + "first_markdown_element": "tests/detectors/unchecked-lowlevel/unchecked_lowlevel.sol#L2-L4", "id": "ce0c8a102a77c82a76e5ecbaf55d375a20069186c8235243fbc1ffbcf02ccf5b", "check": "unchecked-lowlevel", "impact": "Medium", diff --git a/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json b/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json index f5b7e2c4e..b82839740 100644 --- a/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json +++ b/tests/detectors/unchecked-send/unchecked_send-0.5.1.sol.0.5.1.UncheckedSend.json @@ -141,6 +141,7 @@ ], "description": "MyConc.bad(address) (tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#2-4) ignores return value by dst.send(msg.value) (tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#3)\n", "markdown": "[MyConc.bad(address)](tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#L2-L4) ignores return value by [dst.send(msg.value)](tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#L3)\n", + "first_markdown_element": "tests/detectors/unchecked-send/unchecked_send-0.5.1.sol#L2-L4", "id": "4617ab04affaca041c4a88c42658dca7d1d2dc11090973b8d551381c9e634a30", "check": "unchecked-send", "impact": "Medium", diff --git a/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json b/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json index 9de6e71b1..e5216babe 100644 --- a/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json +++ b/tests/detectors/unchecked-transfer/unused_return_transfers.sol.0.7.6.UncheckedTransfer.json @@ -211,6 +211,7 @@ ], "description": "C.bad0() (tests/detectors/unchecked-transfer/unused_return_transfers.sol#20-22) ignores return value by t.transfer(address(0),1000000000000000000) (tests/detectors/unchecked-transfer/unused_return_transfers.sol#21)\n", "markdown": "[C.bad0()](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L20-L22) ignores return value by [t.transfer(address(0),1000000000000000000)](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L21)\n", + "first_markdown_element": "tests/detectors/unchecked-transfer/unused_return_transfers.sol#L20-L22", "id": "c999626efabdf72014bbebbdecd64178176d168947ae803ebbbd873941a6ed7e", "check": "unchecked-transfer", "impact": "High", @@ -427,6 +428,7 @@ ], "description": "C.bad1() (tests/detectors/unchecked-transfer/unused_return_transfers.sol#40-42) ignores return value by t.transferFrom(address(this),address(0),1000000000000000000) (tests/detectors/unchecked-transfer/unused_return_transfers.sol#41)\n", "markdown": "[C.bad1()](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L40-L42) ignores return value by [t.transferFrom(address(this),address(0),1000000000000000000)](tests/detectors/unchecked-transfer/unused_return_transfers.sol#L41)\n", + "first_markdown_element": "tests/detectors/unchecked-transfer/unused_return_transfers.sol#L40-L42", "id": "d4c9ecd3753df951f9b2c890f54f981285d42500cd41e5dfc2f46f2feb1dbe6e", "check": "unchecked-transfer", "impact": "High", diff --git a/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json b/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json index d01ba77bf..78f006910 100644 --- a/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json +++ b/tests/detectors/unimplemented-functions/unimplemented.sol.0.4.25.UnimplementedFunctionDetection.json @@ -110,6 +110,7 @@ ], "description": "DerivedContract_bad0 (tests/detectors/unimplemented-functions/unimplemented.sol#10-14) does not implement functions:\n\t- BaseInterface.f2() (tests/detectors/unimplemented-functions/unimplemented.sol#3)\n\t- BaseInterface2.f3() (tests/detectors/unimplemented-functions/unimplemented.sol#7)\n", "markdown": "[DerivedContract_bad0](tests/detectors/unimplemented-functions/unimplemented.sol#L10-L14) does not implement functions:\n\t- [BaseInterface.f2()](tests/detectors/unimplemented-functions/unimplemented.sol#L3)\n\t- [BaseInterface2.f3()](tests/detectors/unimplemented-functions/unimplemented.sol#L7)\n", + "first_markdown_element": "tests/detectors/unimplemented-functions/unimplemented.sol#L10-L14", "id": "8614d351f7aac0c05e8df6ef7c89c6b46a2b8acf6295c9d5a886ff6489c74a41", "check": "unimplemented-functions", "impact": "Informational", @@ -187,6 +188,7 @@ ], "description": "AbstractContract_bad1 (tests/detectors/unimplemented-functions/unimplemented.sol#16-21) does not implement functions:\n\t- AbstractContract_bad1.f1() (tests/detectors/unimplemented-functions/unimplemented.sol#17)\n", "markdown": "[AbstractContract_bad1](tests/detectors/unimplemented-functions/unimplemented.sol#L16-L21) does not implement functions:\n\t- [AbstractContract_bad1.f1()](tests/detectors/unimplemented-functions/unimplemented.sol#L17)\n", + "first_markdown_element": "tests/detectors/unimplemented-functions/unimplemented.sol#L16-L21", "id": "adc202df4717efc4e19b549c0e623a79fac759a36bffb5d5e4aac401e33375d7", "check": "unimplemented-functions", "impact": "Informational", @@ -262,6 +264,7 @@ ], "description": "DerivedContract_bad2 (tests/detectors/unimplemented-functions/unimplemented.sol#27-33) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/unimplemented.sol#24)\n", "markdown": "[DerivedContract_bad2](tests/detectors/unimplemented-functions/unimplemented.sol#L27-L33) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/unimplemented.sol#L24)\n", + "first_markdown_element": "tests/detectors/unimplemented-functions/unimplemented.sol#L27-L33", "id": "31915d2f480e24ddd054de973440a02abdac0ccd6332c47cd4eb8d836d3fddda", "check": "unimplemented-functions", "impact": "Informational", @@ -337,6 +340,7 @@ ], "description": "DerivedContract_good (tests/detectors/unimplemented-functions/unimplemented.sol#35-41) does not implement functions:\n\t- BaseInterface3.get(uint256) (tests/detectors/unimplemented-functions/unimplemented.sol#24)\n", "markdown": "[DerivedContract_good](tests/detectors/unimplemented-functions/unimplemented.sol#L35-L41) does not implement functions:\n\t- [BaseInterface3.get(uint256)](tests/detectors/unimplemented-functions/unimplemented.sol#L24)\n", + "first_markdown_element": "tests/detectors/unimplemented-functions/unimplemented.sol#L35-L41", "id": "08d3e8a72b5da6d189acb46ecd36f00787a87812727526a0cae248a2bac348fc", "check": "unimplemented-functions", "impact": "Informational", diff --git a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json b/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json index fc2e75d93..b96939b16 100644 --- a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json +++ b/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json @@ -98,6 +98,7 @@ ], "description": "Contract bad0 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#3-9) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#7) is an unintialized function pointer call in a constructor\n", "markdown": "Contract [bad0](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L3-L9) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L7) is an unintialized function pointer call in a constructor\n", + "first_markdown_element": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L3-L9", "id": "6e9480c70e9d054243bb478398b26663f05444b4b9b858109d67f9c63dbbc3e2", "check": "uninitialized-fptr-cst", "impact": "Low", @@ -204,6 +205,7 @@ ], "description": "Contract bad1 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#11-18) \n\t b(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#16) is an unintialized function pointer call in a constructor\n", "markdown": "Contract [bad1](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L11-L18) \n\t [b(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L16) is an unintialized function pointer call in a constructor\n", + "first_markdown_element": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L11-L18", "id": "b0a15c051d9962762902c5565802334898e572e98018b42b85a89b45208c50d2", "check": "uninitialized-fptr-cst", "impact": "Low", @@ -316,6 +318,7 @@ ], "description": "Contract bad3 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#31-42) \n\t a(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#36) is an unintialized function pointer call in a constructor\n", "markdown": "Contract [bad3](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L31-L42) \n\t [a(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L36) is an unintialized function pointer call in a constructor\n", + "first_markdown_element": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L31-L42", "id": "1f12cc039e869f6f13be8a85e2d98a53212dc95e859908a9188dd6b152fb804f", "check": "uninitialized-fptr-cst", "impact": "Low", diff --git a/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json b/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json index 5d522a136..08a71a6e1 100644 --- a/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json +++ b/tests/detectors/uninitialized-local/uninitialized_local_variable.sol.0.4.25.UninitializedLocalVars.json @@ -76,6 +76,7 @@ ], "description": "Uninitialized.func().uint_not_init (tests/detectors/uninitialized-local/uninitialized_local_variable.sol#4) is a local variable never initialized\n", "markdown": "[Uninitialized.func().uint_not_init](tests/detectors/uninitialized-local/uninitialized_local_variable.sol#L4) is a local variable never initialized\n", + "first_markdown_element": "tests/detectors/uninitialized-local/uninitialized_local_variable.sol#L4", "id": "6ef627d0a3f7234c0d3dd339ae4cf3c1adf898f03384e08c3c8d846c67e0d476", "check": "uninitialized-local", "impact": "Medium", diff --git a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json index fba3e074f..056598fbb 100644 --- a/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json +++ b/tests/detectors/uninitialized-state/uninitialized-0.5.1.sol.0.5.1.UninitializedStateVarsDetection.json @@ -100,6 +100,7 @@ ], "description": "Uninitialized.destination (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#7-9)\n", "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L7-L9)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L5", "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", "check": "uninitialized-state", "impact": "High", @@ -216,6 +217,7 @@ ], "description": "Test.balances (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#23-26)\n", "markdown": "[Test.balances](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L23-L26)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L15", "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", "check": "uninitialized-state", "impact": "High", @@ -338,6 +340,7 @@ ], "description": "Test2.st (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#53-56)\n", "markdown": "[Test2.st](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L53-L56)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L45", "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", "check": "uninitialized-state", "impact": "High", @@ -459,6 +462,7 @@ ], "description": "Test2.v (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#49-51)\n", "markdown": "[Test2.v](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L49-L51)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized-0.5.1.sol#L47", "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", "check": "uninitialized-state", "impact": "High", diff --git a/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json b/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json index 26aa9ced9..b031bd5cc 100644 --- a/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json +++ b/tests/detectors/uninitialized-state/uninitialized.sol.0.4.25.UninitializedStateVarsDetection.json @@ -100,6 +100,7 @@ ], "description": "Uninitialized.destination (tests/detectors/uninitialized-state/uninitialized.sol#5) is never initialized. It is used in:\n\t- Uninitialized.transfer() (tests/detectors/uninitialized-state/uninitialized.sol#7-9)\n", "markdown": "[Uninitialized.destination](tests/detectors/uninitialized-state/uninitialized.sol#L5) is never initialized. It is used in:\n\t- [Uninitialized.transfer()](tests/detectors/uninitialized-state/uninitialized.sol#L7-L9)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized.sol#L5", "id": "e4711aebbd53922a9fe1e728917bf8e98eac065305e20d766b6b552debe79e44", "check": "uninitialized-state", "impact": "High", @@ -216,6 +217,7 @@ ], "description": "Test.balances (tests/detectors/uninitialized-state/uninitialized.sol#15) is never initialized. It is used in:\n\t- Test.use() (tests/detectors/uninitialized-state/uninitialized.sol#23-26)\n", "markdown": "[Test.balances](tests/detectors/uninitialized-state/uninitialized.sol#L15) is never initialized. It is used in:\n\t- [Test.use()](tests/detectors/uninitialized-state/uninitialized.sol#L23-L26)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized.sol#L15", "id": "a2750d175b02d51aeb47a4576f74725ba991d3c8cf828a33ee78ccc34cf9e7d7", "check": "uninitialized-state", "impact": "High", @@ -338,6 +340,7 @@ ], "description": "Test2.st (tests/detectors/uninitialized-state/uninitialized.sol#45) is never initialized. It is used in:\n\t- Test2.use() (tests/detectors/uninitialized-state/uninitialized.sol#53-56)\n", "markdown": "[Test2.st](tests/detectors/uninitialized-state/uninitialized.sol#L45) is never initialized. It is used in:\n\t- [Test2.use()](tests/detectors/uninitialized-state/uninitialized.sol#L53-L56)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized.sol#L45", "id": "427f100397f455d8000eff7b1d2463763ca8e452d5d98f7b7de693fd5e625a32", "check": "uninitialized-state", "impact": "High", @@ -459,6 +462,7 @@ ], "description": "Test2.v (tests/detectors/uninitialized-state/uninitialized.sol#47) is never initialized. It is used in:\n\t- Test2.init() (tests/detectors/uninitialized-state/uninitialized.sol#49-51)\n", "markdown": "[Test2.v](tests/detectors/uninitialized-state/uninitialized.sol#L47) is never initialized. It is used in:\n\t- [Test2.init()](tests/detectors/uninitialized-state/uninitialized.sol#L49-L51)\n", + "first_markdown_element": "tests/detectors/uninitialized-state/uninitialized.sol#L47", "id": "bf96eee949943a12926cf1407a2df2b07e99b30a6fc2e78aebf088cdefcf77a7", "check": "uninitialized-state", "impact": "High", diff --git a/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json b/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json index 8a54c307a..aa7c95353 100644 --- a/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json +++ b/tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol.0.4.25.UninitializedStorageVars.json @@ -82,6 +82,7 @@ ], "description": "Uninitialized.func().st_bug (tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol#10) is a storage variable never initialized\n", "markdown": "[Uninitialized.func().st_bug](tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol#L10) is a storage variable never initialized\n", + "first_markdown_element": "tests/detectors/uninitialized-storage/uninitialized_storage_pointer.sol#L10", "id": "b8f7c2470a8a7f83fd42dca40c50cbf2070e7fa5486c674585f2b0b39d3dc429", "check": "uninitialized-storage", "impact": "High", diff --git a/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json b/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json index 240a8343c..5ebaa7e5b 100644 --- a/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json +++ b/tests/detectors/unprotected-upgrade/Buggy.sol.0.6.12.UnprotectedUpgradeable.json @@ -143,6 +143,7 @@ ], "description": "Buggy (tests/detectors/unprotected-upgrade/Buggy.sol#3-15) is an upgradeable contract that does not protect its initiliaze functions: Buggy.initialize() (tests/detectors/unprotected-upgrade/Buggy.sol#6-9). Anyone can delete the contract with: Buggy.kill() (tests/detectors/unprotected-upgrade/Buggy.sol#10-13)", "markdown": "[Buggy](tests/detectors/unprotected-upgrade/Buggy.sol#L3-L15) is an upgradeable contract that does not protect its initiliaze functions: [Buggy.initialize()](tests/detectors/unprotected-upgrade/Buggy.sol#L6-L9). Anyone can delete the contract with: [Buggy.kill()](tests/detectors/unprotected-upgrade/Buggy.sol#L10-L13)", + "first_markdown_element": "tests/detectors/unprotected-upgrade/Buggy.sol#L3-L15", "id": "aceca400ce0b482809a70df612af22e24d154c5c89c24d630ec0ee5a366d09fe", "check": "unprotected-upgrade", "impact": "High", diff --git a/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json b/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json index c17b605ec..c36874db5 100644 --- a/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json +++ b/tests/detectors/unused-return/unused_return-sol7.sol.0.7.6.UnusedReturnValues.json @@ -241,6 +241,7 @@ ], "description": "C.bad0() (tests/detectors/unused-return/unused_return-sol7.sol#60-62) ignores return value by t.other() (tests/detectors/unused-return/unused_return-sol7.sol#61)\n", "markdown": "[C.bad0()](tests/detectors/unused-return/unused_return-sol7.sol#L60-L62) ignores return value by [t.other()](tests/detectors/unused-return/unused_return-sol7.sol#L61)\n", + "first_markdown_element": "tests/detectors/unused-return/unused_return-sol7.sol#L60-L62", "id": "f9924f5b012de6c1e91b68996bc7944585b0daab740b86c89cd157b0d22d0092", "check": "unused-return", "impact": "Medium", diff --git a/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json b/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json index f9b2f9b9b..3f03b7393 100644 --- a/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json +++ b/tests/detectors/unused-return/unused_return.sol.0.4.25.UnusedReturnValues.json @@ -161,6 +161,7 @@ ], "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/unused_return.sol#18)\n", "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/unused_return.sol#L18)\n", + "first_markdown_element": "tests/detectors/unused-return/unused_return.sol#L17-L29", "id": "000853c04bd511b08da14a492a5784575fb667c4c7432986706213e4f3215497", "check": "unused-return", "impact": "Medium", @@ -327,6 +328,7 @@ ], "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/unused_return.sol#22)\n", "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/unused_return.sol#L22)\n", + "first_markdown_element": "tests/detectors/unused-return/unused_return.sol#L17-L29", "id": "003cd4cef3010715d9b4605fb88240d6a24f8066ce65a9f26aa7e138cb7eb7a9", "check": "unused-return", "impact": "Medium", diff --git a/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json b/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json index f9b2f9b9b..3f03b7393 100644 --- a/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json +++ b/tests/detectors/unused-return/unused_return.sol.0.5.1.UnusedReturnValues.json @@ -161,6 +161,7 @@ ], "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by t.f() (tests/detectors/unused-return/unused_return.sol#18)\n", "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [t.f()](tests/detectors/unused-return/unused_return.sol#L18)\n", + "first_markdown_element": "tests/detectors/unused-return/unused_return.sol#L17-L29", "id": "000853c04bd511b08da14a492a5784575fb667c4c7432986706213e4f3215497", "check": "unused-return", "impact": "Medium", @@ -327,6 +328,7 @@ ], "description": "User.test(Target) (tests/detectors/unused-return/unused_return.sol#17-29) ignores return value by a.add(0) (tests/detectors/unused-return/unused_return.sol#22)\n", "markdown": "[User.test(Target)](tests/detectors/unused-return/unused_return.sol#L17-L29) ignores return value by [a.add(0)](tests/detectors/unused-return/unused_return.sol#L22)\n", + "first_markdown_element": "tests/detectors/unused-return/unused_return.sol#L17-L29", "id": "003cd4cef3010715d9b4605fb88240d6a24f8066ce65a9f26aa7e138cb7eb7a9", "check": "unused-return", "impact": "Medium", diff --git a/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json b/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json index ef39332a7..e4de22be9 100644 --- a/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json +++ b/tests/detectors/unused-state/unused_state.sol.0.4.25.UnusedStateVars.json @@ -72,6 +72,7 @@ ], "description": "A.unused (tests/detectors/unused-state/unused_state.sol#4) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused](tests/detectors/unused-state/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L4", "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", "check": "unused-state", "impact": "Informational", @@ -149,6 +150,7 @@ ], "description": "A.unused2 (tests/detectors/unused-state/unused_state.sol#5) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused2](tests/detectors/unused-state/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L5", "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", "check": "unused-state", "impact": "Informational", @@ -226,6 +228,7 @@ ], "description": "A.unused3 (tests/detectors/unused-state/unused_state.sol#6) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused3](tests/detectors/unused-state/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L6", "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", "check": "unused-state", "impact": "Informational", @@ -303,6 +306,7 @@ ], "description": "A.unused4 (tests/detectors/unused-state/unused_state.sol#7) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused4](tests/detectors/unused-state/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L7", "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", "check": "unused-state", "impact": "Informational", diff --git a/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json b/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json index ef39332a7..e4de22be9 100644 --- a/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json +++ b/tests/detectors/unused-state/unused_state.sol.0.5.1.UnusedStateVars.json @@ -72,6 +72,7 @@ ], "description": "A.unused (tests/detectors/unused-state/unused_state.sol#4) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused](tests/detectors/unused-state/unused_state.sol#L4) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L4", "id": "195279490862ae355bac3d27d0cdb1aa18200a5daed8f3dbd84dc5b120e29482", "check": "unused-state", "impact": "Informational", @@ -149,6 +150,7 @@ ], "description": "A.unused2 (tests/detectors/unused-state/unused_state.sol#5) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused2](tests/detectors/unused-state/unused_state.sol#L5) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L5", "id": "886250d01813743573f3d311b742e0f818e0012ccbf8ad97738c029fd129d870", "check": "unused-state", "impact": "Informational", @@ -226,6 +228,7 @@ ], "description": "A.unused3 (tests/detectors/unused-state/unused_state.sol#6) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused3](tests/detectors/unused-state/unused_state.sol#L6) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L6", "id": "e2ac51590509d97ff791ce50d9a711fc5ad01c20d23eacf6fb31939bd91b9f48", "check": "unused-state", "impact": "Informational", @@ -303,6 +306,7 @@ ], "description": "A.unused4 (tests/detectors/unused-state/unused_state.sol#7) is never used in B (tests/detectors/unused-state/unused_state.sol#11-16)\n", "markdown": "[A.unused4](tests/detectors/unused-state/unused_state.sol#L7) is never used in [B](tests/detectors/unused-state/unused_state.sol#L11-L16)\n", + "first_markdown_element": "tests/detectors/unused-state/unused_state.sol#L7", "id": "562d3e6a04f6f6068c3e4f0c074ecdbcff87929e43ec6fbeb6c088e715f63cf2", "check": "unused-state", "impact": "Informational", diff --git a/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json b/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json index 928febf8a..c37d3b34d 100644 --- a/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json +++ b/tests/detectors/variable-scope/predeclaration_usage_local.sol.0.4.25.PredeclarationUsageLocal.json @@ -261,6 +261,7 @@ ], "description": "Variable 'C.f(uint256).x (tests/detectors/variable-scope/predeclaration_usage_local.sol#5)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: y = x + 9 + z (tests/detectors/variable-scope/predeclaration_usage_local.sol#4)\n", "markdown": "Variable '[C.f(uint256).x](tests/detectors/variable-scope/predeclaration_usage_local.sol#L5)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [y = x + 9 + z](tests/detectors/variable-scope/predeclaration_usage_local.sol#L4)\n", + "first_markdown_element": "tests/detectors/variable-scope/predeclaration_usage_local.sol#L5", "id": "ae8657e5e605f868abb11f4568aa1cc99ccd0bd9ba4840bc7d5172e5fd6da165", "check": "variable-scope", "impact": "Low", @@ -527,6 +528,7 @@ ], "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i = 10 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i = 10](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", + "first_markdown_element": "tests/detectors/variable-scope/predeclaration_usage_local.sol#L8", "id": "16da9fedd4973449139402e4298178b35fd9fb1eb4d9dc85148790e742729ee4", "check": "variable-scope", "impact": "Low", @@ -793,6 +795,7 @@ ], "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i > 0 (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i > 0](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", + "first_markdown_element": "tests/detectors/variable-scope/predeclaration_usage_local.sol#L8", "id": "1645f4a9be79ab45d3fcb98b1b147212ee01517980a084481c9b26be36fb0d46", "check": "variable-scope", "impact": "Low", @@ -1059,6 +1062,7 @@ ], "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: x += i (tests/detectors/variable-scope/predeclaration_usage_local.sol#15)\n", "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [x += i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L15)\n", + "first_markdown_element": "tests/detectors/variable-scope/predeclaration_usage_local.sol#L8", "id": "1f58314c394d14558a0268c5241e448c32d6d74dcadc9a22dcd14b5a09fcbe0d", "check": "variable-scope", "impact": "Low", @@ -1325,6 +1329,7 @@ ], "description": "Variable 'C.f(uint256).i (tests/detectors/variable-scope/predeclaration_usage_local.sol#8)' in C.f(uint256) (tests/detectors/variable-scope/predeclaration_usage_local.sol#2-17) potentially used before declaration: i -- (tests/detectors/variable-scope/predeclaration_usage_local.sol#14)\n", "markdown": "Variable '[C.f(uint256).i](tests/detectors/variable-scope/predeclaration_usage_local.sol#L8)' in [C.f(uint256)](tests/detectors/variable-scope/predeclaration_usage_local.sol#L2-L17) potentially used before declaration: [i --](tests/detectors/variable-scope/predeclaration_usage_local.sol#L14)\n", + "first_markdown_element": "tests/detectors/variable-scope/predeclaration_usage_local.sol#L8", "id": "a9a523e5ffe2ef3e4ae3fe06e6b411b269e804e071b5e04cd68cd2f942156cbb", "check": "variable-scope", "impact": "Low", diff --git a/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json b/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json index 4280b9cf5..a18118103 100644 --- a/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json +++ b/tests/detectors/void-cst/void-cst.sol.0.5.1.VoidConstructor.json @@ -119,6 +119,7 @@ ], "description": "Void constructor called in D.constructor() (tests/detectors/void-cst/void-cst.sol#10-12):\n\t- C() (tests/detectors/void-cst/void-cst.sol#10)\n", "markdown": "Void constructor called in [D.constructor()](tests/detectors/void-cst/void-cst.sol#L10-L12):\n\t- [C()](tests/detectors/void-cst/void-cst.sol#L10)\n", + "first_markdown_element": "tests/detectors/void-cst/void-cst.sol#L10-L12", "id": "f3dacabc6aa95b22e6d535c4de48393d830fb3d4f0df012f649c851b4958209e", "check": "void-cst", "impact": "Low", diff --git a/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json b/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json index ab9be4e25..5eb9d6730 100644 --- a/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json +++ b/tests/detectors/weak-prng/bad_prng.sol.0.4.25.BadPRNG.json @@ -159,6 +159,7 @@ ], "description": "BadPRNG.bad0() (tests/detectors/weak-prng/bad_prng.sol#4-6) uses a weak PRNG: \"i = block.timestamp % 10 (tests/detectors/weak-prng/bad_prng.sol#5)\" \n", "markdown": "[BadPRNG.bad0()](tests/detectors/weak-prng/bad_prng.sol#L4-L6) uses a weak PRNG: \"[i = block.timestamp % 10](tests/detectors/weak-prng/bad_prng.sol#L5)\" \n", + "first_markdown_element": "tests/detectors/weak-prng/bad_prng.sol#L4-L6", "id": "af624d9c7f3f688c1bad5ecaee81085e0d5cde4e6a55de34ff93684527619748", "check": "weak-prng", "impact": "High", @@ -323,6 +324,7 @@ ], "description": "BadPRNG.bad1() (tests/detectors/weak-prng/bad_prng.sol#8-10) uses a weak PRNG: \"i = now % 10 (tests/detectors/weak-prng/bad_prng.sol#9)\" \n", "markdown": "[BadPRNG.bad1()](tests/detectors/weak-prng/bad_prng.sol#L8-L10) uses a weak PRNG: \"[i = now % 10](tests/detectors/weak-prng/bad_prng.sol#L9)\" \n", + "first_markdown_element": "tests/detectors/weak-prng/bad_prng.sol#L8-L10", "id": "fe07d1e4f27274570cfb85530c1cbf7fb7a9004f475b91d1a3762452b017e1b9", "check": "weak-prng", "impact": "High", @@ -487,6 +489,7 @@ ], "description": "BadPRNG.bad2() (tests/detectors/weak-prng/bad_prng.sol#12-14) uses a weak PRNG: \"i = uint256(blockhash(uint256)(10000)) % 10 (tests/detectors/weak-prng/bad_prng.sol#13)\" \n", "markdown": "[BadPRNG.bad2()](tests/detectors/weak-prng/bad_prng.sol#L12-L14) uses a weak PRNG: \"[i = uint256(blockhash(uint256)(10000)) % 10](tests/detectors/weak-prng/bad_prng.sol#L13)\" \n", + "first_markdown_element": "tests/detectors/weak-prng/bad_prng.sol#L12-L14", "id": "100d285386f797a469c6797fcce41350b1984f7e7aab1532580d9b69a774b6f5", "check": "weak-prng", "impact": "High", @@ -651,6 +654,7 @@ ], "description": "BadPRNG.bad3() (tests/detectors/weak-prng/bad_prng.sol#20-22) uses a weak PRNG: \"i = foo() % 10 (tests/detectors/weak-prng/bad_prng.sol#21)\" \n", "markdown": "[BadPRNG.bad3()](tests/detectors/weak-prng/bad_prng.sol#L20-L22) uses a weak PRNG: \"[i = foo() % 10](tests/detectors/weak-prng/bad_prng.sol#L21)\" \n", + "first_markdown_element": "tests/detectors/weak-prng/bad_prng.sol#L20-L22", "id": "a382f093e54d2c7beb2c10b3537790371f4b95545c48d1300fd25d20717d137a", "check": "weak-prng", "impact": "High", From a988d9c89ebf3f564b37d5df0c603af625bf1ef9 Mon Sep 17 00:00:00 2001 From: Josselin Date: Thu, 22 Apr 2021 14:18:41 +0200 Subject: [PATCH 13/13] Update tests --- ....UninitializedFunctionPtrsConstructor.json | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json b/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json index fc2e75d93..457df3f24 100644 --- a/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json +++ b/tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol.0.5.8.UninitializedFunctionPtrsConstructor.json @@ -209,6 +209,114 @@ "impact": "Low", "confidence": "High" }, + { + "elements": [ + { + "type": "contract", + "name": "bad2", + "source_mapping": { + "start": 483, + "length": 199, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + { + "type": "node", + "name": "s.a(10)", + "source_mapping": { + "start": 668, + "length": 7, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 27 + ], + "starting_column": 5, + "ending_column": 12 + }, + "type_specific_fields": { + "parent": { + "type": "function", + "name": "constructor", + "source_mapping": { + "start": 625, + "length": 55, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 25, + 26, + 27, + 28 + ], + "starting_column": 3, + "ending_column": 4 + }, + "type_specific_fields": { + "parent": { + "type": "contract", + "name": "bad2", + "source_mapping": { + "start": 483, + "length": 199, + "filename_used": "/GENERIC_PATH", + "filename_relative": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "filename_absolute": "/GENERIC_PATH", + "filename_short": "tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol", + "is_dependency": false, + "lines": [ + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29 + ], + "starting_column": 1, + "ending_column": 2 + } + }, + "signature": "constructor()" + } + } + } + } + ], + "description": "Contract bad2 (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#20-29) \n\t s.a(10) (tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#27) is an unintialized function pointer call in a constructor\n", + "markdown": "Contract [bad2](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L20-L29) \n\t [s.a(10)](tests/detectors/uninitialized-fptr-cst/uninitialized_function_ptr_constructor.sol#L27) is an unintialized function pointer call in a constructor\n", + "id": "1f43b676571aff0a3ce0353dc8548e252c588f7c9248c104637d500882880134", + "check": "uninitialized-fptr-cst", + "impact": "Low", + "confidence": "High" + }, { "elements": [ {