SimpleFeeCollectModule

Git Source

Inherits: BaseFeeCollectModule

Author: Lens Protocol

This is a simple Lens CollectModule implementation, allowing customization of time to collect, number of collects and whether only followers can collect. You can build your own collect modules by inheriting from BaseFeeCollectModule and adding your functionality along with getPublicationData function.

Functions

constructor

constructor(address hub, address actionModule) BaseFeeCollectModule(hub, actionModule);

initializePublicationCollectModule

This collect module levies a fee on collects and supports referrals. Thus, we need to decode data.

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

Parameters

NameTypeDescription
profileIduint256The token ID of the profile publishing the publication.
pubIduint256The associated publication's LensHub publication ID.
<none>address
databytesThe arbitrary data parameter, decoded into BaseFeeCollectModuleInitData struct: amount: The collecting cost associated with this publication. 0 for free collect. collectLimit: The maximum number of collects for this publication. 0 for no limit. currency: The currency associated with this publication. referralFee: The referral fee associated with this publication. followerOnly: True if only followers of publisher may collect the post. endTimestamp: The end timestamp after which collecting is impossible. 0 for no expiry. recipient: Recipient of collect fees.

Returns

NameTypeDescription
<none>bytesAn abi encoded bytes parameter, which is the same as the passed data parameter.

getPublicationData

Returns the publication data for a given publication, or an empty struct if that publication was not initialized with this module.

function getPublicationData(uint256 profileId, uint256 pubId)
    external
    view
    virtual
    returns (BaseProfilePublicationData memory);

Parameters

NameTypeDescription
profileIduint256The token ID of the profile mapped to the publication to query.
pubIduint256The publication ID of the publication to query.

Returns

NameTypeDescription
<none>BaseProfilePublicationDataThe BaseProfilePublicationData struct mapped to that publication.