Last Man Standing

First Flight #45
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: medium
Invalid

Missing indexed Parameters in Events

Missing indexed Parameters in Events

Description

  • The following events in the Game contract omit indexed parameters on critical values that would benefit from being indexed. Indexing allows for efficient off-chain filtering of logs via event topics, which is especially useful for dApps, monitoring tools, and analytics dashboards.

  • The following parameters are not indexed but should be:

    • round in the GameEnded event

    • newRound in the GameReset event

    • newPlatformFeePercentage in the PlatformFeePercentageUpdated event

event GameEnded(
address indexed winner,
uint256 prizeAmount,
uint256 timestamp,
@> uint256 round
);
event GameReset(
@> uint256 newRound,
uint256 timestamp
);
event PlatformFeePercentageUpdated(
@> uint256 newPlatformFeePercentage
);

Risk

Likelihood:

  • These events are emitted frequently (on game round ends, resets, or config updates), and external consumers (frontends, analytics platforms, etc.) will routinely query them.

  • Without indexing, these platforms will need to scan full logs rather than use topics, which is computationally expensive and slow, especially as the contract gets older and logs accumulate.

Impact:

  • Degraded frontend performance or responsiveness when querying historical data for rounds or configuration changes.

  • Harder to implement scalable analytics or alerting systems.

Proof of Concept

event GameEnded(
address indexed winner,
uint256 prizeAmount,
uint256 timestamp,
uint256 round
);
event GameReset(
uint256 newRound,
uint256 timestamp
);
event PlatformFeePercentageUpdated(
uint256 newPlatformFeePercentage
);

Recommended Mitigation

event GameEnded(
address indexed winner,
uint256 prizeAmount,
uint256 timestamp,
- uint256 round
+ uint256 indexed round
);
event GameReset(
- uint256 newRound,
+ uint256 indexed newRound,
uint256 timestamp
);
event PlatformFeePercentageUpdated(
- uint256 newPlatformFeePercentage
+ uint256 indexed newPlatformFeePercentage
);
Updates

Appeal created

inallhonesty Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.