The burnFaucetTokens() function contains a critical flaw in its implementation that causes it to drain the entire faucet balance instead of burning only the specified amount. When the owner attempts to burn tokens for supply management, the function first transfers ALL tokens to the owner, then only burns the requested amount, leaving the faucet completely empty and non-functional.
Normal Behavior:
The burnFaucetTokens() function should burn a specified amount of tokens from the contract's balance while keeping the remaining tokens in the contract for future claims.
The Issue:
The function transfers the entire contract balance to the owner before burning only the amountToBurn. This leaves the faucet with zero tokens, even when the owner only intends to burn a small amount.
Likelihood:
The owner calls burnFaucetTokens() to burn tokens for any reason (supply management, deflation, etc.)
The function is explicitly provided as a protocol feature, making it likely to be used
Impact:
All faucet tokens are transferred to the owner's wallet, leaving the contract with 0 balance
Users can no longer claim tokens via claimFaucetTokens() (will revert with RaiseBoxFaucet_InsufficientContractBalance)
Faucet becomes permanently non-functional until owner mints new tokens via mintFaucetTokens() or transfers back tokens
Protocol's core functionality (distributing tokens to users) is completely disrupted
Test Output:
Actors:
Owner: Attempts to burn small amount of tokens for supply management
Protocol: Entire faucet is drained and becomes non-functional
Users: Cannot claim tokens, faucet is broken
Remove the unnecessary transfer step and burn tokens directly from the contract. The _burn() function in OpenZeppelin's ERC20 implementation can burn from any address, not just msg.sender. The current implementation mistakenly transfers all tokens to the owner before burning, when it should simply burn the specified amount directly from the contract's balance.
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.