diff --git a/slither/core/declarations/contract.py b/slither/core/declarations/contract.py index fd2cdd4684..9b1488db31 100644 --- a/slither/core/declarations/contract.py +++ b/slither/core/declarations/contract.py @@ -861,7 +861,7 @@ def get_state_variable_from_canonical_name( Returns: StateVariable """ - return next((v for v in self.state_variables if v.name == canonical_name), None) + return next((v for v in self.state_variables if v.canonical_name == canonical_name), None) def get_structure_from_name(self, structure_name: str) -> Optional["StructureContract"]: """