Apart from aiding off-chain integrators in consuming and filtering such events, primitive types that are set as indexedwill result in a gas optimization due to reduced memory costs. As such, we advise the indexed keyword to be introduced to up to three different primitive types in total optimizing the referenced event declarations.
RHR-03S: Suboptimal Event Declarations
Description:
The referenced
event
declarations do not have anyindexed
argument or have less than threeindexed
arguments that are a primitive type.Example:
Recommendation:
Apart from aiding off-chain integrators in consuming and filtering such events, primitive types that are set as
indexed
will result in a gas optimization due to reduced memory costs. As such, we advise theindexed
keyword to be introduced to up to three different primitive types in total optimizing the referencedevent
declarations.