Several state variables in the contracts that are only set once during initialization are not marked as immutable, leading to unnecessary gas costs and potential security risks.
From the test results:
This shows a difference of ~2200 gas per read operation when using non-immutable vs immutable variables.
Affected variables include:
Low/Gas Optimization
Gas inefficiency: ~2200 gas wasted per read operation
Risk potential: Non-immutable variables could theoretically be modified if setter functions are added later
Test proves higher gas costs: 7368 vs 5169 gas (42% more expensive)
Slither static analyzer
Custom test suite (ImmutableRoutesTest)
Manual review
Foundry gas reporting
Mark variables as immutable when they're only set in constructor:
Benefits:
Gas savings of ~2200 gas per read
Clearer code intent
Elimination of potential future modification risks
Better compiler optimizations
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.