From 42b9e3020474eeeb073ce5df392a92eaec325334 Mon Sep 17 00:00:00 2001 From: zer0dot Date: Fri, 30 Sep 2022 15:35:32 -0400 Subject: [PATCH] feat: Added "followerProfileId" to `isFollowing()` check in follow modules. --- contracts/core/modules/FollowValidationModuleBase.sol | 2 +- .../core/modules/follow/FollowValidatorFollowModuleBase.sol | 1 + contracts/interfaces/IFollowModule.sol | 2 ++ contracts/mocks/MockFollowModule.sol | 1 + 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/contracts/core/modules/FollowValidationModuleBase.sol b/contracts/core/modules/FollowValidationModuleBase.sol index dd54d3f..68f1bf0 100644 --- a/contracts/core/modules/FollowValidationModuleBase.sol +++ b/contracts/core/modules/FollowValidationModuleBase.sol @@ -33,7 +33,7 @@ abstract contract FollowValidationModuleBase is ModuleBase { address followModule = ILensHub(HUB).getFollowModule(profileId); bool isFollowing; if (followModule != address(0)) { - isFollowing = IFollowModule(followModule).isFollowing(profileId, user, 0); + isFollowing = IFollowModule(followModule).isFollowing(0, profileId, user, 0); } else { address followNFT = ILensHub(HUB).getFollowNFT(profileId); isFollowing = followNFT != address(0) && IERC721(followNFT).balanceOf(user) != 0; diff --git a/contracts/core/modules/follow/FollowValidatorFollowModuleBase.sol b/contracts/core/modules/follow/FollowValidatorFollowModuleBase.sol index 519117e..c75f046 100644 --- a/contracts/core/modules/follow/FollowValidatorFollowModuleBase.sol +++ b/contracts/core/modules/follow/FollowValidatorFollowModuleBase.sol @@ -21,6 +21,7 @@ abstract contract FollowValidatorFollowModuleBase is ModuleBase, IFollowModule { * and other properties. */ function isFollowing( + uint256, uint256 profileId, address follower, uint256 followNFTTokenId diff --git a/contracts/interfaces/IFollowModule.sol b/contracts/interfaces/IFollowModule.sol index f618e09..bde970a 100644 --- a/contracts/interfaces/IFollowModule.sol +++ b/contracts/interfaces/IFollowModule.sol @@ -77,6 +77,7 @@ interface IFollowModule { * 2. The follow module: * - Validates the subscription status for that given NFT, reverting on an invalid subscription. * + * @param followerProfileId The LensHub profile token ID of the follower's profile (currently unused, preemptive interface upgrade). * @param profileId The token ID of the profile to validate the follow for. * @param follower The follower address to validate the follow for. * @param followNFTTokenId The followNFT token ID to validate the follow for. @@ -84,6 +85,7 @@ interface IFollowModule { * @return true if the given address is following the given profile ID, false otherwise. */ function isFollowing( + uint256 followerProfileId, uint256 profileId, address follower, uint256 followNFTTokenId diff --git a/contracts/mocks/MockFollowModule.sol b/contracts/mocks/MockFollowModule.sol index 2cd364b..2e81c6e 100644 --- a/contracts/mocks/MockFollowModule.sol +++ b/contracts/mocks/MockFollowModule.sol @@ -27,6 +27,7 @@ contract MockFollowModule is IFollowModule { ) external override {} function isFollowing( + uint256, uint256, address, uint256