Details:
Certain state variables in the contracts are only assigned once in the constructor and never modified thereafter. Specifically, in InheritanceManager.sol
, the variable NFTFactory nft
is set during contract creation, and in NFTFactory.sol
, the variable address inheritanceManager
is assigned in the constructor. Declaring these variables as immutable
would allow the compiler to optimize gas usage by embedding their values directly into the contract’s bytecode.
Root Cause:
The variables that should be constant after initialization are not marked as immutable
. This oversight leads to additional gas costs when these variables are accessed during contract execution.
Impact:
Gas Inefficiency: Increased gas usage on deployment and on read operations.
Clarity: Without the immutable
keyword, it is less clear to auditors and developers that these variables are not intended to change after construction.
Recommendation:
Modify the variable declarations to include the immutable
keyword. For example:
In InheritanceManager.sol
, change:
to:
In NFTFactory.sol
, change:
to:
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.