-
Notifications
You must be signed in to change notification settings - Fork 8
/
IBaseFeeCollectModule.sol
73 lines (68 loc) · 2.92 KB
/
IBaseFeeCollectModule.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
73
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0;
import {ICollectModule} from 'contracts/interfaces/ICollectModule.sol';
import {Types} from 'contracts/libraries/constants/Types.sol';
/**
* @notice A struct containing the necessary data to execute collect actions on a publication.
*
* @param amount The collecting cost associated with this publication. 0 for free collect.
* @param collectLimit The maximum number of collects for this publication. 0 for no limit.
* @param currency The currency associated with this publication.
* @param currentCollects The current number of collects for this publication.
* @param referralFee The referral fee associated with this publication.
* @param followerOnly True if only followers of publisher may collect the post.
* @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry.
* @param recipient Recipient of collect fees.
*/
struct BaseProfilePublicationData {
uint160 amount;
uint96 collectLimit;
address currency;
uint96 currentCollects;
address recipient;
uint16 referralFee;
bool followerOnly;
uint72 endTimestamp;
}
/**
* @notice A struct containing the necessary data to initialize this Base Collect Module.
*
* @param amount The collecting cost associated with this publication. 0 for free collect.
* @param collectLimit The maximum number of collects for this publication. 0 for no limit.
* @param currency The currency associated with this publication.
* @param referralFee The referral fee associated with this publication.
* @param followerOnly True if only followers of publisher may collect the post.
* @param endTimestamp The end timestamp after which collecting is impossible. 0 for no expiry.
* @param recipient Recipient of collect fees.
*/
struct BaseFeeCollectModuleInitData {
uint160 amount;
uint96 collectLimit;
address currency;
uint16 referralFee;
bool followerOnly;
uint72 endTimestamp;
address recipient;
}
interface IBaseFeeCollectModule is ICollectModule {
/**
* @notice Returns the Base publication data for a given publication, or an empty struct if that publication was not
* initialized with this module.
*
* @param profileId The token ID of the profile mapped to the publication to query.
* @param pubId The publication ID of the publication to query.
*
* @return The BaseProfilePublicationData struct mapped to that publication.
*/
function getBasePublicationData(uint256 profileId, uint256 pubId)
external
view
returns (BaseProfilePublicationData memory);
/**
* @notice Calculates and returns the collect fee of a publication.
* @dev Override this function to use a different formula for the fee.
*
* @return The collect fee of the specified publication.
*/
function calculateFee(Types.ProcessCollectParams calldata processCollectParams) external view returns (uint160);
}