Snowman Merkle Airdrop

AI First Flight #10
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

[HIGH] ERC20 Decimal Mismatch Causes Severe Economic Imbalance

Root + Impact

Description

  • The contract sets buy fee as:

  • However, tokens are minted as:

s_buyFee = _buyFee * 1e18;
_mint(msg.sender, amount);

Since ERC20 defaults to 18 decimals, minting amount results in minting only amount wei of tokens.

Risk

Likelihood:

  • Users may overpay significantly and receive incorrect token amounts.

  • Example: If user buys 1 token, they receive 1 wei of Snow, not 1e18.

    However, they pay fee scaled to full token precision.

    This results in massive overpayment relative to received tokens.

Impact:

  • Users may overpay significantly and receive incorrect token amounts.

  • Token economics broken

Users pay 1 ETH for 1 wei token (depending on configuration)

  • Severe imbalance between cost and token supply

Proof of Concept

If:
_buyFee = 1
Then:
s_buyFee = 1e18
User buys:
buySnow(1)
They pay:
1e18 wei (1 ETH)
But receive:
1 wei of Snow

Recommended Mitigation

Scale mint amount Or override decimals to 0 if integer token is intended.

_mint(msg.sender, amount * 1e18);
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 3 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!