Normal behavior expects that buySnow(amount) will allow a user to purchase a given amount of Snow tokens at the rate of 5 WETH/ETH per 1 full token (1e18 wei).
However, the cost calculation multiplies the raw amount parameter by s_buyFee. Since both s_buyFee (5 * 10^18) and amount (e.g., 10^18 for 1 token) are heavily scaled by 18 decimals, the resulting formula s_buyFee * amount generates an astronomical required payment instead of scaling correctly.
Likelihood:
This will occur every single time any user attempts to buy Snow tokens legitimately.
Impact:
The purchasing mechanism is fundamentally broken. To buy just 1 true Snow token (1e18 wei), a user would be required to pay 5e18 * 1e18 = 5e36 wei of ETH/WETH (5 quintillion ETH), which is mathematically impossible.
A user can currently only afford to buy dust amounts (a few wei of Snow for 5 full ETH each wei).
This Proof of Concept demonstrates the mathematical overcharge. If Alice wants to buy 1 full Snow token, amountToBuy must be set to 1 ether (1e18) to match the ERC20 decimal standard. But because the contract does not divide the fee by PRECISION, the calculated fee becomes 5,000,000,000,000,000,000 ETH. Given the astronomical fee, buying tokens is literally impossible.
Recommended Mitigation: Scale the fee cost calculation down by substituting the formula with (s_buyFee * amount) / PRECISION so the math checks out perfectly.
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.