The graduateAndUpgrade function in the LevelOne contract lacks critical validation checks required by the project's invariants. It does not verify that students have received all required reviews, met the cutoff score, or that the session end time has been reached, allowing premature or invalid graduations that violate core system rules.
According to the project invariants specified in the README.md:
However, the graduateAndUpgrade function does not implement any of these required checks:
This omission allows the principal to initiate an upgrade at any time, even if:
Students haven't received all their required weekly reviews
Students below the cutoff score are incorrectly allowed to graduate
The session hasn't properly ended (before the 4-week period is complete)
These violations undermine the core academic integrity of the system and can result in inappropriate graduations and fund distribution.
The lack of validation has severe consequences for the system:
Students who haven't met the academic requirements could be improperly graduated
The school session could be prematurely ended without completing the required review process
Core project invariants are violated, breaking the contract's fundamental rules
The payment system might distribute funds before all required educational services are provided
This issue is rated High severity because it breaks the fundamental academic rules of the system and allows the principal to bypass critical contract invariants, potentially defrauding students.
Manual code review
Add all required validation checks to the graduateAndUpgrade function:
This implementation ensures that all required conditions are met before the system can be upgraded, maintaining the integrity of the educational system and compliance with the project's invariants.
All students are graduated when the graduation function is called as the cut-off criteria is not applied.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.