The claimFaucetTokens function updates a state variable faucetClaimer that serves no functional purpose in the contract. This variable is set to msg.sender on every claim but is never read or used anywhere in the contract logic.
The specific issue is that updating this unnecessary state variable costs approximately 5,000 gas per transaction through an SSTORE operation, wasting user funds without providing any benefit.
Likelihood:
Occurs on every single token claim
Affects all users
Guaranteed to happen during normal operation
No conditions required
Impact:
Wastes ~5,000 gas per claim transaction
Unnecessary cost to users
Pollutes contract state
No functional benefit provided
This test demonstrates the gas waste from the unnecessary state variable:
Setup: We deploy the contract with the unnecessary state variable
Measurement: We observe that the variable is updated on every claim
Result: ~5,000 gas wasted per transaction with no benefit
The waste occurs because:
SSTORE operation costs ~5,000 gas for non-zero to non-zero
Variable is updated on every claim
Variable is never read or used
Provides zero functional value
Remove the unnecessary state variable:
If tracking the last claimer is needed for some reason, document why and use it:
However, since the current contract has no use for this variable, it should simply be removed to save gas.
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.