Root: The buySnow
function mints tokens via _mint
without verifying sufficient WETH balance before safeTransferFrom
, relying on ERC20 revert;
Impact: Attackers can mint tokens for free or underpay, undermining the contract’s economic model.
The buySnow function intends to charge s_buyFee * amount
WETH per mint but proceeds with _mint
after safeTransferFrom
without ensuring the sender’s balance covers the fee.
This allows minting with insufficient funds if safeTransferFrom
doesn’t revert, as demonstrated by a test minting 1 token with only half the required WETH.
Likelihood:
When an attacker calls buySnow
with insufficient WETH but a set allowance.
During any transaction exploiting a lenient MockWETH or manipulated ERC20.
Impact:
Enables free or underpaid token minting, depleting contract revenue.
Risks exhausting the total supply if unchecked.
Unfunded Mint Test: A user mints 1 token with half the required WETH, confirming the flaw.
You may copy paste this into the snow test suite:
Result: Jerry's tokens after unfunded mint: 1, Jerry's full Weth balance: 2.5e14, proving 1 token minted without full payment.
Add a balance check before minting to prevent underfunded transactions.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.