From b4c792a9e4dac1053b551aceac5e292493211863 Mon Sep 17 00:00:00 2001 From: Maximilian Krueger Date: Tue, 15 Dec 2020 11:09:59 -0600 Subject: [PATCH] type_parsing: parse enums that begin with `type(enum` --- slither/solc_parsing/solidity_types/type_parsing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slither/solc_parsing/solidity_types/type_parsing.py b/slither/solc_parsing/solidity_types/type_parsing.py index ca796b6a8..3838fb6ed 100644 --- a/slither/solc_parsing/solidity_types/type_parsing.py +++ b/slither/solc_parsing/solidity_types/type_parsing.py @@ -71,6 +71,8 @@ def _find_from_type_name( # pylint: disable=too-many-locals,too-many-branches,t enum_name = name if enum_name.startswith("enum "): enum_name = enum_name[len("enum ") :] + elif enum_name.startswith("type(enum"): + enum_name = enum_name[len("type(enum ") : -1] all_enums = [c.enums for c in contracts] all_enums = [item for sublist in all_enums for item in sublist] var_type = next((e for e in all_enums if e.name == enum_name), None)