Even though mentioned in the comments of the program, logically it is wrong to transfer total balance of the contract, instead of amountToBurn to the owner.
It makes the contract non-functional due to the lack of faucet tokens to give to the users.
It also indirectly breaks one of the invariants of the application, which is "Owner cannot claim faucet tokens". It has the effect of allowing the owner to transfer some or all of the faucet tokens to their own account.
Likelihood: Medium
This will happen only when the owner calls the RaiseBoxFaucet::burnFaucetTokens function.
Impact: High
Depending on the value of the amountToBurn argument, the owner can intentionally/uintentionally transfer some or all of the faucet tokens to their own account, and burn the rest. It also breaks the invariant of the application.
Another effect is making the contract run out of the faucet tokens and stop working (RaiseBoxFaucet::claimFaucetTokens function calls will revert) until the owner mints more tokens.
Please copy and paste the following code to the test file, and run it.
This issue can be fixed by replacing balanceOf(address(this)) with amountToBurn in the _transfer function call.
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.