Eggstravaganza

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

State Variable Could Be Immutable

Summary

`eggNFT` and `eggVault` variables should be mark as immutable since the only place they are change in `EggHuntGame.sol`, is in the contructor which can save us more gas.

Impact

Gas Wasted per Read/Write.
In solidity Immutable variables use ~200 less gas per read compared to regular storage variables (reference: https://docs.soliditylang.org/en/latest/contracts.html#immutable).

Recommendations

```diff
Change them into `immutable` variable.
- EggstravaganzaNFT public eggNFT;
+ EggstravaganzaNFT immutable public eggNFT;
- EggVault public eggVault;
+ EggVault public immutable eggVault;
```
Updates

Lead Judging Commences

m3dython Lead Judge 8 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.

Give us feedback!