Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

Missing Event Emission in collectFee()

Root + Impact

Description

The collectFee() function has a FeeCollected event declared but never emits it. This makes it difficult to track fee collections off-chain and breaks the expected event-driven architecture.

// src/Snow.sol:42
event FeeCollected(); // @> Declared but never emitted
// src/Snow.sol:101-107
function collectFee() external onlyCollector {
uint256 collection = i_weth.balanceOf(address(this));
i_weth.transfer(s_collector, collection);
(bool collected,) = payable(s_collector).call{value: address(this).balance}("");
require(collected, "Fee collection failed!!!");
// @> Missing: emit FeeCollected();
}

Risk

Likelihood:

  • Occurs every time fees are collected

  • Guaranteed missing event

Impact:

  • Cannot track fee collections off-chain

  • Breaks event monitoring systems

  • Incomplete audit trail

Proof of Concept

function testMissingEvent() public {
vm.prank(collector);
// Expect FeeCollected event
vm.expectEmit(true, true, true, true);
emit FeeCollected();
snow.collectFee();
// Test fails - event never emitted
}

Recommended Mitigation

- event FeeCollected();
+ event FeeCollected(uint256 wethAmount, uint256 ethAmount);
function collectFee() external onlyCollector {
uint256 wethCollection = i_weth.balanceOf(address(this));
+ uint256 ethCollection = address(this).balance;
+
- i_weth.transfer(s_collector, wethCollection);
+ if (wethCollection > 0) {
+ i_weth.transfer(s_collector, wethCollection);
+ }
- (bool collected,) = payable(s_collector).call{value: address(this).balance}("");
- require(collected, "Fee collection failed!!!");
+ if (ethCollection > 0) {
+ (bool collected,) = payable(s_collector).call{value: ethCollection}("");
+ require(collected, "Fee collection failed!!!");
+ }
+
+ emit FeeCollected(wethCollection, ethCollection);
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 4 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!