Normal behavior: The faucet contract should allow the owner to burn a specified amount of tokens held by the faucet contract, without moving more tokens than requested or unexpectedly transferring tokens to the owner
Specific issue: The function transfers the entire token balance of the contract to the owner and then burns only amountToBurn. This results in the owner receiving any surplus tokens that were intended to remain in the faucet.
Likelihood:
This happens whenever the owner calls burnFaucetTokens with amountToBurn strictly less than the contract balance. The contract currently always transfers the entire contract balance before burning the requested amount.
It is easy for the caller or reviewer to assume the function burns only amountToBurn from the faucet, while in reality the owner will receive the rest. This will be triggered any time the faucet holds > amountToBurn.
Impact:
Owner can extract the faucet's remaining balance (not intended for extraction) and keep tokens leftover after burning. This subverts the faucet’s intended supply control and leads to privilege abuse or accidental loss of funds intended for users.
Users and integrators expecting faucet tokens to remain or be burned will be surprised; tokenomics and trust in the contract can be broken.
The owner ends up with all tokens taken from the faucet, while only 100 tokens were burned. The faucet lost all tokens instead of the intended 100.
I proposed to safe gas burn directly from the faucet. _burn(address(this), amountToBurn) reduces the faucet's balance and totalSupply directly.
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.