The mintFaucetTokens function allows the contract owner to mint new ERC20 tokens, but it only permits minting to the contract's own address (address(this)) through a check (if (to != address(this))). This makes the to parameter redundant, as the function's logic ensures tokens can only be minted to the contract itself.
Using an unnecessary parameter reduces code clarity and may slightly increase gas costs due to additional storage and processing of the parameter. Removing the to parameter and hardcoding address(this) would simplify the function while maintaining its intended functionality.
Likelihood:
Developers misinterpret the purpose of the to parameter, assuming minting to other addresses is possible despite the restriction.
Future maintenance introduces errors if the to parameter is mistakenly assumed to support other addresses.
Impact:
Reduced code readability makes it harder for auditors and developers to quickly understand the function's intent.
Slight increase in gas costs due to processing and checking the unnecessary to parameter.
The current implementation includes an unnecessary parameter and check:
Remove the to parameter and hardcode address(this) in the _mint call to simplify the function and reduce gas costs.
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.