mintFaucetTokens allows only the owner to mint faucet tokens to the faucet contract itself, but it reverts whenever the contract’s ERC20 balance is greater than 1000 tokens.
Because anyone can transfer ERC20 tokens directly to the faucet contract (i.e., “donate” tokens), an attacker can keep the faucet’s balance just above 1000e18 (e.g., 1000e18 + 1 wei) and permanently prevent the owner from minting more tokens to refill the faucet. This denies service to future claimers once the faucet runs low.
Likelihood:
Once the faucet’s balance dips near ~1000e18 (a realistic operational state), any user can send a tiny amount of tokens to keep it above the threshold.
The attacker can repeat this cheap “keep-alive” transfer indefinitely (no privileges required).
Impact:
Owner cannot mint more faucet tokens; new users can’t claim when the contract runs out.
Requires owner contract changes or emergency procedures to restore normal operations (example: burn tokens in order to mint again).
Paste this test function in your test file and run:
forge test -mt test_DoS_MintBlockedByTinyTransfer-vvvv
Track a claim pool that represents only the tokens the faucet is allowed to dispense, and track donations separately. Then base all logic on the claim pool instead of raw balanceOf.
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.