The burnFaucetTokens() function is designed to allow the owner to burn a specified amount of faucet tokens when needed, helping manage the token supply by permanently removing tokens from circulation.
The function transfers the ENTIRE contract balance to the owner on line 132, but only burns the amountToBurn parameter on line 134, allowing the owner to effectively steal all faucet tokens while appearing to burn only a small amount.
Likelihood: High
The owner has legitimate reasons to call burnFaucetTokens() during normal operations (supply management, testing, emergency response)
The function executes successfully without any warnings or failed transactions - the owner may not realize they've drained the faucet
No events are emitted showing the actual transfer amount versus burn amount, making the discrepancy invisible to observers
The comment on lines 130-131 suggests this behavior is intentional but misunderstands the ERC20 _burn() function which doesn't require the caller to own tokens
Impact: Critical
The entire faucet token supply can be transferred to the owner in a single transaction disguised as a burn operation
Users will be unable to claim tokens after this occurs, breaking core protocol functionality
If owner calls burnFaucetTokens(100 * 10**18) on a faucet with 1,000,000 tokens, owner receives 999,900 tokens that should remain in the faucet
This violates the protocol's stated limitation that "owner cannot claim faucet tokens" (README line 37)
PoC Explanation: The first test demonstrates that when the owner calls burnFaucetTokens(1000) intending to burn 1000 tokens from a faucet containing 1 billion tokens, the function actually transfers ALL 1 billion tokens to the owner and only burns 1000, leaving the owner with 999,999,000 tokens and the faucet completely drained. The second test provides a side-by-side comparison showing the massive discrepancy between intended behavior (burn 100 tokens, faucet retains 999,900) versus actual behavior (owner receives 999,900 tokens, only 100 burned).
Mitigation Explanation: Change the transfer amount from balanceOf(address(this)) (entire contract balance) to amountToBurn (the specified amount). This ensures only the intended burn amount is transferred to the owner before burning. The original comment suggesting that the owner needs all tokens before burning is based on a misunderstanding - the ERC20 _burn() function only requires the caller to have sufficient balance to burn the specified amount, not the entire supply.
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.