Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: low
Likelihood: high
Invalid

State Variable `beatToken` could be Immutable

State Variable beatToken could be Immutable

Description

  • State variables taht are only changed during the deployment in the constructor should be declared immutable to save gas.

  • beatToken is set in the contructor and then beatTokne will not be changed in the FestivalPass contract.

@> address public beatToken;

Risk

Likelihood:

High, it occurs at deployment

Impact:

  • Increased gas cost during deployment due to unnecessary storage writes.

  • Higher ongoing gas costs for reading non-immutable state variables, reducing contract efficiency.

Proof of Concept

N/A

Recommended Mitigation

  • Change beatToken form public to immutable

  • Also, keep in mind by this change, the getter fucntion will be loss, so getBeatTokenmight be implemeted if needed.

- address public beatToken;
+ address immutable beatToken;
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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