The graduateAndUpgrade
function allows system upgrades before the session end time, violating the invariant that upgrades can only occur after the session has ended.
The contract's invariants state that "System upgrade cannot take place unless school's sessionEnd
has reached". However, the graduateAndUpgrade
function does not validate the current timestamp against sessionEnd
before proceeding with the upgrade.
Key code in LevelOne.sol
:
System can be upgraded prematurely
Violates the core timing invariant of the system
Could lead to students graduating before the full session duration
May result in unfair evaluation periods
Manual code review
Foundry for testing
Add timestamp validation in the graduateAndUpgrade
function:
`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.