From 6f5df05f2b2bf23e5e4e3b5dcadfa217a5fdf185 Mon Sep 17 00:00:00 2001 From: donosonaumczuk Date: Fri, 27 Oct 2023 13:29:19 -0300 Subject: [PATCH] fix: Self dependency removed --- .gitmodules | 3 --- lib/core-private | 1 - remappings.txt | 1 - script/A_DeployLensV2Upgrade.s.sol | 11 +++++------ script/C_ChangeLensV1Admins.s.sol | 6 +++--- script/D_PerformV2Upgrade.s.sol | 6 +++--- test/base/TestSetup.t.sol | 4 ++-- 7 files changed, 13 insertions(+), 19 deletions(-) delete mode 160000 lib/core-private diff --git a/.gitmodules b/.gitmodules index 3135215..15880c4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,6 +10,3 @@ [submodule "lib/openzeppelin-contracts"] path = lib/openzeppelin-contracts url = https://github.com/OpenZeppelin/openzeppelin-contracts -[submodule "lib/core-private"] - path = lib/core-private - url = https://github.com/lens-protocol/core-private diff --git a/lib/core-private b/lib/core-private deleted file mode 160000 index c6731df..0000000 --- a/lib/core-private +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6731df7d9ee63ae3322f7800b797308cf714394 diff --git a/remappings.txt b/remappings.txt index 7b3c24c..3a2726f 100644 --- a/remappings.txt +++ b/remappings.txt @@ -14,4 +14,3 @@ utility-contracts/=lib/seadrop/lib/utility-contracts/src/ create2-scripts/=lib/seadrop/lib/create2-helpers/script/ solady/=lib/solady/src/ -@lens-v1/=lib/core-private/ diff --git a/script/A_DeployLensV2Upgrade.s.sol b/script/A_DeployLensV2Upgrade.s.sol index b6e4d83..5b6b09f 100644 --- a/script/A_DeployLensV2Upgrade.s.sol +++ b/script/A_DeployLensV2Upgrade.s.sol @@ -3,8 +3,7 @@ pragma solidity ^0.8.13; import {ForkManagement} from 'script/helpers/ForkManagement.sol'; import 'forge-std/Script.sol'; -import {LensHub as LegacyLensHub} from '@lens-v1/contracts/core/LensHub.sol'; -import {ModuleGlobals} from '@lens-v1/contracts/core/modules/ModuleGlobals.sol'; +import {ILensGovernable} from 'contracts/interfaces/ILensGovernable.sol'; import {LensHubInitializable} from 'contracts/misc/LensHubInitializable.sol'; import {LensV2UpgradeContract} from 'contracts/misc/LensV2UpgradeContract.sol'; import {FollowNFT} from 'contracts/FollowNFT.sol'; @@ -45,11 +44,11 @@ contract A_DeployLensV2Upgrade is Script, ForkManagement, ArrayHelpers { } address lensHub; - LegacyLensHub legacyLensHub; + ILensGovernable legacyLensHub; // We just need the `getGovernance` function address legacyLensHubImpl; address lensHubV2Impl; - ModuleGlobals moduleGlobals; + ILensGovernable moduleGlobals; // We use `getTreasury` and `getTreasuryFee` functions address followNFTImpl; address legacyCollectNFTImpl; @@ -80,7 +79,7 @@ contract A_DeployLensV2Upgrade is Script, ForkManagement, ArrayHelpers { function loadBaseAddresses() internal override { lensHub = json.readAddress(string(abi.encodePacked('.', targetEnv, '.LensHubProxy'))); - legacyLensHub = LegacyLensHub(lensHub); + legacyLensHub = ILensGovernable(lensHub); vm.label(lensHub, 'LensHub'); console.log('Lens Hub Proxy: %s', address(legacyLensHub)); @@ -88,7 +87,7 @@ contract A_DeployLensV2Upgrade is Script, ForkManagement, ArrayHelpers { vm.label(legacyLensHubImpl, 'LensHubImplementation'); console.log('Legacy Lens Hub Impl: %s', address(legacyLensHubImpl)); - moduleGlobals = ModuleGlobals(json.readAddress(string(abi.encodePacked('.', targetEnv, '.ModuleGlobals')))); + moduleGlobals = ILensGovernable(json.readAddress(string(abi.encodePacked('.', targetEnv, '.ModuleGlobals')))); vm.label(address(moduleGlobals), 'ModuleGlobals'); console.log('ModuleGlobals: %s', address(moduleGlobals)); diff --git a/script/C_ChangeLensV1Admins.s.sol b/script/C_ChangeLensV1Admins.s.sol index a96e400..de88a9e 100644 --- a/script/C_ChangeLensV1Admins.s.sol +++ b/script/C_ChangeLensV1Admins.s.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.13; import {ForkManagement} from 'script/helpers/ForkManagement.sol'; import 'forge-std/Script.sol'; -import {LensHub as LegacyLensHub} from '@lens-v1/contracts/core/LensHub.sol'; +import {ILensGovernable} from 'contracts/interfaces/ILensGovernable.sol'; import {Governance} from 'contracts/misc/access/Governance.sol'; import {LensV2UpgradeContract} from 'contracts/misc/LensV2UpgradeContract.sol'; import {ProxyAdmin} from 'contracts/misc/access/ProxyAdmin.sol'; @@ -17,7 +17,7 @@ contract C_ChangeLensV1Admins is Script, ForkManagement { bytes32 constant ADMIN_SLOT = bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1); - LegacyLensHub legacyLensHub; + ILensGovernable legacyLensHub; // We just need the `getGovernance` function TransparentUpgradeableProxy lensHubAsProxy; Governance governanceContract; address proxyAdmin; @@ -26,7 +26,7 @@ contract C_ChangeLensV1Admins is Script, ForkManagement { function loadBaseAddresses() internal override { address lensHubProxyAddress = json.readAddress(string(abi.encodePacked('.', targetEnv, '.LensHubProxy'))); - legacyLensHub = LegacyLensHub(lensHubProxyAddress); + legacyLensHub = ILensGovernable(lensHubProxyAddress); vm.label(lensHubProxyAddress, 'LensHub'); console.log('Legacy Lens Hub: %s', address(legacyLensHub)); lensHubAsProxy = TransparentUpgradeableProxy(payable(lensHubProxyAddress)); diff --git a/script/D_PerformV2Upgrade.s.sol b/script/D_PerformV2Upgrade.s.sol index 139b70b..16fc54a 100644 --- a/script/D_PerformV2Upgrade.s.sol +++ b/script/D_PerformV2Upgrade.s.sol @@ -3,7 +3,7 @@ pragma solidity ^0.8.13; import {ForkManagement} from 'script/helpers/ForkManagement.sol'; import 'forge-std/Script.sol'; -import {LensHub as LegacyLensHub} from '@lens-v1/contracts/core/LensHub.sol'; +import {ILensGovernable} from 'contracts/interfaces/ILensGovernable.sol'; import {Governance} from 'contracts/misc/access/Governance.sol'; import {LensV2UpgradeContract} from 'contracts/misc/LensV2UpgradeContract.sol'; import {ProxyAdmin} from 'contracts/misc/access/ProxyAdmin.sol'; @@ -29,7 +29,7 @@ contract D_PerformV2Upgrade is Script, ForkManagement { LensAccount _governance; LensAccount _proxyAdmin; - LegacyLensHub legacyLensHub; + ILensGovernable legacyLensHub; // We just need the `getGovernance` function TransparentUpgradeableProxy lensHubAsProxy; LensV2UpgradeContract lensV2UpgradeContract; Governance governanceContract; @@ -38,7 +38,7 @@ contract D_PerformV2Upgrade is Script, ForkManagement { function loadBaseAddresses() internal override { address lensHubProxyAddress = json.readAddress(string(abi.encodePacked('.', targetEnv, '.LensHubProxy'))); - legacyLensHub = LegacyLensHub(lensHubProxyAddress); + legacyLensHub = ILensGovernable(lensHubProxyAddress); vm.label(lensHubProxyAddress, 'LensHub'); console.log('Lens Hub Proxy: %s', address(legacyLensHub)); lensHubAsProxy = TransparentUpgradeableProxy(payable(lensHubProxyAddress)); diff --git a/test/base/TestSetup.t.sol b/test/base/TestSetup.t.sol index 51602a3..fe42eec 100644 --- a/test/base/TestSetup.t.sol +++ b/test/base/TestSetup.t.sol @@ -25,7 +25,7 @@ import {TokenHandleRegistry} from 'contracts/namespaces/TokenHandleRegistry.sol' import {MockActionModule} from 'test/mocks/MockActionModule.sol'; import {MockReferenceModule} from 'test/mocks/MockReferenceModule.sol'; import {ModuleRegistry} from 'contracts/misc/ModuleRegistry.sol'; -import {ModuleGlobals} from '@lens-v1/contracts/core/modules/ModuleGlobals.sol'; +import {ILensGovernable} from 'contracts/interfaces/ILensGovernable.sol'; // TODO: Move these to Interface file in test folder. struct OldCreateProfileParams { @@ -146,7 +146,7 @@ contract TestSetup is Test, ContractAddressesLoaderDeployer, ArrayHelpers { TREASURY_FEE_BPS = hub.getTreasuryFee(); } else { - ModuleGlobals moduleGlobals = ModuleGlobals( + ILensGovernable moduleGlobals = ILensGovernable( json.readAddress(string(abi.encodePacked('.', targetEnv, '.ModuleGlobals'))) ); vm.label(address(moduleGlobals), 'ModuleGlobals');