The GroupIPAssetRegistry manages the registration and tracking of Group IP Assets (IPAs), including the group members and reward pools. It provides functionality for registering groups, managing group membership, and handling group reward pools.

State Variables

MAX_GROUP_SIZE

uint256 public constant MAX_GROUP_SIZE = 1000

The maximum number of members allowed in a group.

GROUPING_MODULE

IGroupingModule public immutable GROUPING_MODULE

The address of the protocol-wide Grouping Module.

Functions

registerGroup

function registerGroup(
    address groupNft,
    uint256 groupNftId,
    address rewardPool,
    address registerFeePayer
) external onlyGroupingModule whenNotPaused returns (address groupId)

Registers a Group IPA.

Parameters:

  • groupNft: The address of the group NFT.
  • groupNftId: The ID of the group NFT.
  • rewardPool: The address of the group reward pool.
  • registerFeePayer: The address of the account that pays the registration fee.

Returns:

  • groupId: The address of the newly registered Group IPA.

whitelistGroupRewardPool

function whitelistGroupRewardPool(address rewardPool, bool allowed) external onlyGroupingModule whenNotPaused

Whitelists a group reward pool.

Parameters:

  • rewardPool: The address of the group reward pool.
  • allowed: Whether the group reward pool is whitelisted.

addGroupMember

function addGroupMember(address groupId, address[] calldata ipIds) external onlyGroupingModule whenNotPaused

Adds members to a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.
  • ipIds: The addresses of the IPs to add to the Group IPA.

removeGroupMember

function removeGroupMember(address groupId, address[] calldata ipIds) external onlyGroupingModule whenNotPaused

Removes members from a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.
  • ipIds: The addresses of the IPs to remove from the Group IPA.

isRegisteredGroup

function isRegisteredGroup(address groupId) external view returns (bool)

Checks whether a group IPA was registered based on its ID.

Parameters:

  • groupId: The address of the Group IPA.

Returns:

  • isRegistered: Whether the Group IPA was registered into the protocol.

getGroupRewardPool

function getGroupRewardPool(address groupId) external view returns (address)

Retrieves the group reward pool for a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.

Returns:

  • rewardPool: The address of the group reward pool.

isWhitelistedGroupRewardPool

function isWhitelistedGroupRewardPool(address rewardPool) external view returns (bool isWhitelisted)

Checks whether a group reward pool is whitelisted.

Parameters:

  • rewardPool: The address of the group reward pool.

Returns:

  • isWhitelisted: Whether the group reward pool is whitelisted.

getGroupMembers

function getGroupMembers(
    address groupId,
    uint256 startIndex,
    uint256 size
) external view returns (address[] memory results)

Retrieves the group members for a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.
  • startIndex: The start index of the group members to retrieve.
  • size: The size of the group members to retrieve.

Returns:

  • results: The addresses of the group members.

containsIp

function containsIp(address groupId, address ipId) external view returns (bool)

Checks whether an IP is a member of a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.
  • ipId: The address of the IP.

Returns:

  • isMember: Whether the IP is a member of the Group IPA.

totalMembers

function totalMembers(address groupId) external view returns (uint256)

Retrieves the total number of members in a Group IPA.

Parameters:

  • groupId: The address of the Group IPA.

Returns:

  • totalMembers: The total number of members in the Group IPA.