The SnowmanAirdrop contract enables users, defined in a Merkle tree with specific claim amounts, to receive Snowman NFTs by staking their Snow tokens. Claims can be authorized via EIP-712 signatures.
The claimSnowman function and its helper getMessageHash incorrectly use the user's live/current Snow token balance to determine the amount for both EIP-712 signature validation and for constructing the Merkle leaf during on-chain proof verification. This causes a mismatch if the user's live balance differs from the static amount defined for them in the Merkle tree, leading to valid claims failing.
Likelihood: Medium
Users' token balances are expected to change due to normal blockchain activities (earning, buying, transfers).
The claim mechanism's reliance on this live balance for critical verification data makes discrepancies with the Merkle tree's static entitlement highly probable.
Impact: Medium
Eligible users are unable to claim their airdropped NFTs if their live Snow balance deviates from their static Merkle tree entitlement, as Merkle proof verification will incorrectly fail.
The airdrop's intended distribution is impaired, diminishing its effectiveness and fairness, and resulting in a negative user experience.
1. Alice's Merkle tree entitlement: 1 Snow. Initial balance matches.
2. Alice's Snow balance increases to 2 (newLiveBalance) via snow.earnSnow().
3. Signature is generated for Alice based on newLiveBalance (2 Snow).
4. claimSnowman is called with Alice's original Merkle proof (for 1 Snow)
// and the signature (for 2 Snow).
5. Result: Signature check passes. Merkle leaf constructed with newLiveBalance (2 Snow).
// MerkleProof.verify fails as proof is for 1 Snow. Reverts SA__InvalidProof.
Add the following test to test/TestSnowmanAirdrop.t.sol :
Considering the issue where the user's live balance can cause discrepancies with their static Merkle tree entitlement, I suggest modifying the claim process to explicitly use the entitledAmount (the fixed amount from the Merkle tree data) as the basis for all verification steps and token operations. This involves passing the entitledAmount as a parameter to the claimSnowman function and using it consistently for EIP-712 signature generation, Merkle leaf construction, and the actual token transfer and minting amounts. This approach ensures that claim validity is tied directly to the immutable Merkle tree data, rather than a user's potentially volatile live balance.
Claims use snow balance of receiver to compute the merkle leaf, making proofs invalid if the user’s balance changes (e.g., via transfers). Attackers can manipulate balances or frontrun claims to match eligible amounts, disrupting the airdrop.
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.