The graduateAndUpgrade
function in the LevelOne
smart contract is responsible for upgrading the contract and distributing the bursary to the principal and teachers. However, it lacks a critical time check to ensure the function is only called after the school session has ended. This missing condition violates the intended session flow logic and could lead to premature contract upgrades and fund distribution.
The function graduateAndUpgrade(address _levelTwo, bytes memory)
does not include a check for block.timestamp >= sessionEnd
, which is necessary to ensure the academic session has concluded before graduation and contract upgrade can occur.
Relevant code snippet:
Without the time constraint, the principal can arbitrarily call this function at any point, including immediately after starting a session.
`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.