diff --git a/slither/core/variables/state_variable.py b/slither/core/variables/state_variable.py index 86c21e30e..8fee502bb 100644 --- a/slither/core/variables/state_variable.py +++ b/slither/core/variables/state_variable.py @@ -3,6 +3,13 @@ from slither.core.children.child_contract import ChildContract class StateVariable(ChildContract, Variable): + def is_declared_by(self, contract): + """ + Check if the element is declared by the contract + :param contract: + :return: + """ + return self.contract == contract @property def canonical_name(self): diff --git a/slither/core/variables/variable.py b/slither/core/variables/variable.py index 2f54db6e2..8b37c6da1 100644 --- a/slither/core/variables/variable.py +++ b/slither/core/variables/variable.py @@ -78,13 +78,6 @@ class Variable(SourceMapping): assert isinstance(t, (Type, list)) or t is None self._type = t - def is_declared_by(self, contract): - """ - Check if the element is declared by the contract - :param contract: - :return: - """ - return self.contract == contract def __str__(self): return self._name