`Snow::SnowEarned` and `Snow::FeeCollected` events are declared but never emitted
`Snow.sol` declares two events, `SnowEarned` and `FeeCollected`, that are intended to log farming activity and fee collection actions, but neither is ever emitted anywhere in the contract. `earnSnow` silently mints SNOW with no corresponding event, and `collectFee` silently sweeps accumulated WETH and ETH with no corresponding event. This breaks off-chain observability for two of the contract's core state change actions.
Neither event appears anywhere else in the file. Compare the two affected functions against `buySnow`, which correctly emits its corresponding event:
Likelihood:
High: this isn't conditional on any attacker action. It is the guaranteed behavior of the contract as deployed, occurring on every single call to either function.
Impact:
Off-chain infrastructure that depends on event logs like indexers, subgraphs, monitoring dashboards, analytics tooling, or any frontend polling for user activity/history, cannot observe or react to `earnSnow` or `collectFee` calls. This creates a transparency and monitoring gap: SNOW acquired via farming would be invisible to any system tracking SnowBought-style activity logs, and fee collection (a privileged, financially relevant action) would leave no on-chain audit trail beyond the underlying `Transfer` events emitted internally by the token transfers themselves, which lack the semantic context `FeeCollected` that would let observers easily distinguish this action from other transfers.
Place the following tests in the `TestSnow.sol` test suite:
Run the tests in the terminal:
If the test passes, the events were not triggered appropriately.
Add the missing emit statements to match the existing pattern already established by `buySnow`:
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.