Missing require Check for Zero Balance in Snow::collectFee
The function collectFee()
transfers both:
All WETH tokens from the contract to s_collector
All native ETH balance to s_collector
However, there is no check to verify that the contract has a non-zero balance before making these transfers. As a result, the function may:
Trigger a transfer
of 0 WETH (wasting some gas, might revert on non-standard tokens)
Attempt a native call
with 0 ETH, which still costs gas
This is not dangerous, but can be seen as inefficient or unclear behavior.
Risk
Likelihood:
Medium — the function can be called at any time by the collector
Easy to accidentally call when no fees exist
Impact:
Minor gas waste when balances are zero
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.