Snowman Merkle Airdrop

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

Lack of granularity in the Snow fee

Root + Impact

Description

  • The deployer of the system wants to configure a Fee for buying Snow token in WETH/ETH

  • The minimal unit allowed by the Snow contract is 1 ETH/WETH and it does not allow subfractions of that, meaning the fee has to be an integer number of ETH/WETH

constructor(address _weth, uint256 _buyFee, address _collector) ERC20("Snow", "S") Ownable(msg.sender) {
...
// @audit LOW Because of the multiplication, the buy fee is set to 18 decimals precision always, so only integer values of WETH/ETH
s_buyFee = _buyFee * PRECISION;

Risk

Likelihood:

  • It will always happen

Impact:

  • Medium because it could impact the pricing of the Snow token and it cannot be adjusted to values in between

Proof of Concept

The proof is in the code itself as the buyFeeis multiplied by the PRECISION

s_buyFee = _buyFee * PRECISION;

Recommended Mitigation

Instead of having PRECISION in the code, the buyFeeshould carry the value in wei

constructor(address _weth, uint256 _buyFee, address _collector) ERC20("Snow", "S") Ownable(msg.sender) {
...
// @audit LOW Because of the multiplication, the buy fee is set to 18 decimals precision always, so only integer values of WETH/ETH
s_buyFee = _buyFee;
Updates

Lead Judging Commences

yeahchibyke Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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