LevelOne.graduateAndUpgrade()
should check if sessionEnd
has passed. In the absence of this check, the contract can be upgraded early, breaking one of the contract invariants.
LevelOne.graduateAndUpgrade()
is an onlyPrincipal
function that is meant to be called at the end of a school session. The code and docs specify the length of one session to be 4 weeks. However, there is no time check in the function to ensure this behavior.
Relevant code:
The principal can end the session in less than the required 4 weeks, breaking a contract invariant.
LevelOneAndGraduateTeat.t.sol
already has a test that demonstrates this behavior. forge test --mt test_confirm_can_graduate -vvv
Expected Result:
Manual Review
Before executing the function, check if inSession
is true
and sessionEnd
has passed.
`graduateAndUpgrade()` can be called successfully even when the school session has not ended
`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.