Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

No input range check for `cutOffScore` in `startSession`

Description: The cutOffScore in startSession function should be between 60 and 100, since it is a 4-week school session.
each student can only get score between 60 and 100, cutOffScore below 60 or above 100 will not make sense.

Impact: This could lead to a situation where the cutOffScore is set to a meaningless value

Recommended Mitigation: add a check that at least one teacher and one student should be present in the school before startSession

function startSession(uint256 _cutOffScore) public onlyPrincipal notYetInSession {
+ require(_cutOffScore > 60 && _cutOffScore <= 100, "Cut off score must be between 60 and 100");
...
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 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.