The Grouping Module is the main entry point for the IPA grouping on Story. It is responsible for:

  • Registering a group
  • Adding IP to group
  • Removing IP from group
  • Claiming reward

State Variables

name

string public constant override name = GROUPING_MODULE_KEY

Returns the name of the module.

ROYALTY_MODULE

IRoyaltyModule public immutable ROYALTY_MODULE

Returns the canonical protocol-wide RoyaltyModule.

LICENSE_TOKEN

ILicenseToken public immutable LICENSE_TOKEN

Returns the canonical protocol-wide LicenseToken.

GROUP_NFT

IGroupNFT public immutable GROUP_NFT

Returns the address GROUP NFT contract.

GROUP_IP_ASSET_REGISTRY

IGroupIPAssetRegistry public immutable GROUP_IP_ASSET_REGISTRY

Returns the canonical protocol-wide Group IP Asset Registry.

LICENSE_REGISTRY

ILicenseRegistry public immutable LICENSE_REGISTRY

Returns the canonical protocol-wide LicenseRegistry.

DISPUTE_MODULE

IDisputeModule public immutable DISPUTE_MODULE

Returns the protocol-wide dispute module.

Functions

initialize

function initialize(address accessManager) public initializer

Initializer for this implementation contract.

Parameters:

  • accessManager: The address of the protocol admin roles contract.

registerGroup

function registerGroup(address groupPool) external nonReentrant whenNotPaused returns (address groupId)

Registers a Group IPA.

Parameters:

  • groupPool: The address of the group pool.

Returns:

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

whitelistGroupRewardPool

function whitelistGroupRewardPool(address rewardPool, bool allowed) external restricted

Whitelists a group reward pool.

Parameters:

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

addIp

function addIp(
    address groupIpId,
    address[] calldata ipIds,
    uint256 maxAllowedRewardShare
) external nonReentrant whenNotPaused verifyPermission(groupIpId)

Adds IP to group. The function must be called by the Group IP owner or an authorized operator.

Parameters:

  • groupIpId: The address of the group IP.
  • ipIds: The IP IDs.
  • maxAllowedRewardShare: The maximum reward share percentage that can be allocated to each member IP.

removeIp

function removeIp(
    address groupIpId,
    address[] calldata ipIds
) external nonReentrant whenNotPaused verifyPermission(groupIpId)

Removes IP from group. The function must be called by the Group IP owner or an authorized operator.

Parameters:

  • groupIpId: The address of the group IP.
  • ipIds: The IP IDs.

claimReward

function claimReward(address groupId, address token, address[] calldata ipIds) external nonReentrant whenNotPaused

Claims reward.

Parameters:

  • groupId: The address of the group.
  • token: The address of the token.
  • ipIds: The IP IDs.

collectRoyalties

function collectRoyalties(
    address groupId,
    address token
) external nonReentrant whenNotPaused returns (uint256 royalties)

Collects royalties into the pool, making them claimable by group member IPs.

Parameters:

  • groupId: The address of the group.
  • token: The address of the token.

Returns:

  • royalties: The amount of royalties collected.

name

function name() external pure override returns (string memory)

Returns the name of the module.

Returns:

  • string: The name of the module.

getClaimableReward

function getClaimableReward(
    address groupId,
    address token,
    address[] calldata ipIds
) external view returns (uint256[] memory)

Returns the available reward for each IP in the group.

Parameters:

  • groupId: The address of the group.
  • token: The address of the token.
  • ipIds: The IP IDs.

Returns:

  • uint256[] memory: The rewards for each IP.