Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

restrict variable-scope detector to only solc 0.4.x #1731

Merged
merged 2 commits into from
Mar 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion slither/detectors/variables/predeclaration_usage_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from slither.core.declarations import Function
from slither.core.declarations.contract import Contract
from slither.core.variables.local_variable import LocalVariable
from slither.detectors.abstract_detector import AbstractDetector, DetectorClassification
from slither.detectors.abstract_detector import (
AbstractDetector,
DetectorClassification,
ALL_SOLC_VERSIONS_04,
)
from slither.utils.output import Output


Expand Down Expand Up @@ -54,6 +58,8 @@ class PredeclarationUsageLocal(AbstractDetector):

WIKI_RECOMMENDATION = "Move all variable declarations prior to any usage of the variable, and ensure that reaching a variable declaration does not depend on some conditional if it is used unconditionally."

VULNERABLE_SOLC_VERSIONS = ALL_SOLC_VERSIONS_04

def detect_predeclared_local_usage(
self,
node: Node,
Expand Down