Merge pull request #1731 from crytic/restrict-variable-scope

restrict variable-scope detector to only solc 0.4.x
pull/1744/head
Feist Josselin 2 years ago committed by GitHub
commit 295d128478
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      slither/detectors/variables/predeclaration_usage_local.py

@ -7,7 +7,11 @@ from slither.core.cfg.node import Node
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
@ -54,6 +58,8 @@ Additionally, the for-loop uses the variable `max`, which is declared in a previ
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,

Loading…
Cancel
Save