File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1010)
1111from slither .core .solidity_types .type import Type
1212from slither .core .variables .variable import Variable
13+ from slither .core .expressions .literal import Literal
14+ from slither .core .expressions .identifier import Identifier
1315
1416
1517def _convert_type_for_solidity_signature_to_string (
@@ -27,7 +29,14 @@ def _convert_type_for_solidity_signature_to_string(
2729 underlying_type_str = _convert_type_for_solidity_signature_to_string (
2830 underlying_type , seen
2931 )
30- return underlying_type_str + "[]"
32+
33+ if types .length is None :
34+ return underlying_type_str + "[]"
35+ if isinstance (types .length , Literal ):
36+ return underlying_type_str + f"[{ types .length } ]"
37+ # At this point it must be an Identifier and constant either a TopLevelVariable or a StateVariable
38+ assert isinstance (types .length , Identifier ) and types .length .value .is_constant
39+ return underlying_type_str + f"[{ types .length .value .expression } ]"
3140
3241 return str (types )
3342
You can’t perform that action at this time.
0 commit comments