The function burnFaucetTokens() is intended to burn a specified number of tokens from the faucet's balance, reducing the total supply.
However, the function first transfers the entire token balance of the faucet to the owner's address, then burns the specified amount from the owner's personal balance. This unexpectedly drains the faucet of all its tokens, misleading the owner about the function's true outcome and rendering the faucet inoperable.
Likelihood:
Reason 1: The function is callable by the owner, who is a trusted and active participant in the protocol.
Reason 2: The function name is misleading. An owner will likely call it with the reasonable expectation that it only burns tokens, accidentally triggering the drain.
Impact:
Impact 1: The faucet is unexpectedly drained of its entire token supply, preventing it from serving its primary purpose of dispensing tokens to users.
Impact 2: An owner calling this function will inadvertently receive almost all of the faucet's tokens. This can be perceived as a hidden "rug pull" mechanism, damaging the project's reputation.
The following Foundry test proves that calling burnFaucetTokens drains the faucet's balance to the owner.
Remove the unnecessary _transfer call and burn the tokens directly from the faucet contract's balance by changing msg.sender to address(this).
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.