Owner in RaiseBoxFaucet::burnFaucetTokens()The owner can calls burnFaucetTokens(uint256 amountToBurn) to burn certain amount of tokens (amountToBurn ), but the contract should send an amountToBurn to the owner before calling the inetrnal _burn().
The burnFaucetTokens(uint256 amountToBurn) transfers the entire faucet balance to the owner instead of the only specified amountToBurn. This means the owner ends up holding all faucet tokens, even though only part of them should be burned.
Likelihood:
Whenever the owner legitimately performs a token burn, this will always transfer all faucet tokens to their account first.
The function doesn’t enforce any logic to return leftover tokens to the faucet, so the state corruption persists indefinitely.
Impact:
Faucet token supply distribution breaks — faucet runs out of tokens, no user can claim.
Steps:
Faucet holds INITIAL_SUPPLY amount of faucet tokens.
Owner calls burnFaucetTokens()to burn amountToBurn.
The amountToBurn from the faucet's balance was burnt, and the remaining unburnt balance was transferred to the owner, thus, the current faucet's balance is zero.
Add the following codes to RaiseBoxFaucet.t.sol and run forge test --mt testOwnerReceivesAllUnburntTokensAfterBurn :
Result:
Burn the amountToBurn directly from the faucet's balance, i.e:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.