FollowerOnlyReferenceModule

Git Source

Inherits: HubRestricted, IReferenceModule

Author: Lens Protocol

A simple reference module that validates that comments, quotes or mirrors originate from a profile that follows the profile of the original publication.

Functions

constructor

constructor(address hub) HubRestricted(hub);

initializeReferenceModule

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

There is nothing needed at initialization.

function initializeReferenceModule(uint256, uint256, address, bytes calldata) external pure returns (bytes memory);

Parameters

NameTypeDescription
<none>uint256
<none>uint256
<none>address
<none>bytes

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.

Validates that the commenting profile's owner is a follower.

function processComment(Types.ProcessCommentParams calldata processCommentParams)
    external
    view
    override
    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.

Validates that the quoting profile's owner is a follower.

function processQuote(Types.ProcessQuoteParams calldata processQuoteParams)
    external
    view
    override
    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.

Validates that the mirroring profile's owner is a follower.

function processMirror(Types.ProcessMirrorParams calldata processMirrorParams)
    external
    view
    override
    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.