diff --git a/slither/core/variables/event_variable.py b/slither/core/variables/event_variable.py index a6ac7c0a3..293a3bdae 100644 --- a/slither/core/variables/event_variable.py +++ b/slither/core/variables/event_variable.py @@ -1,5 +1,16 @@ from .variable import Variable from slither.core.children.child_event import ChildEvent -class EventVariable(ChildEvent, Variable): pass +class EventVariable(ChildEvent, Variable): + def __init__(self): + super(EventVariable, self).__init__() + self._indexed = False + + @property + def indexed(self): + """ + Indicates whether the event variable is indexed in the bloom filter. + :return: Returns True if the variable is indexed in bloom filter, False otherwise. + """ + return self._indexed diff --git a/slither/solc_parsing/variables/event_variable.py b/slither/solc_parsing/variables/event_variable.py index 794f19fe1..8cf3aed9d 100644 --- a/slither/solc_parsing/variables/event_variable.py +++ b/slither/solc_parsing/variables/event_variable.py @@ -2,4 +2,18 @@ from .variable_declaration import VariableDeclarationSolc from slither.core.variables.event_variable import EventVariable -class EventVariableSolc(VariableDeclarationSolc, EventVariable): pass +class EventVariableSolc(VariableDeclarationSolc, EventVariable): + + def _analyze_variable_attributes(self, attributes): + """ + Analyze event variable attributes + :param attributes: The event variable attributes to parse. + :return: None + """ + + # Check for the indexed attribute + if 'indexed' in attributes: + self._indexed = attributes['indexed'] + + super(EventVariableSolc, self)._analyze_variable_attributes(attributes) +