Despite defining relevant events in the contract, the earnSnow()
function does not emit the SnowEarned
event and the collectFee()
function does not emit the FeeCollected
event, reducing transparency and breaking off-chain monitoring capabilities.
Events in Ethereum smart contracts serve as an important mechanism for off-chain services to track on-chain activities. The Snow contract defines several events, including SnowEarned
and FeeCollected
, but fails to emit these events when the corresponding actions occur:
The earnSnow()
function defines logic for users to earn Snow tokens but does not emit the SnowEarned
event after tokens are minted.
The collectFee()
function allows the collector to withdraw fees from the contract but does not emit the FeeCollected
event after fees are transferred.
This inconsistency between defined events and their emissions breaks the expected contract behavior and affects off-chain monitoring systems that might rely on these events for tracking purposes.
Impact: Low
Does not directly affect on-chain functionality or token security
Reduces transparency and traceability of contract activities
Disrupts off-chain monitoring and analytics systems
Inconsistent with contract's declared behavior
Likelihood: High
Occurs consistently with every function call
Affects all users of these functions
Present in the current implementation without any conditions
src/Snow.sol
Add the missing event emissions:
This change ensures that events are properly emitted, maintaining contract transparency and enabling effective off-chain monitoring.
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.