Eggstravaganza

First Flight #37
Beginner FriendlySolidity
100 EXP
View results
Submission Details
Severity: low
Invalid

Mutable Reference to External Contract (Missed `immutable` Keyword), more gas cost per access

Summary

The EggHuntGame::eggNFT and EggHuntGame::eggVault variables are assigned once in the constructor and never updated afterward. These references are ideal candidates for the immutable keyword.

Vulnerability Details

Proof of Code:

EggstravaganzaNFT public eggNFT;
EggVault public eggVault;

Impact

Slightly higher gas cost per access and reduced clarity for readers and auditors.

Tools Used

  1. Foundry

  2. Slither

Recommendations

Mark EggHuntGame::eggNFT and EggHuntGame::eggVault variables as immutable.

- EggstravaganzaNFT public eggNFT;
- EggVault public eggVault;
+ EggstravaganzaNFT public immutable eggNFT;
+ EggVault public immutable eggVault;
Updates

Lead Judging Commences

m3dython Lead Judge about 2 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Gas optimization

Strategy to save gas and minimize transaction costs

Support

FAQs

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