re-al-Foundation / rwa-contracts

Core dev environment for the RWA Governance contracts
0 stars 0 forks source link

[RHR-03S] Suboptimal Event Declarations #22

Closed chasebrownn closed 7 months ago

chasebrownn commented 7 months ago

RHR-03S: Suboptimal Event Declarations

Type Severity Location
Gas Optimization RoyaltyHandler.sol:L71, L82

Description:

The referenced event declarations do not have any indexed argument or have less than three indexed arguments that are a primitive type.

Example:

event DistributionUpdated(uint8 burnPortion, uint8 revSharePortion, uint8 lpPortion);

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 the indexed keyword to be introduced to up to three different primitive types in total optimizing the referenced event declarations.

chasebrownn commented 7 months ago

Acknowledged