Eggstravaganza

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

[L-1] Remaining game time is not displayed correctly

Summary

The getTimeRemaining() function incorrectly displays the remaining time.

Vulnerability Details

getTimeRemaining() source code:

function getTimeRemaining() external view returns (uint256) {
return block.timestamp >= endTime ? 0 : endTime - block.timestamp;
}

When block.timestamp==endTime is still allowed to play.

Impact

Some users may miss the chance to play due to incorrect display the remaining time.

Tools Used

Manual code review

Recommendations

Change block.timestamp >= endTime to block.timestamp > endTime in getTimeRemaining() function.

Updates

Lead Judging Commences

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.