ICollectModule

Git Source

Author: Lens Protocol

This is the standard interface for all Lens-compatible CollectModules. Collect modules allow users to execute custom logic upon a collect action over a publication, like:

  • Only allow the collect if the collector is following the publication author.
  • Only allow the collect if the collector has made a payment to
  • Allow any collect but only during the first 24 hours.
  • Etc.

Functions

initializePublicationCollectModule

Initializes data for a given publication being published.

function initializePublicationCollectModule(
    uint256 profileId,
    uint256 pubId,
    address transactionExecutor,
    bytes calldata data
) external returns (bytes memory);

Parameters

NameTypeDescription
profileIduint256The token ID of the profile publishing the publication.
pubIduint256The associated publication's LensHub publication ID.
transactionExecutoraddressThe owner or an approved delegated executor.
databytesArbitrary data passed from the user! to be decoded.

Returns

NameTypeDescription
<none>bytesbytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by indexers or UIs.

processCollect

Processes a collect action for a given publication.

function processCollect(Types.ProcessCollectParams calldata processCollectParams) external returns (bytes memory);

Parameters

NameTypeDescription
processCollectParamsTypes.ProcessCollectParamsThe parameters for the collect action.

Returns

NameTypeDescription
<none>bytesbytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by indexers or UIs.