The EggHuntGame smart contract enables players to find and mint NFTs during a limited-time egg hunt game. The game interacts with an EggstravaganzaNFT contract and an EggVault contract to facilitate minting and storing of egg NFTs.
The contract is well-structured and readable, but there are some areas where gas optimizations and security improvements can be made.
Both eggNFT and eggVault are contract references that are set once in the constructor and never change.
Currently, they are stored in contract storage, leading to high gas usage on each read (SLOAD = ~2100 gas).
These variables should be marked as immutable for efficient bytecode-level storage and low-cost access.
Gas inefficiency: Repeated SLOAD operations in heavily-used functions such as searchForEgg and depositEggToVault cause unnecessary gas spending.
Mannual code review
Strategy to save gas and minimize transaction costs
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.