-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathICollectModule.sol
48 lines (44 loc) · 1.81 KB
/
ICollectModule.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {Types} from 'contracts/libraries/constants/Types.sol';
/**
* @title ICollectModule
* @author Lens Protocol
*
* @notice 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.
*/
interface ICollectModule {
/**
* @notice Initializes data for a given publication being published.
* @custom:permissions LensHub.
*
* @param profileId The token ID of the profile publishing the publication.
* @param pubId The associated publication's LensHub publication ID.
* @param transactionExecutor The owner or an approved delegated executor.
* @param data Arbitrary data __passed from the user!__ to be decoded.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function initializePublicationCollectModule(
uint256 profileId,
uint256 pubId,
address transactionExecutor,
bytes calldata data
) external returns (bytes memory);
/**
* @notice Processes a collect action for a given publication.
* @custom:permissions LensHub.
*
* @param processCollectParams The parameters for the collect action.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function processCollect(Types.ProcessCollectParams calldata processCollectParams) external returns (bytes memory);
}