Eggstravaganza

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

The Game Status Logic in `EggHuntGame::getGameStatus` could be simplified

Description: The EggHuntGame::getGameStatus function has redundant checks for block.timestamp and could be simplified. The Game not started yet status will never occur because gameActive and startTime are always set together.

Impact: The function is more complex than necessary

Recommended Mitigation: Simplify the logic to rely on gameActive and endTime.

function getGameStatus() external view returns (string memory) {
if (!gameActive) {
return "Game is not active";
} else if (block.timestamp > endTime) {
return "Game time elapsed";
} else {
return "Game is active";
}
}
Updates

Lead Judging Commences

m3dython Lead Judge 8 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.

Give us feedback!