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