Medium
The principal can add themselves as a teacher and receive both the 5% principal wages AND a share of the 35% teacher wages, violating the intended payment structure and reducing the amount that legitimate teachers receive.
In the LevelOne.sol
contract, the principal can call the addTeacher()
function to add any address as a teacher, including their own address. While there are checks preventing zero addresses, existing teachers, and students from being added as teachers, there is no check preventing the principal from adding themselves.
When the graduateAndUpgrade()
function is called at the end of the session, the payment distribution works as follows:
Each teacher receives an equal share of 35% of the bursary
The principal receives 5% of the bursary
If the principal adds themselves as a teacher, they would receive:
5% of the bursary as the principal
An equal share of 35% of the bursary as a teacher
This violates the intended payment structure specified in the documentation and reduces the wages legitimate teachers would receive.
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.