Skip to content

Commit

Permalink
Detect suicidal external function (fix #527)
Browse files Browse the repository at this point in the history
  • Loading branch information
montyly committed Jul 12, 2020
1 parent 64ecdbe commit fa8deb6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slither/detectors/functions/suicidal.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def detect_suicidal_func(func):
if func.is_constructor:
return False

if func.visibility != 'public':
if func.visibility not in ['public', 'external']:
return False

calls = [c.name for c in func.internal_calls]
Expand All @@ -60,7 +60,7 @@ def detect_suicidal_func(func):

def detect_suicidal(self, contract):
ret = []
for f in [f for f in contract.functions if f.contract_declarer == contract]:
for f in contract.functions_declared:
if self.detect_suicidal_func(f):
ret.append(f)
return ret
Expand Down

0 comments on commit fa8deb6

Please sign in to comment.