NFT Dealers

First Flight #58
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Impact: low
Likelihood: medium
Invalid

Unused variable

Unused variable leads to wastage of gas

Description

The variable metadataFrozen is a boolean declared in the NFTDealers.sol file but is never used anywhere in the contract. it is never initialized, checked or updated anywhere in the contract logic.

bool public metadataFrozen;

Risk

Likelihood:

Probably medium since every state variable takes up storage space (typically a 32-byte slot)

Impact:

The presence of the unused variable indicates a missing functionality or error .

The presence of the unused variable also leads to wastage of gas in storage during deployment or contract interaction.

Proof of Concept

None

Recommended Mitigation

1. The protocol could add a new functionality that uses the variable or they could remove the line of code to save on gas storage
2. Use 'constant' or 'immuntable' since they are embedded directly in the bytecode and avoid taking up expensive storage slots
3. Group the variable with other related variables into a struct
Updates

Lead Judging Commences

rubik0n Lead Judge 16 days ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

info

Support

FAQs

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

Give us feedback!