The fee is scaled by PRECISION in the constructor and then multiplied by amount again at purchase, while _mint credits amount as raw wei. The payment and mint units disagree by 18 decimals: buying 1 base unit costs 5e18 WETH, and one whole token (1e18 wei) would cost 5e36 WETH. The buy path is economically unusable and buyers overpay by ~1e18.
With _buyFee = 5: s_buyFee = 5e18. buySnow(1) pulls 5e18 WETH and mints 1 wei of Snow.
Likelihood: High — every buyer hits this path; the existing test itself pays 5e18 for 1 wei.
Impact: High — the sale is mispriced by 18 orders of magnitude; buyers are massively overcharged and the token supply economy is broken.
Make the price and mint units consistent. Treat amount as whole tokens and scale the mint, with the fee as price per token:
Alternatively, if amount is meant to be base units, remove the * PRECISION scaling entirely. Either way, one convention must be used for both charge and mint.
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.