Hawk High

First Flight #39
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Valid

[L-1] Emitting event is missing in `LevelOne::graduateAndUpgrade`, which will not notify for the updated values.

Summary

After each change to the protocol, an event is emited that notifies users or other systems that are listening for these events. We do not emit the “Graduated” event and it will not notify about ongoing changes. Since this is an important thing and needs to be announced that the contract has a new implementation, this can mislead users.

Impact

Not make sure that users and systems related with the protocol are aware of the upgrade.

Tools Used

Manual Review

Recommendations

function graduateAndUpgrade(address _levelTwo, bytes memory) public onlyPrincipal {
if (_levelTwo == address(0)) {
revert HH__ZeroAddress();
}
uint256 totalTeachers = listOfTeachers.length;
uint256 payPerTeacher = (bursary * TEACHER_WAGE) / PRECISION;
uint256 principalPay = (bursary * PRINCIPAL_WAGE) / PRECISION;
_authorizeUpgrade(_levelTwo);
for (uint256 n = 0; n < totalTeachers; n++) {
usdc.safeTransfer(listOfTeachers[n], payPerTeacher);
}
usdc.safeTransfer(principal, principalPay);
+ emit Graduated(_levelTwo);
}
Updates

Lead Judging Commences

yeahchibyke Lead Judge 6 months ago
Submission Judgement Published
Validated
Assigned finding tags:

no event

Event not emitted

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.