Smart contracts that acquire Snow tokens may be unable to claim Snowman NFTs if they do not implement the onERC721Received() function. This can cause Snow tokens to become trapped on such contracts, leading to potential loss of funds or denial of claim.
Currently, anyone — including smart contracts — can call buySnow() and earnSnow() to acquire Snow tokens.
However, during claimSnowman(), the contract mints Snowman NFTs directly to the receiver address via:
i_snowman.mintSnowman(receiver, amount);
If receiver is a smart contract without an ERC721Receiver implementation, the mint operation will revert. This leaves the contract holding Snow tokens it cannot redeem for NFTs, and is unable to recover the SNOW tokens either.
Put the BadReceiver contract in the test folder. And add testCannotClaim in the TestSnowmanAirdrop.
Here we are not even using the airdrop claim function we are just minting right away because mint function in Snowman contact is accessible to all so why not, dont even need a merkle tree proof for this POC. It demonstates that yes indeed a smart contract can buy and earn snow tokens and then be unable to do anything with them if they dont have onERC721Received function implemented.
Inability to claim Snowman NFTs by non-ERC721-compatible contracts.
HIGH
HIGH
Manual review
Restrict buySnow() and/or claimSnowman() to EOAs using:
if (msg.sender != tx.origin) revert OnlyEOA();
Alternatively, add interface checks to ensure receivers can handle ERC721 tokens before allowing claims.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.