File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
slither/tools/upgradeability/checks Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
import logging
2
2
3
+ from slither .core .declarations import Function
3
4
from slither .slithir .operations import InternalCall
4
5
from slither .tools .upgradeability .checks .abstract_checks import (
5
6
AbstractCheck ,
@@ -14,8 +15,18 @@ class MultipleInitTarget(Exception):
14
15
pass
15
16
16
17
18
+ def _has_initiliaze_modifier (function : Function ):
19
+ if not function .modifiers :
20
+ return False
21
+ return any ((m .name == "initializer" ) for m in function .modifiers )
22
+
23
+
17
24
def _get_initialize_functions (contract ):
18
- return [f for f in contract .functions if f .name == "initialize" and f .is_implemented ]
25
+ return [
26
+ f
27
+ for f in contract .functions
28
+ if (f .name == "initialize" or _has_initiliaze_modifier (f )) and f .is_implemented
29
+ ]
19
30
20
31
21
32
def _get_all_internal_calls (function ):
You can’t perform that action at this time.
0 commit comments