Merge pull request #2493 from crytic/master

sync dev <> master
pull/2494/head
alpharush 5 months ago committed by GitHub
commit 84b15a6d86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 10
      .github/ISSUE_TEMPLATE/bug_report.yml
  2. 2
      slither/__main__.py
  3. 3
      slither/detectors/functions/dead_code.py

@ -3,9 +3,13 @@ body:
- -
attributes: attributes:
value: | 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, If you are having difficulty installing slither,
please head over to the "Discussions" page. please head over to the "Discussions" page.
Thanks for taking the time to fill out this bug report! Thanks for taking the time to fill out this bug report!
type: markdown type: markdown
- -
@ -17,7 +21,7 @@ body:
required: true required: true
- -
attributes: 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:" label: "Code example to reproduce the issue:"
placeholder: "`contract A {}`\n" placeholder: "`contract A {}`\n"
id: reproduce id: reproduce
@ -27,7 +31,7 @@ body:
- -
attributes: attributes:
description: | description: |
What version of slither are you running? What version of slither are you running?
Run `slither --version` Run `slither --version`
label: "Version:" label: "Version:"
id: version id: version

@ -239,6 +239,7 @@ def choose_detectors(
set(detectors_to_run), args.detectors_to_include, 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 return detectors_to_run
@ -255,7 +256,6 @@ def __include_detectors(
else: else:
raise ValueError(f"Error: {detector} is not a detector") 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 return detectors_to_run

@ -71,9 +71,10 @@ contract Contract{
continue continue
if isinstance(function, FunctionContract) and ( if isinstance(function, FunctionContract) and (
function.contract_declarer.is_from_dependency() function.contract_declarer.is_from_dependency()
or function.contract_declarer.is_library
): ):
continue 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: if not function.is_implemented:
continue continue
info: DETECTOR_INFO = [function, " is never used and should be removed\n"] info: DETECTOR_INFO = [function, " is never used and should be removed\n"]

Loading…
Cancel
Save