mirror of
https://github.com/lens-protocol/core.git
synced 2026-04-22 03:02:03 -04:00
small fixes
This commit is contained in:
@@ -235,7 +235,6 @@ interface ILensHub {
|
||||
* @param followNFTIds The token ID array of the followNFT.
|
||||
* @param enables The boolean indicates when the `follow` logic on the indexer needs to be enabled/disabled
|
||||
*/
|
||||
|
||||
function toggleFollow(
|
||||
uint256[] calldata profileIds,
|
||||
uint256[] calldata followNFTIds,
|
||||
|
||||
@@ -339,9 +339,9 @@ library DataTypes {
|
||||
*/
|
||||
struct ToggleFollowWithSigData {
|
||||
address follower;
|
||||
uint256[] profileIds,
|
||||
uint256[] followNFTIds,
|
||||
bool[] enables,
|
||||
uint256[] profileIds;
|
||||
uint256[] followNFTIds;
|
||||
bool[] enables;
|
||||
EIP712Signature sig;
|
||||
}
|
||||
|
||||
|
||||
@@ -470,8 +470,8 @@ library Events {
|
||||
* @dev Emitted when the user wants to enable or disable the follow.
|
||||
*
|
||||
* @param profileId The token ID of the profile to which this followNFT is associated.
|
||||
* @param owner The profile owner who executed the troggle.
|
||||
* @param enabled. Boolean value that enable / disable follow.
|
||||
* @param owner The profile owner who executed the toggle.
|
||||
* @param enabled Whether the FollowNFT is enabled/disabled.
|
||||
* @param timestamp The current block timestamp.
|
||||
*/
|
||||
event ToggleFollowNFT(
|
||||
|
||||
@@ -155,14 +155,23 @@ library InteractionLogic {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notice Toggle follows of the given profiles.
|
||||
*
|
||||
* @param follower The address executing the follow.
|
||||
* @param profileIds The array of profile token IDs to follow.
|
||||
* @param followNFTIds The token ID array of the followNFT.
|
||||
* @param enables Array of booleans indicates when the `follow` logic on the indexer needs to be enabled/disabled
|
||||
* @param _profileById A pointer to the storage mapping of profile structs by profile ID.
|
||||
*/
|
||||
function toggleFollow(
|
||||
address follower,
|
||||
uint256[] calldata profileIds,
|
||||
uint256[] calldata followNFTIds,
|
||||
bool[] enables,
|
||||
bool[] calldata enables,
|
||||
mapping(uint256 => DataTypes.ProfileStruct) storage _profileById
|
||||
) external {
|
||||
if (profileIds.length != followNFTIds.length && profileIds.length != enables.length) revert Errors.ArrayMismatch();
|
||||
if (profileIds.length != followNFTIds.length || profileIds.length != enables.length) revert Errors.ArrayMismatch();
|
||||
for (uint256 i = 0; i < profileIds.length; ++i) {
|
||||
address followNFT = _profileById[profileIds[i]].followNFT;
|
||||
if (follower != IFollowNFT(followNFT).ownerOf(followNFTIds[i])) revert Errors.NotFollowNFTOwner();
|
||||
|
||||
Reference in New Issue
Block a user