The addTeacher() function in the LevelOne contract lacks a check to prevent the principal from being added as a teacher. This oversight enables a single individual to hold both principal and teacher roles simultaneously, creating a conflict of interest and potentially allowing them to receive compensation for both roles during fund distribution.
Double Compensation: During the graduateAndUpgrade() function execution, the principal would receive both their designated 5% wage AND an additional teacher's wage, which is an unfair distribution of funds.
Fund Depletion: The contract calculates payments as:
If the principal is both principal and teacher, they would receive:
Principal pay: (bursary * 5) / 100
Teacher pay: (bursary * 35) / 100 (divided by number of teachers)
This could lead to faster depletion of the bursary fund than intended by the contract design.
Manipulation of Educational System: As both principal and teacher, an individual could have unfair influence over student reviews, as teachers can give reviews that affect student scores.
Principal deploys the contract and initializes it with themselves as principal
Principal calls addTeacher(principalAddress) to add themselves as a teacher
When school session ends and graduateAndUpgrade() is called, the principal receives double payment
Add an explicit check in the addTeacher() function to prevent the principal from being added as a teacher:
This simple check ensures proper separation of roles and prevents potential exploitation of the compensation mechanism.
Principal can add themselves as teacher and share in teacher pay upon graduation
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.