Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

Incomplete Game End Handling

Summary

When endGame() is called, gameActive is set to false, but endTime remains unchanged.

Vulnerability Details

  • Even if the game is ended early, endTime might still indicate that the game is running.

  • Functions relying on endTime might produce incorrect results.

Impact

  • Users might get confused about the game state.

  • UI and external systems may not correctly detect game status.

Tools Used

  • Manual review.

Recommendations

  • Modify endGame() to update endTime:

    function endGame() external onlyOwner {
    require(gameActive, "Game not active");
    gameActive = false;
    endTime = block.timestamp; // Ensure consistency
    emit GameEnded(block.timestamp);
    }
Updates

Lead Judging Commences

m3dython Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Incomplete end game handling

Incorrect values reported when a game is ended early

Support

FAQs

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