Normal behavior: The earnSnow() function is intended to reward users with 1 SNOW token for participating in the farming mechanism, after a cooldown period. Since SNOW is an ERC20 token with 18 decimals, minting 1 full token should actually mint 1 * 10**18 wei units.
problem: The function mints 1 wei instead of 1 * 10**18 wei. This happens because the developer mistakenly used the literal 1 without multiplying by the PRECISION constant (which equals 10**18). As a result, users receive an insignificant amount—only one‑billionth of a billionth of a token—making the reward effectively worthless.
Likelihood:
The function is callable by any user once per week during the farming period (12 weeks after deployment).
Every user who calls earnSnow() will receive exactly 1 wei of SNOW tokens.
The condition block.timestamp < s_earnTimer + 1 weeks ensures it can be called at most once per week, but the amount minted is always the same negligible value.
Impact:
Users are misled into believing they earn a full token, while in reality they obtain a fraction so small that it has no economic value (less than 10⁻¹⁸ of a token).
The protocol’s intended incentive mechanism is broken, leading to loss of user trust and potential abandonment of the farming feature.
If the token is traded on a DEX, 1 wei is essentially worthless and cannot be used for any meaningful transaction (e.g., swapping, providing liquidity).
The following Foundry test demonstrates that after calling earnSnow(), the user’s balance is exactly 1 wei, and the number of full tokens (balance / 1e18) is zero.
Test output:
Replace the hardcoded 1 with 1 * PRECISION (or simply PRECISION if one full token is intended) to mint a meaningful amount.
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.