The removeTeacher function in the LevelOne contract allows the principal to remove teachers at any time, even during an active school session. If all teachers are removed while a session is in progress, the contract will enter a dysfunctional state as students cannot receive required reviews, preventing them from graduating.
The removeTeacher function can be called by the principal at any time:
According to the project's invariants, students must receive reviews from teachers:
"Students must have gotten all reviews before system upgrade"
"System upgrade should not occur if any student has not gotten 4 reviews (one for each week)"
However, if the principal removes all teachers during an active session, there will be no way for students to receive these required reviews, effectively blocking the graduation and upgrade process. This could happen due to:
Malicious behavior by the principal
Accidental removal of all teachers
Governance disagreement leading to removal of teachers
This creates a situation where students have paid their school fees but cannot progress through the system as designed.
The impact of this issue is:
School sessions can become deadlocked with no path to completion
Students may not be able to receive required reviews
The system cannot be upgraded once stuck in this state
School fees paid by students are effectively locked
This is assessed as Low impact rather than Medium because:
It requires principal action (potentially malicious or severely negligent)
It does not directly lead to fund loss but rather operational issues
There are likely governance mechanisms outside the contract scope to resolve such situations
Manual code review
Add a safeguard to prevent removing the last teacher during an active session:
This ensures that at least one teacher remains available to give reviews during an active session, preventing the school system from entering a deadlocked state.
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.