Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Redundant code complexity from undeclared values

Description:

Both ThePredicter.sol and ScoreBoard.sol use undeclared values when making calculations which adds redundant complexity to the codebase. An example of this can be seen in ThePredicter.sol:93 where the if statement uses unreferenced integer 68400 when deciding whether prediction window is closed.

Instances in the codebase where this issue was noted:

Impact:

While there may not be any immediate impact, using any unreferenced values adds complexity to the overall codebase making it more prone to miscalculations and bugs which, as the codebase grows both in size and complexity, can aid in introducing logic flaws and other vulnerabilities.

Remediation:

It is recommended to create storage variables for any used values following recommended naming patterns to make the logic easy to understand.

+uint256 nineteenHours = 68400
+if (block.timestamp > START_TIME + matchNumber * nineteenHours - nineteenHours){
-if (block.timestamp > START_TIME + matchNumber * 68400 - 68400) {
revert ThePredicter__PredictionsAreClosed();
}
Updates

Lead Judging Commences

NightHawK Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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