Beginner FriendlyFoundryNFT
100 EXP
View results
Submission Details
Severity: low
Invalid

lack of immutables & constants

Summary

raffleDuration should be immutable, immutable state variable entranceFee should follow immutable variables naming conventions and imageUris should be constant as well, that may hopefully deprecate the Raffle's bytecode deployment cost.

Vulnerability Details

raffleDuration
// This state variable should be immutable...
uint256 public raffleDuration;
entranceFee
// This state variable should have immutable variables naming convention.
uint256 public immutable entranceFee;
commonImageUri
// This state variable should be constant
string private commonImageUri = "ipfs://QmSsYRx3LpDAb1GZQm7zZ1AuHZjfbPkD6J7s9r41xu1mf8";
rareImageUri
// This state variable should be constant
string private rareImageUri = "ipfs://QmUPjADFGEKmfohdTaNcWhp7VGk26h5jXDA7v3VtTnTLcW";
legendaryImageUri
// This state variable should be constant
string private legendaryImageUri = "ipfs://QmYx6GsYAKnNzZ9A6NvEKV9nf1VaDzJrqDR23Y8YSkebLU";

Impact

It causes the raffle deployment cost high.

Tools Used

Manual review

Recommendations

raffleDuration optimized
uint256 public immutable i_raffleDuration;
entranceFee optimized
uint256 public immutable i_entranceFee;
commonImageUri optimized
string private constant COMMON_IMAGE_URI = "ipfs://QmSsYRx3LpDAb1GZQm7zZ1AuHZjfbPkD6J7s9r41xu1mf8";
rareImageUri optimized
string private constant RARE_IMAGE_URI = "ipfs://QmUPjADFGEKmfohdTaNcWhp7VGk26h5jXDA7v3VtTnTLcW";
legendaryImageUri optimized
string private constant LEGENDARY_IMAGE_URI = "ipfs://QmYx6GsYAKnNzZ9A6NvEKV9nf1VaDzJrqDR23Y8YSkebLU";
Updates

Lead Judging Commences

Hamiltonite Lead Judge about 2 years ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!