The LevelOne::addTeacher is protected by the notYetInSession modifier, while the LevelOne::removeTeacher is not. This means that we can not add teachers when the school is in session but we can remove them. This can lead to a bricked contract if all teachers are removed from the contract.
Since teachers can be removed and not added this can lead to a situation where there are no teachers left in the contract, which would make it impossible to give reviews to students. The school session can only be ended when all students have received 4 reviews. This means that if all teachers are removed from the contract, it will be impossible to give reviews to students and the school session can not be ended. This would lead to a bricked contract.
The relevant code is located in the LevelOne contract:
Altough this would only be a problem if the principal would remove all teachers from the contract (by accident or on purpose) this is still a problem since there is no way to recover from this situation. This would lead to a bricked contract since the school session can not be ended and all students and coins would be stuck in the contract.
Manually reviewed the code.
It is recommended to add the notYetInSession modifier to the removeTeacher function to ensure that teachers cannot be removed while the school is in session. This will prevent the potential bricking of the contract by ensuring that at least one teacher remains in the contract during an active session.
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.