forked from cosmonft/lens-tracker-and-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
events.sol
522 lines (479 loc) · 19.5 KB
/
events.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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import {DataTypes} from './DataTypes.sol';
library Events {
/**
* @dev Emitted when the NFT contract's name and symbol are set at initialization.
*
* @param name The NFT name set.
* @param symbol The NFT symbol set.
* @param timestamp The current block timestamp.
*/
event BaseInitialized(string name, string symbol, uint256 timestamp);
/**
* @dev Emitted when the hub state is set.
*
* @param caller The caller who set the state.
* @param prevState The previous protocol state, an enum of either `Paused`, `PublishingPaused` or `Unpaused`.
* @param newState The newly set state, an enum of either `Paused`, `PublishingPaused` or `Unpaused`.
* @param timestamp The current block timestamp.
*/
event StateSet(
address indexed caller,
DataTypes.ProtocolState indexed prevState,
DataTypes.ProtocolState indexed newState,
uint256 timestamp
);
/**
* @dev Emitted when the governance address is changed. We emit the caller even though it should be the previous
* governance address, as we cannot guarantee this will always be the case due to upgradeability.
*
* @param caller The caller who set the governance address.
* @param prevGovernance The previous governance address.
* @param newGovernance The new governance address set.
* @param timestamp The current block timestamp.
*/
event GovernanceSet(
address indexed caller,
address indexed prevGovernance,
address indexed newGovernance,
uint256 timestamp
);
/**
* @dev Emitted when the emergency admin is changed. We emit the caller even though it should be the previous
* governance address, as we cannot guarantee this will always be the case due to upgradeability.
*
* @param caller The caller who set the emergency admin address.
* @param oldEmergencyAdmin The previous emergency admin address.
* @param newEmergencyAdmin The new emergency admin address set.
* @param timestamp The current block timestamp.
*/
event EmergencyAdminSet(
address indexed caller,
address indexed oldEmergencyAdmin,
address indexed newEmergencyAdmin,
uint256 timestamp
);
/**
* @dev Emitted when a profile creator is added to or removed from the whitelist.
*
* @param profileCreator The address of the profile creator.
* @param whitelisted Whether or not the profile creator is being added to the whitelist.
* @param timestamp The current block timestamp.
*/
event ProfileCreatorWhitelisted(
address indexed profileCreator,
bool indexed whitelisted,
uint256 timestamp
);
/**
* @dev Emitted when a follow module is added to or removed from the whitelist.
*
* @param followModule The address of the follow module.
* @param whitelisted Whether or not the follow module is being added to the whitelist.
* @param timestamp The current block timestamp.
*/
event FollowModuleWhitelisted(
address indexed followModule,
bool indexed whitelisted,
uint256 timestamp
);
/**
* @dev Emitted when a reference module is added to or removed from the whitelist.
*
* @param referenceModule The address of the reference module.
* @param whitelisted Whether or not the reference module is being added to the whitelist.
* @param timestamp The current block timestamp.
*/
event ReferenceModuleWhitelisted(
address indexed referenceModule,
bool indexed whitelisted,
uint256 timestamp
);
/**
* @dev Emitted when a collect module is added to or removed from the whitelist.
*
* @param collectModule The address of the collect module.
* @param whitelisted Whether or not the collect module is being added to the whitelist.
* @param timestamp The current block timestamp.
*/
event CollectModuleWhitelisted(
address indexed collectModule,
bool indexed whitelisted,
uint256 timestamp
);
/**
* @dev Emitted when a profile is created.
*
* @param profileId The newly created profile's token ID.
* @param creator The profile creator, who created the token with the given profile ID.
* @param to The address receiving the profile with the given profile ID.
* @param handle The handle set for the profile.
* @param imageURI The image uri set for the profile.
* @param followModule The profile's newly set follow module. This CAN be the zero address.
* @param followModuleReturnData The data returned from the follow module's initialization. This is abi encoded
* and totally depends on the follow module chosen.
* @param followNFTURI The URI set for the profile's follow NFT.
* @param timestamp The current block timestamp.
*/
event ProfileCreated(
uint256 indexed profileId,
address indexed creator,
address indexed to,
string handle,
string imageURI,
address followModule,
bytes followModuleReturnData,
string followNFTURI,
uint256 timestamp
);
/**
* @dev Emitted when a a default profile is set for a wallet as its main identity
*
* @param wallet The wallet which set or unset its default profile.
* @param profileId The token ID of the profile being set as default, or zero.
* @param timestamp The current block timestamp.
*/
event DefaultProfileSet(address indexed wallet, uint256 indexed profileId, uint256 timestamp);
/**
* @dev Emitted when a dispatcher is set for a specific profile.
*
* @param profileId The token ID of the profile for which the dispatcher is set.
* @param dispatcher The dispatcher set for the given profile.
* @param timestamp The current block timestamp.
*/
event DispatcherSet(uint256 indexed profileId, address indexed dispatcher, uint256 timestamp);
/**
* @dev Emitted when a profile's URI is set.
*
* @param profileId The token ID of the profile for which the URI is set.
* @param imageURI The URI set for the given profile.
* @param timestamp The current block timestamp.
*/
event ProfileImageURISet(uint256 indexed profileId, string imageURI, uint256 timestamp);
/**
* @dev Emitted when a follow NFT's URI is set.
*
* @param profileId The token ID of the profile for which the followNFT URI is set.
* @param followNFTURI The follow NFT URI set.
* @param timestamp The current block timestamp.
*/
event FollowNFTURISet(uint256 indexed profileId, string followNFTURI, uint256 timestamp);
/**
* @dev Emitted when a profile's follow module is set.
*
* @param profileId The profile's token ID.
* @param followModule The profile's newly set follow module. This CAN be the zero address.
* @param followModuleReturnData The data returned from the follow module's initialization. This is abi encoded
* and totally depends on the follow module chosen.
* @param timestamp The current block timestamp.
*/
event FollowModuleSet(
uint256 indexed profileId,
address followModule,
bytes followModuleReturnData,
uint256 timestamp
);
/**
* @dev Emitted when a "post" is published.
*
* @param profileId The profile's token ID.
* @param pubId The new publication's ID.
* @param contentURI The URI mapped to this new publication.
* @param collectModule The collect module mapped to this new publication. This CANNOT be the zero address.
* @param collectModuleReturnData The data returned from the collect module's initialization for this given
* publication. This is abi encoded and totally depends on the collect module chosen.
* @param referenceModule The reference module set for this publication.
* @param referenceModuleReturnData The data returned from the reference module at initialization. This is abi
* encoded and totally depends on the reference module chosen.
* @param timestamp The current block timestamp.
*/
event PostCreated(
uint256 indexed profileId,
uint256 indexed pubId,
string contentURI,
address collectModule,
bytes collectModuleReturnData,
address referenceModule,
bytes referenceModuleReturnData,
uint256 timestamp
);
/**
* @dev Emitted when a "comment" is published.
*
* @param profileId The profile's token ID.
* @param pubId The new publication's ID.
* @param contentURI The URI mapped to this new publication.
* @param profileIdPointed The profile token ID that this comment points to.
* @param pubIdPointed The publication ID that this comment points to.
* @param referenceModuleData The data passed to the reference module.
* @param collectModule The collect module mapped to this new publication. This CANNOT be the zero address.
* @param collectModuleReturnData The data returned from the collect module's initialization for this given
* publication. This is abi encoded and totally depends on the collect module chosen.
* @param referenceModule The reference module set for this publication.
* @param referenceModuleReturnData The data returned from the reference module at initialization. This is abi
* encoded and totally depends on the reference module chosen.
* @param timestamp The current block timestamp.
*/
event CommentCreated(
uint256 indexed profileId,
uint256 indexed pubId,
string contentURI,
uint256 profileIdPointed,
uint256 pubIdPointed,
bytes referenceModuleData,
address collectModule,
bytes collectModuleReturnData,
address referenceModule,
bytes referenceModuleReturnData,
uint256 timestamp
);
/**
* @dev Emitted when a "mirror" is published.
*
* @param profileId The profile's token ID.
* @param pubId The new publication's ID.
* @param profileIdPointed The profile token ID that this mirror points to.
* @param pubIdPointed The publication ID that this mirror points to.
* @param referenceModuleData The data passed to the reference module.
* @param referenceModule The reference module set for this publication.
* @param referenceModuleReturnData The data returned from the reference module at initialization. This is abi
* encoded and totally depends on the reference module chosen.
* @param timestamp The current block timestamp.
*/
event MirrorCreated(
uint256 indexed profileId,
uint256 indexed pubId,
uint256 profileIdPointed,
uint256 pubIdPointed,
bytes referenceModuleData,
address referenceModule,
bytes referenceModuleReturnData,
uint256 timestamp
);
/**
* @dev Emitted when a followNFT clone is deployed using a lazy deployment pattern.
*
* @param profileId The token ID of the profile to which this followNFT is associated.
* @param followNFT The address of the newly deployed followNFT clone.
* @param timestamp The current block timestamp.
*/
event FollowNFTDeployed(
uint256 indexed profileId,
address indexed followNFT,
uint256 timestamp
);
/**
* @dev Emitted when a collectNFT clone is deployed using a lazy deployment pattern.
*
* @param profileId The publisher's profile token ID.
* @param pubId The publication associated with the newly deployed collectNFT clone's ID.
* @param collectNFT The address of the newly deployed collectNFT clone.
* @param timestamp The current block timestamp.
*/
event CollectNFTDeployed(
uint256 indexed profileId,
uint256 indexed pubId,
address indexed collectNFT,
uint256 timestamp
);
/**
* @dev Emitted upon a successful collect action.
*
* @param collector The address collecting the publication.
* @param profileId The token ID of the profile that the collect was initiated towards, useful to differentiate mirrors.
* @param pubId The publication ID that the collect was initiated towards, useful to differentiate mirrors.
* @param rootProfileId The profile token ID of the profile whose publication is being collected.
* @param rootPubId The publication ID of the publication being collected.
* @param collectModuleData The data passed to the collect module.
* @param timestamp The current block timestamp.
*/
event Collected(
address indexed collector,
uint256 indexed profileId,
uint256 indexed pubId,
uint256 rootProfileId,
uint256 rootPubId,
bytes collectModuleData,
uint256 timestamp
);
/**
* @dev Emitted upon a successful follow action.
*
* @param follower The address following the given profiles.
* @param profileIds The token ID array of the profiles being followed.
* @param followModuleDatas The array of data parameters passed to each follow module.
* @param timestamp The current block timestamp.
*/
event Followed(
address indexed follower,
uint256[] profileIds,
bytes[] followModuleDatas,
uint256 timestamp
);
/**
* @dev Emitted via callback when a followNFT is transferred.
*
* @param profileId The token ID of the profile associated with the followNFT being transferred.
* @param followNFTId The followNFT being transferred's token ID.
* @param from The address the followNFT is being transferred from.
* @param to The address the followNFT is being transferred to.
* @param timestamp The current block timestamp.
*/
event FollowNFTTransferred(
uint256 indexed profileId,
uint256 indexed followNFTId,
address from,
address to,
uint256 timestamp
);
/**
* @dev Emitted via callback when a collectNFT is transferred.
*
* @param profileId The token ID of the profile associated with the collectNFT being transferred.
* @param pubId The publication ID associated with the collectNFT being transferred.
* @param collectNFTId The collectNFT being transferred's token ID.
* @param from The address the collectNFT is being transferred from.
* @param to The address the collectNFT is being transferred to.
* @param timestamp The current block timestamp.
*/
event CollectNFTTransferred(
uint256 indexed profileId,
uint256 indexed pubId,
uint256 indexed collectNFTId,
address from,
address to,
uint256 timestamp
);
// Collect/Follow NFT-Specific
/**
* @dev Emitted when a newly deployed follow NFT is initialized.
*
* @param profileId The token ID of the profile connected to this follow NFT.
* @param timestamp The current block timestamp.
*/
event FollowNFTInitialized(uint256 indexed profileId, uint256 timestamp);
/**
* @dev Emitted when delegation power in a FollowNFT is changed.
*
* @param delegate The delegate whose power has been changed.
* @param newPower The new governance power mapped to the delegate.
* @param timestamp The current block timestamp.
*/
event FollowNFTDelegatedPowerChanged(
address indexed delegate,
uint256 indexed newPower,
uint256 timestamp
);
/**
* @dev Emitted when a newly deployed collect NFT is initialized.
*
* @param profileId The token ID of the profile connected to the publication mapped to this collect NFT.
* @param pubId The publication ID connected to the publication mapped to this collect NFT.
* @param timestamp The current block timestamp.
*/
event CollectNFTInitialized(
uint256 indexed profileId,
uint256 indexed pubId,
uint256 timestamp
);
// Module-Specific
/**
* @notice Emitted when the ModuleGlobals governance address is set.
*
* @param prevGovernance The previous governance address.
* @param newGovernance The new governance address set.
* @param timestamp The current block timestamp.
*/
event ModuleGlobalsGovernanceSet(
address indexed prevGovernance,
address indexed newGovernance,
uint256 timestamp
);
/**
* @notice Emitted when the ModuleGlobals treasury address is set.
*
* @param prevTreasury The previous treasury address.
* @param newTreasury The new treasury address set.
* @param timestamp The current block timestamp.
*/
event ModuleGlobalsTreasurySet(
address indexed prevTreasury,
address indexed newTreasury,
uint256 timestamp
);
/**
* @notice Emitted when the ModuleGlobals treasury fee is set.
*
* @param prevTreasuryFee The previous treasury fee in BPS.
* @param newTreasuryFee The new treasury fee in BPS.
* @param timestamp The current block timestamp.
*/
event ModuleGlobalsTreasuryFeeSet(
uint16 indexed prevTreasuryFee,
uint16 indexed newTreasuryFee,
uint256 timestamp
);
/**
* @notice Emitted when a currency is added to or removed from the ModuleGlobals whitelist.
*
* @param currency The currency address.
* @param prevWhitelisted Whether or not the currency was previously whitelisted.
* @param whitelisted Whether or not the currency is whitelisted.
* @param timestamp The current block timestamp.
*/
event ModuleGlobalsCurrencyWhitelisted(
address indexed currency,
bool indexed prevWhitelisted,
bool indexed whitelisted,
uint256 timestamp
);
/**
* @notice Emitted when a module inheriting from the `FeeModuleBase` is constructed.
*
* @param moduleGlobals The ModuleGlobals contract address used.
* @param timestamp The current block timestamp.
*/
event FeeModuleBaseConstructed(address indexed moduleGlobals, uint256 timestamp);
/**
* @notice Emitted when a module inheriting from the `ModuleBase` is constructed.
*
* @param hub The LensHub contract address used.
* @param timestamp The current block timestamp.
*/
event ModuleBaseConstructed(address indexed hub, uint256 timestamp);
/**
* @notice Emitted when one or multiple addresses are approved (or disapproved) for following in
* the `ApprovalFollowModule`.
*
* @param owner The profile owner who executed the approval.
* @param profileId The profile ID that the follow approvals are granted/revoked for.
* @param addresses The addresses that have had the follow approvals grnated/revoked.
* @param approved Whether each corresponding address is now approved or disapproved.
* @param timestamp The current block timestamp.
*/
event FollowsApproved(
address indexed owner,
uint256 indexed profileId,
address[] addresses,
bool[] approved,
uint256 timestamp
);
/**
* @dev Emitted when the user wants to enable or disable follows in the `LensPeriphery`.
*
* @param owner The profile owner who executed the toggle.
* @param profileIds The array of token IDs of the profiles each followNFT is associated with.
* @param enabled The array of whether each FollowNFT's follow is enabled/disabled.
* @param timestamp The current block timestamp.
*/
event FollowsToggled(
address indexed owner,
uint256[] profileIds,
bool[] enabled,
uint256 timestamp
);
event bigint (
uint256 number
);
}