Snowman Merkle Airdrop

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

H-2 Incorrect Fee Scaling Causes Exaggerated Charges Even with Valid Input

Root + Impact

Fee initialization logic unnecessarily scales a fee value that's already in correct precision units (e.g., wei), leading to massively inflated fees

Description

The contract accepts a _buyFee value as input during deployment:

constructor(address _weth, uint256 _buyFee, address _collector)
{ ...
s_buyFee = _buyFee * PRECISION; }

It is assumed that _buyFee is already provided in wei precision format, such as 0.03 ether for a 3% fee. However, multiplying it again by PRECISION (commonly 1e18) causes a second scaling, pushing the fee to unrealistic and dangerous levels.

Example:

  • Deployer passes _buyFee = 0.03 ether (i.e., 3 * 10^16)

  • Contract does: s_buyFee = 0.03 ether * 1e18 = 3 * 10^34


Risk

Likelihood:

  • Any deployment that uses correct wei precision gets punished with extreme fees.

Impact:

  • Fees could consume entire user balances.


Proof of Concept

// Deployer sets a 3% fee in wei
_buyFee = 0.03 ether; // 3 * 10^16
// Contract does:
s_buyFee = _buyFee * 1e18; // = 3 * 10^16 * 1e18 = 3 * 10^34

Recommended Mitigation

Remove the multiplication by PRECISION entirely:
+ s_buyFee = _buyFee; // Assuming _buyFee is already in 18-decimal format (wei)
Updates

Lead Judging Commences

yeahchibyke Lead Judge 15 days ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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