Eggstravaganza

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

Don't need to check `block.timestamp >= startTime` in the `EggHuntGame::searchForEgg()` function.

Description: In the EggHuntGame::searchForEgg() function, the code already checks that gameActive is true. The gameActive variable is set to true in the EggHuntGame::startGame(uint256) function, where startTime is also set to block.timestamp. This means that when gameActive is true, startTime is always less than or equal to block.timestamp.

Recommended Mitigation: Remove un-used code:

function searchForEgg() external {
require(gameActive, "Game not active");
- require(block.timestamp >= startTime, "Game not started yet");
require(block.timestamp <= endTime, "Game ended");
...
}
Updates

Lead Judging Commences

m3dython Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Appeal created

luongtrongdai Submitter
3 months ago
m3dython Lead Judge
3 months ago
m3dython Lead Judge 3 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.