There is no check to ensure that at least a minimum number of students are enrolled before the function startSession()
can be called, this can cause a malicious principal to call the function and waste 4 weeks.
If the Principal is malicious, they can call the startSession()
without any enrolled students and waste 4 weeks.
The protocol invariant is broken because the principal and teachers, if any, will not get paid as there is no bursary.
The test below passes and proves that without any students enrolled, startSession()
can be called by the principal.
Manual review.
Consider creating a local variable uint256 minimumEnrolledStudents = n
where n must be > 0 in the startSession()
function and then adding the check as shown below to ensure that there are a number of students enrolled before it is called;
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.