Why erc2771contextupgradable has a constructor

Hi Team...

Here is the contract - https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/master/contracts/metatx/ERC2771ContextUpgradeable.sol

Since it's upgradable, why does it have constructor and not the initialize function ?


Hi @novaknole, this particular case sets an immutable variable which gets embedded in the bytecode, so it is set in the constructor of the implementation. Please see https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/issues/147 for details on the reasoning.