diff --git a/slither/solc_parsing/solidity_types/type_parsing.py b/slither/solc_parsing/solidity_types/type_parsing.py index 1a26612dd..2b5057dda 100644 --- a/slither/solc_parsing/solidity_types/type_parsing.py +++ b/slither/solc_parsing/solidity_types/type_parsing.py @@ -160,7 +160,10 @@ def parse_type(t, caller_context): elif t[key] == 'UserDefinedTypeName': if is_compact_ast: return _find_from_type_name(t['typeDescriptions']['typeString'], contract, contracts, structures, enums) - return _find_from_type_name(t['attributes'][key], contract, contracts, structures, enums) + + # Determine if we have a type node (otherwise we use the name node, as some older solc did not have 'type'). + type_name_key = 'type' if 'type' in t['attributes'] else key + return _find_from_type_name(t['attributes'][type_name_key], contract, contracts, structures, enums) elif t[key] == 'ArrayTypeName': length = None