The claimFaucetTokens function uses an incorrect comparison operator (<= instead of <) when checking contract balance, preventing users from claiming tokens when the contract balance exactly equals the drip amount.
The expected behavior is to allow claims as long as the contract has enough tokens to fulfill the claim (balance >= faucetDrip).
The bug on line 174 uses <= which reverts when balance equals faucetDrip, even though the contract has sufficient tokens to complete the transfer. This means the last user cannot claim the final tokens, leaving them permanently locked in the contract.
Likelihood:
This occurs whenever the contract balance reaches exactly the faucetDrip amount (1000 tokens)
As the faucet is used over time, it will eventually reach this state where only 1000 tokens remain
Impact:
The last user who should be able to claim the final 1000 tokens will be unable to do so, wasting those tokens
Tokens become permanently locked in the contract with no way to recover them (owner cannot claim per requirements) if new tokens are not minted.
This test demonstrates how the incorrect comparison prevents the last valid claim even when sufficient tokens exist.
Change the comparison operator from <= to < to allow claims when balance equals the drip amount. The current check balanceOf(address(this)) <= faucetDrip is too restrictive. It should be balanceOf(address(this)) < faucetDrip because a balance equal to faucetDrip is sufficient to complete the transfer. The ERC20 _transfer function will handle the case where balance is insufficient.
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.