Expose "indexed" attribute on event parameters (used to indicate inclusion in bloom filter).

pull/149/head
David Pokora 6 years ago
parent affe95813f
commit c0323282d6
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 13
      slither/core/variables/event_variable.py
  2. 16
      slither/solc_parsing/variables/event_variable.py

@ -1,5 +1,16 @@
from .variable import Variable from .variable import Variable
from slither.core.children.child_event import ChildEvent 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

@ -2,4 +2,18 @@
from .variable_declaration import VariableDeclarationSolc from .variable_declaration import VariableDeclarationSolc
from slither.core.variables.event_variable import EventVariable 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)

Loading…
Cancel
Save