Snowman Merkle Airdrop

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

SNOW token does not override ERC20's `decimals()` method to return `PRECISION`

Root Cause

Snow.sol has defined a constant PRECISION value to indicate the token decimals. The PRECISION value is currently only used inside the constructor, where it scales the _buyFee argument.

The issue is currently categorized as low in severity, because coincidentally both PRECISION and the decimals() default getter are set to return 18. This issue would've been at a higher severity if both of these values were not equal.

Impact

If both values were not equal, this may had caused decimal mismatches / inconsistencies, mainly for displaying transaction amount.

Proof of Concept (PoC)

Let's assume that right now:

// Snow.sol: line 36
uint256 constant PRECISION = 10 ** 15;

If the contract deployer were to initialize with _buyFee = 5, then:

// Snow.sol: line 73
s_buyFee = 5 * (10 ** 15); // this is actually 0.005, not 5

Mitigation

The fix is to override decimals() by returning PRECISION.

// Snow.sol
function decimals() public view override returns (uint8) {
return PRECISION;
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge 3 days 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!