Snowman Merkle Airdrop

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

### [M-5] Absence of receive() and fallback() function to accept direct ETH transfers.

[M-5] Absence of receive() and fallback() function to accept direct ETH transfers.

Description

The snow contract involves ETH payment for buying snow tokens.However,there is no
receive() and fallback() function to handle direct ETH transfers.This means ,if user
accidentally sends ETH to snow contract ,the transaction will fail and ETH will get lost.

Impact:

1.Loss of User Funds.

2.Poor User Experience.

3.Operational in-effienciency.

Proof of Concept

1.User sends ETH directly to the contract address using a wallet (e.g., MetaMask) without
interacting with the buySnow function.
2.The transaction reverts because the contract does not have a receive or fallback function
to accept ETH.

Recommended Mitigation

1.We can add receive function with revert statement in it.

2.This will revert to users, if ETH is sent accidentally.

receive() external payable {
revert("Use the buySnow function to purchase tokens");
}
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.