small fixes

This commit is contained in:
damarnez
2022-02-28 20:39:07 +01:00
parent add276751b
commit 9f81c8f28d
4 changed files with 16 additions and 8 deletions

View File

@@ -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,

View File

@@ -339,9 +339,9 @@ library DataTypes {
*/
struct ToggleFollowWithSigData {
address follower;
uint256[] profileIds,
uint256[] followNFTIds,
bool[] enables,
uint256[] profileIds;
uint256[] followNFTIds;
bool[] enables;
EIP712Signature sig;
}

View File

@@ -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(

View File

@@ -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();