-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathIReferenceModule.sol
72 lines (66 loc) · 2.98 KB
/
IReferenceModule.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {Types} from 'contracts/libraries/constants/Types.sol';
/**
* @title IReferenceModule
* @author Lens Protocol
*
* @notice 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.
*/
interface IReferenceModule {
/**
* @notice Initializes data for the given publication being published with this Reference module.
* @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 address of the transaction executor (e.g. for any funds to transferFrom).
* @param data Arbitrary data passed from the user to be decoded by the Reference Module during initialization.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function initializeReferenceModule(
uint256 profileId,
uint256 pubId,
address transactionExecutor,
bytes calldata data
) external returns (bytes memory);
/**
* @notice Processes a comment being published. This includes any module logic like transferring tokens,
* checking for conditions (e.g. token-gated), etc.
* @custom:permissions LensHub.
*
* @param processCommentParams The parameters for processing a comment.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function processComment(Types.ProcessCommentParams calldata processCommentParams) external returns (bytes memory);
/**
* @notice Processes a quote being published. This includes any module logic like transferring tokens,
* checking for conditions (e.g. token-gated), etc.
* @custom:permissions LensHub
*
* @param processQuoteParams The parameters for processing a quote.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function processQuote(Types.ProcessQuoteParams calldata processQuoteParams) external returns (bytes memory);
/**
* @notice Processes a mirror being published. This includes any module logic like transferring tokens,
* checking for conditions (e.g. token-gated), etc.
* @custom:permissions LensHub
*
* @param processMirrorParams The parameters for processing a mirror.
*
* @return bytes Any custom ABI-encoded data. This will be a LensHub event params that can be used by
* indexers or UIs.
*/
function processMirror(Types.ProcessMirrorParams calldata processMirrorParams) external returns (bytes memory);
}