The burnFaucetTokens() function contains a critical logic error where it transfers the entire token balance of the faucet contract to the owner, regardless of the amountToBurn parameter specified:
The function accepts amountToBurn as a parameter to control how many tokens should be burned, but the _transfer call uses balanceOf(address(this)) instead of amountToBurn. This means:
The entire faucet balance is transferred to the owner
Only amountToBurn tokens are burned from the owner's balance
The remaining tokens stay with the owner instead of remaining in the faucet
Example scenario:
Faucet contract holds: 1,000,000 tokens
Owner calls burnFaucetTokens(100000) intending to burn 100,000 tokens
Actual execution:
Transfers 1,000,000 tokens to owner
Burns 100,000 tokens from owner
Result: Faucet has 0 tokens, Owner has 900,000 tokens
Expected: Faucet has 900,000 tokens, 100,000 burned
After the first call to burnFaucetTokens(), the faucet contract will have zero tokens remaining, making it unable to distribute tokens to users via claimFaucetTokens()
Change the _transfer call to only transfer the amountToBurn parameter instead of the entire 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.