All five address-type state variables in PairFactory can be made immutable (because they are only ever initialized in the constructor) to save storage slots and gas because SLOADs are not needed anymore for their reads as their usages are replaced at construction time by their fixed values.
Handle
0xRajeev
Vulnerability details
Impact
All five address-type state variables in PairFactory can be made immutable (because they are only ever initialized in the constructor) to save storage slots and gas because SLOADs are not needed anymore for their reads as their usages are replaced at construction time by their fixed values.
Proof of Concept
https://github.com/code-423n4/2021-09-wildcredit/blob/c48235289a25b2134bb16530185483e8c85507f8/contracts/PairFactory.sol#L22-L26
https://github.com/code-423n4/2021-09-wildcredit/blob/c48235289a25b2134bb16530185483e8c85507f8/contracts/PairFactory.sol#L32-L44
Tools Used
Manual Analysis
Recommended Mitigation Steps
Convert the five state variables to immutable