IReferenceModule

Git Source

Author: Lens Protocol

This is the standard interface for all Lens-compatible ReferenceModules. Reference modules allow executing some action when a publication is referenced, like:

  • Rewards for mirroring/commenting/quoting a publication.
  • Token-gated comments/mirrors/quotes of a publication.
  • Etc.

Functions

initializeReferenceModule

Initializes data for the given publication being published with this Reference module.

function initializeReferenceModule(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 address of the transaction executor (e.g. for any funds to transferFrom).
databytesArbitrary data passed from the user to be decoded by the Reference Module during initialization.

Returns

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

processComment

Processes a comment being published. This includes any module logic like transferring tokens, checking for conditions (e.g. token-gated), etc.

function processComment(Types.ProcessCommentParams calldata processCommentParams) external returns (bytes memory);

Parameters

NameTypeDescription
processCommentParamsTypes.ProcessCommentParamsThe parameters for processing a comment.

Returns

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

processQuote

Processes a quote being published. This includes any module logic like transferring tokens, checking for conditions (e.g. token-gated), etc.

function processQuote(Types.ProcessQuoteParams calldata processQuoteParams) external returns (bytes memory);

Parameters

NameTypeDescription
processQuoteParamsTypes.ProcessQuoteParamsThe parameters for processing a quote.

Returns

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

processMirror

Processes a mirror being published. This includes any module logic like transferring tokens, checking for conditions (e.g. token-gated), etc.

function processMirror(Types.ProcessMirrorParams calldata processMirrorParams) external returns (bytes memory);

Parameters

NameTypeDescription
processMirrorParamsTypes.ProcessMirrorParamsThe parameters for processing a mirror.

Returns

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