The enable function emits event regardless of whether the state of contract changes.
The issue here is that this event is emitted regardless of whether the state actually changed. It means that even if the enable
parameter matches the current state of self.enabled
, the function will still emit a BridgeEnabled
event. This is because there is no check if the contract is enabled or not.
It could lead to misleading event logs where it appears the bridge status has changed when it actually hasn't.
The function will unnecessarily consume gas to emit an event for a non-change.
Manual review
Emit the event if the state actually changes. Here's a corrected version:
Please, do not suppose impacts, think about the real impact of the bug and check the CodeHawks documentation to confirm: https://docs.codehawks.com/hawks-auditors/how-to-determine-a-finding-validity A PoC always helps to understand the real impact possible.
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.