Snowman Merkle Airdrop

First Flight #42
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: low
Invalid

Unused events in `Snow` contract

Root + Impact

Description

Two events are declared in the Snow contract but are never emitted with any function.
This results in dead code and may indicate incomplete implementation or missing logging of important on-chain actions.
Events are critical for off-chain observability, enabling users, frontends, indexers and debuggers to track contract behavior.
Omitting event emissions can hinder transparency and make it harder to trace key operations such as earnings and fee collections.

The unused events are:

  • Snow::event SnowEarned(address indexed earner, uint256 indexed amount);

  • Snow::event FeeCollected();

Risk

Likelihood: Low
Impact: Low

While this issue does not pose on immediate threat to the security of the contract, it does reduce visibility into important user and system actions, which may lead to operational challenges or poor developer/integrator experience.

Proof of Concept

** SnowEarned not emitted in earnSnow: **

event SnowEarned(address indexed earner, uint256 indexed amount);
function earnSnow() external canFarmSnow {
if (s_earnTimer != 0 && block.timestamp < (s_earnTimer + 1 weeks)) {
revert S__Timer();
}
_mint(msg.sender, 1);
// Missing: emit SnowEarned(msg.sender, 1);
s_earnTimer = block.timestamp;
}

** FeeCollected not emitted in collectFee **

event FeeCollected();
function collectFee() external onlyCollector {
uint256 collection = i_weth.balanceOf(address(this));
i_weth.transfer(s_collector, collection);
// Missing: emit FeeCollected();
(bool collected,) = payable(s_collector).call{value: address(this).balance}("");
require(collected, "Fee collection failed!!!");
}

Recommended Mitigation

Emit the declared events at the appropriate points in their respective functions to provide transparency for off-chain consumers:

emit SnowEarned(msg.sender, 1);
emit FeeCollected();

If these events are no longer necessary, remove their declarations to reduce code bloat and maintain clarity.

Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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