diff --git a/contracts/actions/post/collect/LensCollectedPost.sol b/contracts/actions/post/collect/LensCollectedPost.sol index efe9690..64d99b6 100644 --- a/contracts/actions/post/collect/LensCollectedPost.sol +++ b/contracts/actions/post/collect/LensCollectedPost.sol @@ -28,11 +28,7 @@ contract LensCollectedPost is LensERC721, IERC7572 { address internal immutable _collectAction; constructor(address feed, uint256 postId, bool isImmutable) { - // TODO: This is a hack to make it compile for now. Redo properly. - Initializable.$storage().initializing = true; LensERC721._initialize("Lens Collected Post", "LCP", ITokenURIProvider(address(0))); - Initializable.$storage().initializing = false; - _disableInitializers(); string memory contentURI = IFeed(feed).getPost(postId).contentURI; require(bytes(contentURI).length > 0, "Post content URI is empty"); _feed = feed; diff --git a/contracts/core/access/AccessControlled.sol b/contracts/core/access/AccessControlled.sol index dc99640..bbe9d5c 100644 --- a/contracts/core/access/AccessControlled.sol +++ b/contracts/core/access/AccessControlled.sol @@ -4,9 +4,8 @@ pragma solidity ^0.8.0; import {IAccessControl} from "./../interfaces/IAccessControl.sol"; import {AccessControlLib} from "./../libraries/AccessControlLib.sol"; -import {Initializable} from "./../upgradeability/Initializable.sol"; -abstract contract AccessControlled is Initializable { +abstract contract AccessControlled { using AccessControlLib for IAccessControl; using AccessControlLib for address; @@ -26,7 +25,7 @@ abstract contract AccessControlled is Initializable { } } - function _initialize(IAccessControl accessControl) internal onlyInitializing { + function _initialize(IAccessControl accessControl) internal { accessControl.verifyHasAccessFunction(); _setAccessControl(accessControl); } diff --git a/contracts/core/base/LensERC721.sol b/contracts/core/base/LensERC721.sol index d7cd632..484d67f 100644 --- a/contracts/core/base/LensERC721.sol +++ b/contracts/core/base/LensERC721.sol @@ -8,9 +8,8 @@ import "@openzeppelin/contracts-upgradeable/token/ERC721/IERC721ReceiverUpgradea import "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import "./../interfaces/ITokenURIProvider.sol"; import "./../interfaces/IERC4906Events.sol"; -import "./../upgradeability/Initializable.sol"; -abstract contract LensERC721 is IERC721, Initializable { +abstract contract LensERC721 is IERC721 { using AddressUpgradeable for address; event Lens_ERC721_TokenURIProviderSet(address indexed tokenURIProvider); @@ -41,10 +40,7 @@ abstract contract LensERC721 is IERC721, Initializable { } } - function _initialize(string memory nftName, string memory nftSymbol, ITokenURIProvider tokenURIProvider) - internal - onlyInitializing - { + function _initialize(string memory nftName, string memory nftSymbol, ITokenURIProvider tokenURIProvider) internal { $erc721Storage().name = nftName; $erc721Storage().symbol = nftSymbol; $erc721Storage().tokenURIProvider = tokenURIProvider; diff --git a/contracts/core/primitives/feed/Feed.sol b/contracts/core/primitives/feed/Feed.sol index b9832dc..f1719a9 100644 --- a/contracts/core/primitives/feed/Feed.sol +++ b/contracts/core/primitives/feed/Feed.sol @@ -44,7 +44,7 @@ contract Feed is AccessControlled._initialize(accessControl); } - function _initialize(string memory metadataURI) internal onlyInitializing { + function _initialize(string memory metadataURI) internal { _setMetadataURI(metadataURI); _emitPIDs(); emit Events.Lens_Contract_Deployed("feed", "lens.feed", "feed", "lens.feed"); diff --git a/contracts/core/primitives/graph/Graph.sol b/contracts/core/primitives/graph/Graph.sol index fb40b3c..a515f16 100644 --- a/contracts/core/primitives/graph/Graph.sol +++ b/contracts/core/primitives/graph/Graph.sol @@ -41,7 +41,7 @@ contract Graph is AccessControlled._initialize(accessControl); } - function _initialize(string memory metadataURI) internal onlyInitializing { + function _initialize(string memory metadataURI) internal { _setMetadataURI(metadataURI); _emitPIDs(); emit Events.Lens_Contract_Deployed("graph", "lens.graph", "graph", "lens.graph"); diff --git a/contracts/core/primitives/group/Group.sol b/contracts/core/primitives/group/Group.sol index 28a3dc2..05173b9 100644 --- a/contracts/core/primitives/group/Group.sol +++ b/contracts/core/primitives/group/Group.sol @@ -45,7 +45,7 @@ contract Group is AccessControlled._initialize(accessControl); } - function _initialize(string memory metadataURI) internal onlyInitializing { + function _initialize(string memory metadataURI) internal { _setMetadataURI(metadataURI); _emitPIDs(); emit Events.Lens_Contract_Deployed("group", "lens.group", "group", "lens.group"); diff --git a/contracts/core/primitives/namespace/Namespace.sol b/contracts/core/primitives/namespace/Namespace.sol index 9458bd1..ae63e4d 100644 --- a/contracts/core/primitives/namespace/Namespace.sol +++ b/contracts/core/primitives/namespace/Namespace.sol @@ -59,7 +59,7 @@ contract Namespace is LensERC721._initialize(nftName, nftSymbol, tokenURIProvider); } - function _initialize(string memory namespace, string memory metadataURI) internal onlyInitializing { + function _initialize(string memory namespace, string memory metadataURI) internal { Core.$storage().namespace = namespace; _setMetadataURI(metadataURI); _emitPIDs(); diff --git a/contracts/core/upgradeability/Initializable.sol b/contracts/core/upgradeability/Initializable.sol index 76b6a76..fa7b8b5 100644 --- a/contracts/core/upgradeability/Initializable.sol +++ b/contracts/core/upgradeability/Initializable.sol @@ -7,7 +7,6 @@ abstract contract Initializable { struct Storage { bool initialized; - bool initializing; } /// @custom:keccak lens.storage.Initializable @@ -21,14 +20,7 @@ abstract contract Initializable { modifier initializer() { require(!$storage().initialized, "ALREADY_INITIALIZED"); - $storage().initializing = true; - _; $storage().initialized = true; - $storage().initializing = false; - } - - modifier onlyInitializing() { - require($storage().initializing, "NOT_INITIALIZING"); _; } diff --git a/contracts/dashboard/primitives/app/App.sol b/contracts/dashboard/primitives/app/App.sol index 7a5bf66..7c2fa62 100644 --- a/contracts/dashboard/primitives/app/App.sol +++ b/contracts/dashboard/primitives/app/App.sol @@ -62,7 +62,7 @@ contract App is IApp, Initializable, BaseSource, AccessControlled { bool isSourceStampVerificationEnabled, AppInitialProperties memory initialProps, KeyValue[] memory extraData - ) internal onlyInitializing { + ) internal { _setMetadataURI(metadataURI); _setSourceStampVerification(isSourceStampVerificationEnabled); _setTreasury(initialProps.treasury);