earnSnow Mints 1 Wei Instead of 1 TokenThe Snow contract implements a farming mechanism where users can call earnSnow to receive 1 Snow token as a reward, subject to a 1-week cooldown.
The specific issue is that the function calls _mint(msg.sender, 1). Standard ERC20 tokens (like the OpenZeppelin implementation used here) operate with 18 decimals. Minting the raw integer 1 actually mints 1 wei of the token (0.000000000000000001 Snow). This makes the farmed reward microscopically small, completely breaking the economic intent of the farming function, as the gas spent to claim will always vastly exceed the value of the token received.
Likelihood:
The issue will occur on 100% of successful calls to the earnSnow function.
There are no special conditions or prerequisites; the code strictly executes _mint with the value 1.
Impact:
The farming reward is effectively zero. Users will waste gas calling the function without receiving a meaningful amount of tokens.
The intended token distribution mechanism (farming) is completely broken and will fail to incentivize users.
Multiply the mint amount by the PRECISION constant (which is already defined in the contract as 10 ** 18) to ensure 1 full token is minted.
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.