State variables eggNFT
and eggVault
in the EggHuntGame contract are only set in the constructor and never modified afterwards. These variables should be declared as immutable
to reduce gas costs.
The following state variables are only assigned values in the constructor and are never changed throughout the contract's lifecycle:
These variables are referenced in multiple functions, and each access costs more gas than necessary because they're stored in the contract's storage rather than in the bytecode itself.
Low impact (gas inefficiency). This issue doesn't affect the security or functionality of the contract, but it does result in higher gas costs for users interacting with the contract, particularly when calling functions that reference these variables.
Manual code review - Aderyn and slither
Declare these state variables as immutable
to reduce gas costs:
This change will reduce the gas cost of reading these variables, as immutable variables are stored in the contract bytecode rather than in storage. The gas savings will apply to every function that reads these variables, providing a cumulative benefit over the contract's lifetime.
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.