In the LevelOne contract, the graduateAndUpgrade
function is designed to handle the graduation process and upgrade the contract to a new implementation. However, the function does not include a check to confirm that the current session has ended (block.timestamp >= sessionEnd) before proceeding. This allows the principal to initiate graduation and contract upgrades at any time, regardless of the session's status.
Missing Session Completion Verification
Issue: The function lacks a condition to verify that the session has concluded.
Implication: Graduation and contract upgrades can occur prematurely, potentially disrupting the intended academic cycle and leading to inconsistencies in student evaluations.
Without session completion checks, the principal could repeatedly call graduateAndUpgrade
, leading to multiple unauthorized upgrades and fund distributions.
2.This could result in the depletion of contract funds and undermine the integrity of the academic process.
Manual code review
Implement Session Completion Check: Add a condition to verify that the current time has surpassed the session end time before allowing graduation and upgrades.
Introduce a Graduation Status Flag: Maintain a boolean flag (e.g., hasGraduated) to track whether graduation has already occurred, preventing repeated executions.
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
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.