Upgrade plugins by openzeppelin
A proxy contract holds the state (storage) and forwards calls via delegatecall to the implementation contract. A constructor executes only during the deployment of its own contract—thus, if defined in the implementation contract, it runs in the implementation’s context, not in the proxy’s. That state is discarded by the proxy. So constructor-based initialization doesn't affect proxy storage. Constructors are not re-executed on delegatecall, so they can’t initialize proxy storage.
Initializable
Initializable provides an initializer modifier that ensures:
initialize(...) function is called once and only through the proxy.Logic contract address : Storage slot 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc (obtained as bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)). Holds the address of the logic contract that this proxy delegates to. SHOULD be empty if a beacon is used instead.
**event** Upgraded(**address** **indexed** implementation);
Beacon contract address: Storage slot 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50 (obtained as bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)). Holds the address of the beacon contract this proxy relies on (fallback). SHOULD be empty if a logic address is used directly instead, and should only be considered if the logic contract slot is empty.
**event** BeaconUpgraded(**address** **indexed** beacon);
Admin address: Storage slot 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103 (obtained as bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)).
Holds the address that is allowed to upgrade the logic contract address for this proxy (optional).
**event** AdminChanged(**address** previousAdmin, **address** newAdmin)
ITransparentUpgradeableProxy.upgradeToAndCall function exposed by the proxy itself.upgradeToAndCall function but any other call won’t be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error indicating the proxy admin cannot fallback to the target implementation.An upgradeability mechanism to be included in the implementation contract.
in UUPS proxies the upgrade is handled by the implementation, and can eventually be removed.
Transparent proxies, on the other hand, include the upgrade and admin logic in the proxy itself. This means TransparentUpgradeableProxy is more expensive to deploy than what is possible with UUPS proxies.
UUPSUpgradeable : Inheriting from UUPSUpgradeable (and overriding the _authorizeUpgrade function with the relevant access control mechanism) will turn your contract into a UUPS compliant implementation.
BeaconProxy: A proxy that retrieves its implementation from a beacon contract.UpgradeableBeacon: A beacon contract with a built in admin that can upgrade the BeaconProxy pointing to it.upgrade operations are sent to the beacon instead of to the proxy contract, and all proxies that follow that beacon are automatically upgraded.