Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

No Logic for Students to Graduate

Summary
The graduateAndUpgrade function does not include any logic to graduate students, making it impossible for students to progress to the next level

Vulnerability Details
Root Cause: The graduateAndUpgrade function focuses on upgrading the contract and paying teachers and the principal but does not handle student graduation

function

graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {

...

}

Initial State: Students are enrolled and have completed the session.

Step 1: The principal calls graduateAndUpgrade.

Outcome: The contract upgrades, but no students are marked as graduated.

Implications: Students cannot progress to the next level, defeating the purpose of the school system.

Impact
Who is affected: Students.

How they are affected: Students cannot graduate or move to the next level.

Tools Used
manuel review

Recommendations
Add logic to mark students as graduated:

function graduate(address _student) public onlyPrincipal {

require(studentScore[_student] >= cutOffScore, "Score below cutoff");

isStudent[_student] = false;

emit Graduated(_student);

}

Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

cut-off criteria not applied

All students are graduated when the graduation function is called as the cut-off criteria is not applied.

Support

FAQs

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