Snowman Merkle Airdrop

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

SnowEarned not emitted

SnowEarned event not emitted, no event for third-party off-chain subscribers

Description

  • The snowmanEarned event is initialized but is not used within the code block

function earnSnow() external canFarmSnow {
if (s_earnTimer != 0 && block.timestamp < (s_earnTimer + 1 weeks)) {
revert S__Timer();
}
_mint(msg.sender, 1);
//@> emit SnowEarned(msg.sender, 1) is meant to be called here

Risk

Likelihood:

  • Is never called so it occurs every time

Impact:

  • Is a missing piece of code

Proof of Concept

No event is emitted when user earns

Recommended Mitigation

Include the missing code below

function earnSnow() external canFarmSnow {
if (s_earnTimer != 0 && block.timestamp < (s_earnTimer + 1 weeks)) {
revert S__Timer();
}
_mint(msg.sender, 1);
+ emit SnowEarned(msg.sender, 1);
Updates

Lead Judging Commences

yeahchibyke Lead Judge 5 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.