Puppy Raffle

AI First Flight #1
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Unused Internal Function _isActivePlayer() Wastes Deployment Gas

Root + Impact

Description

The _isActivePlayer() function is defined but never called anywhere in the contract. This dead code increases deployment costs and contract size without providing any functionality. It appears to be leftover from development or refactoring.

function _isActivePlayer() internal view returns (bool) {
for (uint256 i = 0; i < players.length; i++) {
if (players[i] == msg.sender) {
return true;
}
}
return false;
}

Risk

Impact:
Unnecessary deployment gas costs and increased contract bytecode size. The function adds approximately 200-300 bytes to the contract bytecode, costing extra gas on deployment.

Proof of Concept

The function _isActivePlayer() is not referenced anywhere in the contract. A search through all functions shows no calls to this internal function.

Recommended Mitigation

Remove the unused function entirely:

  1. Delete the entire _isActivePlayer() function

Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!