The LevelOne::graduateAndUpgrade
function in the LevelOne contract allows the principal to upgrade the implementation and distribute the bursary
fund among teachers and themselves.
However, it does not validate that the session has ended (sessionEnd
) before executing this action. This means the principal can call the function at any time, including before the session formally ends, violating the system's intended temporal logic.
This lack of validation breaks the contract's lifecycle integrity and may allow:
Artificially ending the school period earlier than expected.
Distributing funds before all students have been evaluated or graduated.
Manipulation of the system's lifecycle by the principal, causing an early session end without any temporal limitation.
Unfair or premature fund distribution before all students and teachers have completed their process.
Business logic violation: the graduate()
function in LevelTwo may depend on the condition that the session has ended and will not activate in the correct order.
The principal
starts the session, setting sessionEnd
to 4 weeks.
Time is advanced by 1 week (3 weeks remain before the course ends).
The principal
calls graduateAndUpgrade()
.
The test passes without issue.
Add a validation in LevelOne::graduateAndUpgrade
to ensure that sessionEnd
has passed.
`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.