diff --git a/slither/detectors/variables/possible_const_state_variables.py b/slither/detectors/variables/possible_const_state_variables.py index 1d18da5a8..c7b2e2ab1 100644 --- a/slither/detectors/variables/possible_const_state_variables.py +++ b/slither/detectors/variables/possible_const_state_variables.py @@ -37,10 +37,8 @@ class ConstCandidateStateVars(AbstractDetector): t = v.type if isinstance(t, ElementaryType): return True - if isinstance(t, UserDefinedType): - type_t = t.type - if isinstance(type_t, Contract): - return True + if isinstance(t, UserDefinedType) and isinstance(t.type, Contract): + return True return False