Skip to content

Commit 9afcabd

Browse files
authored
Merge pull request #175 from pessimistic-io/unprotected-initialize-fix
added additional modifiers to pess-unprotected-initializer
2 parents 91351fa + e82b4b1 commit 9afcabd

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

slitherin/detectors/unprotected_initialize.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ def _is_initialize(self, fun: Function) -> bool:
3030
def _has_modifiers(self, fun: Function) -> bool:
3131
"""Checks if function has modifier protection"""
3232
for modifier in fun.modifiers:
33-
if str(modifier) == "onlyOwner" or str(modifier) == "initializer":
33+
if str(modifier).startswith("only") or str(modifier) in [
34+
"initializer",
35+
"onlyInitializing",
36+
"reinitializer",
37+
]:
3438
return True
3539
return False
3640

@@ -43,7 +47,7 @@ def _has_require(self, fun: Function) -> bool:
4347
if str(variable.type) == "address":
4448
return True
4549
return False
46-
50+
4751
def _has_if_with_reverts(self, fun: Function) -> bool:
4852
for node in fun.nodes:
4953
if node.contains_if():

0 commit comments

Comments
 (0)