Snowman Merkle Airdrop

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

`Snow::earnSnow` Does Not Emit an Event to Register the Action Off-Chain

Snow::earnSnow Does Not Emit an Event to Register the Action Off-Chain

Description

  • Normal behavior:
    When the earnSnow() function is called, the contract should mint 1 "Snow" token and emit an event to record the transaction off-chain. This will allow important details, such as the user's address and the amount of tokens earned, to be tracked, enabling proper transaction monitoring.

  • Issue:
    The earnSnow() function currently does not emit any event. This lack of event logging makes it difficult to track who has earned the "Snow" token and the amount earned. This is especially relevant if the contract needs to identify eligible addresses for an airdrop or to create a Merkle Tree for token distribution, as these addresses will not be reflected in the public logs. This can create difficulties in managing airdrops or any other mechanism that depends on off-chain transaction tracking.

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

Risk

Likelihood: Low

  • Reason 1
    The issue does not directly compromise protocol funds nor introduce an attack vector, but it has a relevant indirect effect: users who have obtained Snow exclusively through the earnSnow() function will not be visible off-chain, as this action is not recorded in any event.
    Therefore, in processes such as generating a Merkle Tree for an airdrop, these users may be unintentionally excluded, even if they have valid Snow balances.

Impact: Low

  • Impact 1
    Users who have accumulated Snow only through farming (earnSnow) may not be included in the Snowman airdrop, as off-chain tools will not be able to identify them as valid participants.
    This omission can lead to complaints, frustration, and dissatisfaction among these users, as they will be deprived of a legitimate reward. Moreover, it can damage trust in the protocol's transparency and reliability.

Recommended Mitigation

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

Lead Judging Commences

yeahchibyke Lead Judge 21 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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