22pragma solidity ^ 0.8.24 ;
33
44import {Strings} from "@openzeppelin/contracts/utils/Strings.sol " ;
5- import {UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable .sol " ;
5+ import {UUPSUpgradeableEmptyProxy } from "./shared/UUPSUpgradeableEmptyProxy .sol " ;
66import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol " ;
77import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol " ;
88import {fhevmExecutorAdd} from "../addresses/FHEVMExecutorAddress.sol " ;
@@ -15,7 +15,7 @@ import {ACLEvents} from "./ACLEvents.sol";
1515 * or decrypt encrypted values in fhEVM. By defining and enforcing these permissions, the ACL ensures that encrypted data remains
1616 * secure while still being usable within authorized contexts.
1717 */
18- contract ACL is UUPSUpgradeable , Ownable2StepUpgradeable , PausableUpgradeable , ACLEvents {
18+ contract ACL is UUPSUpgradeableEmptyProxy , Ownable2StepUpgradeable , PausableUpgradeable , ACLEvents {
1919 /// @notice Returned if the delegatee contract is already delegatee for sender & delegator addresses.
2020 /// @param delegatee delegatee address.
2121 /// @param contractAddress contract address.
@@ -63,7 +63,7 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable, PausableUpgradeable, A
6363 uint256 private constant MAJOR_VERSION = 0 ;
6464
6565 /// @notice Minor version of the contract.
66- uint256 private constant MINOR_VERSION = 1 ;
66+ uint256 private constant MINOR_VERSION = 2 ;
6767
6868 /// @notice Patch version of the contract.
6969 uint256 private constant PATCH_VERSION = 0 ;
@@ -83,10 +83,11 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable, PausableUpgradeable, A
8383 }
8484
8585 /**
86- * @notice Re-initializes the contract.
86+ * @notice Initializes the contract.
87+ * @param initialPauser Pauser address
8788 */
8889 /// @custom:oz-upgrades-validate-as-initializer
89- function reinitialize (address initialPauser ) public virtual reinitializer (2 ) {
90+ function initializeFromEmptyProxy (address initialPauser ) public virtual onlyFromEmptyProxy reinitializer (3 ) {
9091 __Ownable_init (owner ());
9192 __Pausable_init ();
9293
@@ -98,6 +99,19 @@ contract ACL is UUPSUpgradeable, Ownable2StepUpgradeable, PausableUpgradeable, A
9899 $.pauser = initialPauser;
99100 }
100101
102+ /**
103+ * @notice Re-initializes the contract from V1, adding new storage variable pauser.
104+ * @param initialPauser Pauser address
105+ */
106+ function reinitializeV2 (address initialPauser ) public virtual reinitializer (3 ) {
107+ if (initialPauser == address (0 )) {
108+ revert InvalidNullPauser ();
109+ }
110+
111+ ACLStorage storage $ = _getACLStorage ();
112+ $.pauser = initialPauser;
113+ }
114+
101115 /**
102116 * @notice Allows the use of `handle` for the address `account`.
103117 * @dev The caller must be allowed to use `handle` for allow() to succeed. If not, allow() reverts.
0 commit comments