33from argparse import ArgumentTypeError
44from collections import defaultdict
55from inspect import getsourcefile
6- from typing import Union , List , Dict , Callable
6+ from typing import Callable , Dict , List , Union
77
88import pytest
99from solc_select .solc_select import valid_version as solc_valid_version
1010
1111from slither import Slither
1212from slither .core .cfg .node import Node , NodeType
13- from slither .core .declarations import Function , Contract
13+ from slither .core .declarations import Contract , Function
1414from slither .core .solidity_types import ArrayType , ElementaryType
1515from slither .core .variables .local_variable import LocalVariable , VariableLocation
1616from slither .core .variables .state_variable import StateVariable
1717from slither .slithir .operations import (
18- OperationWithLValue ,
19- Phi ,
2018 Assignment ,
21- HighLevelCall ,
22- Return ,
23- Operation ,
2419 Binary ,
2520 BinaryType ,
26- InternalCall ,
21+ HighLevelCall ,
2722 Index ,
2823 InitArray ,
24+ InternalCall ,
2925 NewArray ,
26+ Operation ,
27+ OperationWithLValue ,
28+ Phi ,
29+ Return ,
3030)
3131from slither .slithir .utils .ssa import is_used_later
3232from slither .slithir .variables import (
3333 Constant ,
34- ReferenceVariable ,
3534 LocalIRVariable ,
35+ ReferenceVariable ,
3636 StateIRVariable ,
3737 TemporaryVariableSSA ,
3838)
@@ -120,7 +120,7 @@ def ssa_basic_properties(function: Function) -> None:
120120 if v and v .name :
121121 ssa_defs [v .name ] += 1
122122
123- for ( k , count ) in lvalue_assignments .items ():
123+ for k , count in lvalue_assignments .items ():
124124 assert ssa_defs [k ] >= count
125125
126126 # Helper 5/6
@@ -134,7 +134,7 @@ def check_property_5_and_6(
134134 assert var .is_storage == ssa_var .is_storage
135135 if ssa_var .is_storage :
136136 assert len (ssa_var .refers_to ) == 1
137- assert ssa_var .refers_to [0 ].location == VariableLocation .REFERENCE_TO_STORAGE
137+ assert ssa_var .refers_to [0 ].location == VariableLocation .REFERENCE_TO_STORAGE . value
138138
139139 # 5
140140 check_property_5_and_6 (function .parameters , function .parameters_ssa )
0 commit comments