24
24
# pylint: disable=too-many-lines,too-many-instance-attributes,import-outside-toplevel,too-many-nested-blocks
25
25
if TYPE_CHECKING :
26
26
from slither .utils .type_helpers import LibraryCallType , HighLevelCallType , InternalCallType
27
- from slither .core .declarations import Enum , Event , Modifier , EnumContract , StructureContract
27
+ from slither .core .declarations import (
28
+ Enum ,
29
+ Event ,
30
+ Modifier ,
31
+ EnumContract ,
32
+ StructureContract ,
33
+ FunctionContract ,
34
+ )
28
35
from slither .slithir .variables .variable import SlithIRVariable
29
36
from slither .core .variables .variable import Variable
30
37
from slither .core .variables .state_variable import StateVariable
@@ -57,7 +64,7 @@ def __init__(self, compilation_unit: "SlitherCompilationUnit"):
57
64
self ._variables : Dict [str , "StateVariable" ] = {}
58
65
self ._variables_ordered : List ["StateVariable" ] = []
59
66
self ._modifiers : Dict [str , "Modifier" ] = {}
60
- self ._functions : Dict [str , "Function " ] = {}
67
+ self ._functions : Dict [str , "FunctionContract " ] = {}
61
68
self ._linearizedBaseContracts = List [int ]
62
69
63
70
# The only str is "*"
@@ -390,23 +397,23 @@ def functions_signatures_declared(self) -> List[str]:
390
397
return self ._signatures_declared
391
398
392
399
@property
393
- def functions (self ) -> List ["Function " ]:
400
+ def functions (self ) -> List ["FunctionContract " ]:
394
401
"""
395
402
list(Function): List of the functions
396
403
"""
397
404
return list (self ._functions .values ())
398
405
399
- def available_functions_as_dict (self ) -> Dict [str , "Function " ]:
406
+ def available_functions_as_dict (self ) -> Dict [str , "FunctionContract " ]:
400
407
if self ._available_functions_as_dict is None :
401
408
self ._available_functions_as_dict = {
402
409
f .full_name : f for f in self ._functions .values () if not f .is_shadowed
403
410
}
404
411
return self ._available_functions_as_dict
405
412
406
- def add_function (self , func : "Function " ):
413
+ def add_function (self , func : "FunctionContract " ):
407
414
self ._functions [func .canonical_name ] = func
408
415
409
- def set_functions (self , functions : Dict [str , "Function " ]):
416
+ def set_functions (self , functions : Dict [str , "FunctionContract " ]):
410
417
"""
411
418
Set the functions
412
419
@@ -416,21 +423,21 @@ def set_functions(self, functions: Dict[str, "Function"]):
416
423
self ._functions = functions
417
424
418
425
@property
419
- def functions_inherited (self ) -> List ["Function " ]:
426
+ def functions_inherited (self ) -> List ["FunctionContract " ]:
420
427
"""
421
428
list(Function): List of the inherited functions
422
429
"""
423
430
return [f for f in self .functions if f .contract_declarer != self ]
424
431
425
432
@property
426
- def functions_declared (self ) -> List ["Function " ]:
433
+ def functions_declared (self ) -> List ["FunctionContract " ]:
427
434
"""
428
435
list(Function): List of the functions defined within the contract (not inherited)
429
436
"""
430
437
return [f for f in self .functions if f .contract_declarer == self ]
431
438
432
439
@property
433
- def functions_entry_points (self ) -> List ["Function " ]:
440
+ def functions_entry_points (self ) -> List ["FunctionContract " ]:
434
441
"""
435
442
list(Functions): List of public and external functions
436
443
"""
0 commit comments