diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index df9dd7da2c..f1b3a4f4f2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -3,9 +3,13 @@ body: - attributes: value: | - Please check the issues tab to avoid duplicates. + Please check the issues tab to avoid duplicates, and + confirm that the bug exists on the latest release (upgrade + by running `python3 -m pip install --upgrade slither-analyzer`). + If you are having difficulty installing slither, please head over to the "Discussions" page. + Thanks for taking the time to fill out this bug report! type: markdown - @@ -17,7 +21,7 @@ body: required: true - attributes: - description: "It can be a github repo, etherscan link, or code snippet." + description: "It can be a github repo (preferred), etherscan link, or code snippet." label: "Code example to reproduce the issue:" placeholder: "`contract A {}`\n" id: reproduce @@ -27,7 +31,7 @@ body: - attributes: description: | - What version of slither are you running? + What version of slither are you running? Run `slither --version` label: "Version:" id: version diff --git a/slither/__main__.py b/slither/__main__.py index 886d392c0d..58d276e1d3 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -239,6 +239,7 @@ def choose_detectors( set(detectors_to_run), args.detectors_to_include, detectors ) + detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) return detectors_to_run @@ -255,7 +256,6 @@ def __include_detectors( else: raise ValueError(f"Error: {detector} is not a detector") - detectors_to_run = sorted(detectors_to_run, key=lambda x: x.IMPACT) return detectors_to_run diff --git a/slither/detectors/functions/dead_code.py b/slither/detectors/functions/dead_code.py index 98eb97ff7e..7a2c6dbc4d 100644 --- a/slither/detectors/functions/dead_code.py +++ b/slither/detectors/functions/dead_code.py @@ -71,9 +71,10 @@ def _detect(self) -> List[Output]: continue if isinstance(function, FunctionContract) and ( function.contract_declarer.is_from_dependency() + or function.contract_declarer.is_library ): continue - # Continue if the functon is not implemented because it means the contract is abstract + # Continue if the function is not implemented because it means the contract is abstract if not function.is_implemented: continue info: DETECTOR_INFO = [function, " is never used and should be removed\n"]