burnFaucetTokens Implementation Transfers Full Contract Balance to Owner, Enabling Faucet Depletion and Disruption of Token DistributionWhen the owner wants to burn faucet tokens, only the specified amount should be destroyed from the contract’s holdings, leaving the remainder available for users.
The function first transfers the entire token balance held by the faucet contract to the owner, then burns only amountToBurn from the owner. This lets the owner (or anyone controlling the owner key) drain all remaining faucet tokens into the owner account, burning just a portion.
Likelihood:
Whenever the owner executes burnFaucetTokens, the entire faucet balance is transferred to the owner by design, even if the intent is to burn only a small amount.
In the event of owner key compromise or malicious governance, this becomes a single-transaction drain of the faucet’s token reserves.
Impact:
Faucet depletion: Users can no longer claim tokens because the faucet contract no longer holds them.
Privilege abuse / trust failure: Owner can accumulate a large token balance unintentionally or intentionally, breaking assumptions about fair distribution and test economics.
This test demonstrates that calling burnFaucetTokens(amountToBurn) moves the entire faucet token balance from the contract to the owner before burning. As a result, only amountToBurn is destroyed, while the remainder stays with the owner. The assertions show:
The faucet contract’s balance becomes zero immediately after the call (because everything was transferred out), and,
The owner’s final balance increases by faucetInitialBalance - amountToBurn, proving an unintended drain of all faucet tokens except the small portion burned.
Burn directly from the contract’s balance and do not transfer anything to the owner. Also consider emitting a dedicated event for clarity.
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.