The burnFaucetTokens function contains a critical programming error where it transfers the entire contract balance to the owner instead of only the specified amountToBurn parameter. This causes the faucet to become completely empty and non-functional after any burn operation.
The normal and expected behavior is that when the owner calls burnFaucetTokens(amountToBurn), the function should transfer ONLY the specified amountToBurn tokens from the contract to the owner's address, then burn that exact amount from the owner's balance, leaving the remaining tokens in the contract for users to claim.
The specific issue occurs on line 131 of RaiseBoxFaucet.sol where the function uses balanceOf(address(this)) (which represents the ENTIRE contract balance) instead of the amountToBurn parameter in the _transfer call. This means that regardless of what value is passed as amountToBurn, ALL tokens in the contract are transferred to the owner, only the specified amount is burned, and the contract is left with zero tokens.
Likelihood:
The owner will call this function whenever they need to reduce the token supply for economic reasons or to manage inflation
This bug triggers with 100% certainty every single time the function is called
There are no conditions or edge cases - it's a deterministic bug that always occurs
The function will execute successfully (no revert) but with completely unintended consequences
Impact:
The entire faucet contract balance is transferred to the owner after ANY burn operation, regardless of the amount specified
The contract becomes completely empty with zero token balance
All users attempting to claim tokens will receive a revert with "InsufficientContractBalance" error
The faucet functionality is permanently broken until the owner mints new tokens back to the contract
This violates the protocol requirement that "owner cannot claim faucet tokens" as the owner indirectly receives all tokens
The owner ends up with (totalBalance - amountToBurn) tokens in their wallet instead of zero
This test demonstrates how the burn function incorrectly transfers all tokens instead of just the specified amount, breaking the faucet.
The fix is straightforward: replace balanceOf(address(this)) with the amountToBurn parameter in the transfer call. This ensures only the specified amount is transferred to the owner before burning.
Explanation: The current implementation transfers the entire balance because it queries the contract's full balance at the time of transfer. By using the amountToBurn parameter instead, we ensure that only the amount the owner wants to burn is transferred. This maintains the remaining tokens in the contract for users to claim and preserves the faucet's functionality.
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.