ConsensusLayerFeeDispatcher/ExecutionLayerFeeDispatcher - Should Hardcode autoPetrify With Highest Initializable Version Instead of User Provided Argument
The version to auto-initialize is not hardcoded with the constructor. On deployment, the deployer may accidentally use the wrong version, allowing anyone to call `initialize` on the contract.\\n```\\n/// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\\nconstructor(uint256 \\_version) {\\n VERSION\\_SLOT.setUint256(\\_version);\\n}\\n```\\n\\n```\\n/// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\\nconstructor(uint256 \\_version) {\\n VERSION\\_SLOT.setUint256(\\_version);\\n}\\n\\n/// @notice Initialize the contract by storing the staking contract and the public key in storage\\n/// @param \\_stakingContract Address of the Staking Contract\\nfunction initELD(address \\_stakingContract) external init(1) {\\n STAKING\\_CONTRACT\\_ADDRESS\\_SLOT.setAddress(\\_stakingContract);\\n}\\n```\\n
Similar to the `init(1)` modifier, it is suggested to track the highest version as a `const int` with the contract and auto-initialize to the highest version in the constructor instead of taking the highest version as a deployment argument.
```\\n/// @notice Constructor method allowing us to prevent calls to initCLFR by setting the appropriate version\\nconstructor(uint256 \\_version) {\\n VERSION\\_SLOT.setUint256(\\_version);\\n}\\n```\\n