Skip to content

Commit

Permalink
do not recommend changing mutability for abstract contracts (#1952)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush authored Jun 9, 2023
1 parent d0f12dc commit c8d20ac
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions slither/detectors/variables/unchanged_state_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def constant_candidates(self) -> List[StateVariable]:
def detect(self) -> None:
"""Detect state variables that could be constant or immutable"""
for c in self.compilation_unit.contracts_derived:
if c.is_signature_only():
continue
variables = []
functions = []

Expand Down
4 changes: 2 additions & 2 deletions slither/detectors/variables/unused_state_variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@


def detect_unused(contract: Contract) -> Optional[List[StateVariable]]:
if contract.is_signature_only():
return None
# Get all the variables read in all the functions and modifiers

all_functions = [
Expand Down Expand Up @@ -73,6 +71,8 @@ def _detect(self) -> List[Output]:
"""Detect unused state variables"""
results = []
for c in self.compilation_unit.contracts_derived:
if c.is_signature_only():
continue
unusedVars = detect_unused(c)
if unusedVars:
for var in unusedVars:
Expand Down

0 comments on commit c8d20ac

Please sign in to comment.