When a student is expelled via the expel function, their entries in reviewCount and lastReviewTime mappings are not cleared or reset. While isStudent is set to false and they are removed from listOfStudents, their historical review data persists. If other parts of the system (e.g., a faulty graduation check or off-chain processing) were to incorrectly access this data for an expelled student, it could lead to unexpected behavior.
The expel function performs:
If a student is expelled, they should not be considered for graduation. The primary guard is isStudent[_student] == false and removal from listOfStudents. However, their reviewCount (e.g., might be 3 if expelled in week 3) remains.
Stale Data Persistence: The review data for expelled students remains in storage.
Minor Risk of Misinterpretation (Edge Case): If, due to a separate bug or flawed logic, the system attempts to evaluate an expelled student for graduation (e.g., by iterating an old list of students or if isStudent check is missed elsewhere), their existing reviewCount could be incorrectly used. For example, if H-04's check for reviewCount == 4 were applied to an expelled student who happened to have 4 reviews before expulsion, it might lead to confusion if the isStudent flag wasn't the primary gate.
This is primarily a data hygiene and defense-in-depth issue. The system should rely on isStudent and the current listOfStudents, but not clearing other associated data is less clean.
Manual Review, Logical Analysis.
Consider clearing the reviewCount and lastReviewTime for an expelled student within the expel function. This ensures that all data related to their active student status is reset, improving data hygiene and reducing the surface for potential misinterpretations by other system components or off-chain tools.
Code Modification for LevelOne.sol::expel:
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.