This repository has been archived by the owner on Feb 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTypes.sol
134 lines (126 loc) · 5.13 KB
/
Types.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity ^0.8.22;
/// @notice The status of a launch group.
enum LaunchGroupStatus {
PENDING,
ACTIVE,
PAUSED,
COMPLETED
}
/// @notice Contains the settings of a launch group.
/// @param startsAt The timestamp at which the launch group participation starts.
/// @param endsAt The timestamp at which the launch group participation ends.
/// @param minTokenAmountPerUser The minimum token allocation per user.
/// @param maxTokenAmountPerUser The maximum token allocation per user.
/// @param maxTokenAllocation The maximum token allocation for the launch group.
/// @param finalizesAtParticipation If true, launch group sales will finalize at the participation.
/// @param status The status of the launch group.
struct LaunchGroupSettings {
uint256 startsAt;
uint256 endsAt;
uint256 minTokenAmountPerUser;
uint256 maxTokenAmountPerUser;
uint256 maxTokenAllocation;
bool finalizesAtParticipation;
LaunchGroupStatus status;
}
/// @notice Contains the configuration of a currency for a launch group.
/// @param tokenPriceBps The price of the sale token in this currency in basis points.
/// @param isEnabled Whether this currency is accepted.
struct CurrencyConfig {
uint256 tokenPriceBps;
bool isEnabled;
}
/// @notice Contains the information of a participation.
/// @param userAddress The address of the user.
/// @param userId The unique identifier of the user.
/// @param tokenAmount The amount of tokens the user wants to purchase.
/// @param currencyAmount The amount of currency the user should pay.
/// @param currency The currency of the participation.
/// @param isFinalized Whether the participation is finalized.
struct ParticipationInfo {
bytes32 userId;
uint256 tokenAmount;
uint256 currencyAmount;
address currency;
address userAddress;
bool isFinalized;
}
/// @notice Contains the request to participate in a launch group.
/// @param chainId The chain ID for this launch.
/// @param launchId The unique identifier of the launch.
/// @param launchGroupId The unique identifier of the launch group.
/// @param launchParticipationId The unique identifier of the participation.
/// @param userId The unique identifier of the user.
/// @param userAddress The address of the user.
/// @param tokenAmount The amount of tokens the user wants to purchase.
/// @param currency The currency of the participation.
/// @param requestExpiresAt The timestamp at which the request expires.
struct ParticipationRequest {
uint256 chainId;
bytes32 launchId;
bytes32 launchGroupId;
bytes32 launchParticipationId;
bytes32 userId;
address userAddress;
uint256 tokenAmount;
address currency;
uint256 requestExpiresAt;
}
/// @notice Contains the request to update a participation in a launch group.
/// @param chainId The chain ID for this launch.
/// @param launchId The unique identifier of the launch.
/// @param launchGroupId The unique identifier of the launch group.
/// @param prevLaunchParticipationId The unique identifier of the previous participation.
/// @param newLaunchParticipationId The unique identifier of the new participation.
/// @param userId The unique identifier of the user.
/// @param userAddress The address of the user.
/// @param tokenAmount The amount of tokens the user wants to purchase.
/// @param currency The currency of the participation.
/// @param requestExpiresAt The timestamp at which the request expires.
struct UpdateParticipationRequest {
uint256 chainId;
bytes32 launchId;
bytes32 launchGroupId;
bytes32 prevLaunchParticipationId;
bytes32 newLaunchParticipationId;
bytes32 userId;
address userAddress;
uint256 tokenAmount;
address currency;
uint256 requestExpiresAt;
}
/// @notice Contains the request to cancel a participation in a launch group.
/// @param chainId The chain ID for this launch.
/// @param launchId The unique identifier of the launch.
/// @param launchGroupId The unique identifier of the launch group.
/// @param launchParticipationId The unique identifier of the participation.
/// @param userId The unique identifier of the user.
/// @param userAddress The address of the user.
/// @param requestExpiresAt The timestamp at which the request expires.
struct CancelParticipationRequest {
uint256 chainId;
bytes32 launchId;
bytes32 launchGroupId;
bytes32 launchParticipationId;
bytes32 userId;
address userAddress;
uint256 requestExpiresAt;
}
/// @notice Contains the request to claim a refund for a participation in a launch group.
/// @param chainId The chain ID for this launch.
/// @param launchId The unique identifier of the launch.
/// @param launchGroupId The unique identifier of the launch group.
/// @param launchParticipationId The unique identifier of the participation.
/// @param userId The unique identifier of the user.
/// @param userAddress The address of the user.
/// @param requestExpiresAt The timestamp at which the request expires.
struct ClaimRefundRequest {
uint256 chainId;
bytes32 launchId;
bytes32 launchGroupId;
bytes32 launchParticipationId;
bytes32 userId;
address userAddress;
uint256 requestExpiresAt;
}