GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Unused Parameter

Summary

Unused Parameter should be removed or comment out.

Vulnerability Details:

Issue Description:

As there is unused parameter in constructor _registry which has following issues:

  • can increase gas cost

  • not a good practice

  • not effective for code cleanliness

constructor(address _registry) ERC721("DonationReceipt", "DRC") {
registry = CharityRegistry(msg.sender);
owner = msg.sender;
tokenCounter = 0;
}

If it is necessary to use then the code should be like this:

constructor(address _registry) ERC721("DonationReceipt", "DRC") {
registry = CharityRegistry(_registry);
owner = msg.sender;
tokenCounter = 0;
}

Otherwise remove the unused parameter, and the code will be:

constructor() ERC721("DonationReceipt", "DRC") {
registry = CharityRegistry(msg.sender);
owner = msg.sender;
tokenCounter = 0;
}

Impact:

Unused variable increase gas cost

Tools Used:

Manual review

Recommendations:

Remove the unused variable.

Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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