@rev-net/core-v6 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/SKILLS.md +1 -1
  2. package/docs/book.toml +1 -1
  3. package/docs/src/README.md +151 -54
  4. package/docs/src/SUMMARY.md +0 -2
  5. package/docs/src/src/REVDeployer.sol/contract.REVDeployer.md +148 -117
  6. package/docs/src/src/REVLoans.sol/contract.REVLoans.md +120 -59
  7. package/docs/src/src/interfaces/IREVDeployer.sol/interface.IREVDeployer.md +296 -14
  8. package/docs/src/src/interfaces/IREVLoans.sol/interface.IREVLoans.md +318 -16
  9. package/docs/src/src/structs/README.md +0 -2
  10. package/docs/src/src/structs/REVAutoIssuance.sol/struct.REVAutoIssuance.md +4 -4
  11. package/docs/src/src/structs/REVConfig.sol/struct.REVConfig.md +5 -17
  12. package/docs/src/src/structs/REVCroptopAllowedPost.sol/struct.REVCroptopAllowedPost.md +10 -6
  13. package/docs/src/src/structs/REVDeploy721TiersHookConfig.sol/struct.REVDeploy721TiersHookConfig.md +7 -7
  14. package/docs/src/src/structs/REVDescription.sol/struct.REVDescription.md +5 -5
  15. package/docs/src/src/structs/REVLoan.sol/struct.REVLoan.md +7 -7
  16. package/docs/src/src/structs/REVLoanSource.sol/struct.REVLoanSource.md +3 -3
  17. package/docs/src/src/structs/REVStageConfig.sol/struct.REVStageConfig.md +10 -10
  18. package/docs/src/src/structs/REVSuckerDeploymentConfig.sol/struct.REVSuckerDeploymentConfig.md +3 -3
  19. package/package.json +6 -6
  20. package/slither-ci.config.json +1 -1
  21. package/src/REVLoans.sol +20 -9
  22. package/src/interfaces/IREVDeployer.sol +0 -2
  23. package/src/interfaces/IREVLoans.sol +10 -4
  24. package/test/TestPR27_CEIPattern.t.sol +2 -2
  25. package/test/TestPR32_MixedFixes.t.sol +1 -1
  26. package/test/regression/TestI20_CumulativeLoanCounter.t.sol +303 -0
  27. package/test/regression/TestL27_LiquidateGapHandling.t.sol +334 -0
@@ -1,101 +1,266 @@
1
1
  # IREVDeployer
2
- [Git Source](https://github.com/rev-net/revnet-core-v5/blob/364afaae78a8f60af2b98252dc96af1c2e4760d3/src/interfaces/IREVDeployer.sol)
2
+ [Git Source](https://github.com/rev-net/revnet-core-v6/blob/94c003a3a16de2bd012d63cccedd6bd38d21f6e7/src/interfaces/IREVDeployer.sol)
3
3
 
4
4
 
5
5
  ## Functions
6
6
  ### CASH_OUT_DELAY
7
7
 
8
+ The number of seconds until a revnet's participants can cash out after deploying to a new network.
9
+
8
10
 
9
11
  ```solidity
10
12
  function CASH_OUT_DELAY() external view returns (uint256);
11
13
  ```
14
+ **Returns**
15
+
16
+ |Name|Type|Description|
17
+ |----|----|-----------|
18
+ |`<none>`|`uint256`|The cash out delay in seconds.|
19
+
12
20
 
13
21
  ### CONTROLLER
14
22
 
23
+ The controller used to create and manage Juicebox projects for revnets.
24
+
15
25
 
16
26
  ```solidity
17
27
  function CONTROLLER() external view returns (IJBController);
18
28
  ```
29
+ **Returns**
30
+
31
+ |Name|Type|Description|
32
+ |----|----|-----------|
33
+ |`<none>`|`IJBController`|The controller contract.|
34
+
19
35
 
20
36
  ### DIRECTORY
21
37
 
38
+ The directory of terminals and controllers for Juicebox projects.
39
+
22
40
 
23
41
  ```solidity
24
42
  function DIRECTORY() external view returns (IJBDirectory);
25
43
  ```
44
+ **Returns**
45
+
46
+ |Name|Type|Description|
47
+ |----|----|-----------|
48
+ |`<none>`|`IJBDirectory`|The directory contract.|
49
+
26
50
 
27
51
  ### PROJECTS
28
52
 
53
+ The contract that mints ERC-721s representing project ownership.
54
+
29
55
 
30
56
  ```solidity
31
57
  function PROJECTS() external view returns (IJBProjects);
32
58
  ```
59
+ **Returns**
60
+
61
+ |Name|Type|Description|
62
+ |----|----|-----------|
63
+ |`<none>`|`IJBProjects`|The projects contract.|
64
+
33
65
 
34
66
  ### PERMISSIONS
35
67
 
68
+ The contract that stores Juicebox project access permissions.
69
+
36
70
 
37
71
  ```solidity
38
72
  function PERMISSIONS() external view returns (IJBPermissions);
39
73
  ```
74
+ **Returns**
75
+
76
+ |Name|Type|Description|
77
+ |----|----|-----------|
78
+ |`<none>`|`IJBPermissions`|The permissions contract.|
79
+
40
80
 
41
81
  ### FEE
42
82
 
83
+ The cash out fee as a fraction out of `JBConstants.MAX_FEE`.
84
+
43
85
 
44
86
  ```solidity
45
87
  function FEE() external view returns (uint256);
46
88
  ```
89
+ **Returns**
90
+
91
+ |Name|Type|Description|
92
+ |----|----|-----------|
93
+ |`<none>`|`uint256`|The fee value.|
94
+
95
+
96
+ ### DEFAULT_BUYBACK_POOL_FEE
97
+
98
+ The default Uniswap pool fee tier for auto-configured buyback pools.
99
+
100
+
101
+ ```solidity
102
+ function DEFAULT_BUYBACK_POOL_FEE() external view returns (uint24);
103
+ ```
104
+ **Returns**
105
+
106
+ |Name|Type|Description|
107
+ |----|----|-----------|
108
+ |`<none>`|`uint24`|The fee tier (10_000 = 1%).|
109
+
110
+
111
+ ### DEFAULT_BUYBACK_TWAP_WINDOW
112
+
113
+ The default TWAP window for auto-configured buyback pools.
114
+
115
+
116
+ ```solidity
117
+ function DEFAULT_BUYBACK_TWAP_WINDOW() external view returns (uint32);
118
+ ```
119
+ **Returns**
120
+
121
+ |Name|Type|Description|
122
+ |----|----|-----------|
123
+ |`<none>`|`uint32`|The TWAP window in seconds.|
124
+
47
125
 
48
126
  ### SUCKER_REGISTRY
49
127
 
128
+ The registry that deploys and tracks suckers for revnets.
129
+
50
130
 
51
131
  ```solidity
52
132
  function SUCKER_REGISTRY() external view returns (IJBSuckerRegistry);
53
133
  ```
134
+ **Returns**
135
+
136
+ |Name|Type|Description|
137
+ |----|----|-----------|
138
+ |`<none>`|`IJBSuckerRegistry`|The sucker registry contract.|
139
+
54
140
 
55
141
  ### FEE_REVNET_ID
56
142
 
143
+ The Juicebox project ID of the revnet that receives cash out fees.
144
+
57
145
 
58
146
  ```solidity
59
147
  function FEE_REVNET_ID() external view returns (uint256);
60
148
  ```
149
+ **Returns**
150
+
151
+ |Name|Type|Description|
152
+ |----|----|-----------|
153
+ |`<none>`|`uint256`|The fee revnet ID.|
154
+
61
155
 
62
156
  ### PUBLISHER
63
157
 
158
+ The croptop publisher revnets can use to publish ERC-721 posts to their tiered ERC-721 hooks.
159
+
64
160
 
65
161
  ```solidity
66
162
  function PUBLISHER() external view returns (CTPublisher);
67
163
  ```
164
+ **Returns**
165
+
166
+ |Name|Type|Description|
167
+ |----|----|-----------|
168
+ |`<none>`|`CTPublisher`|The publisher contract.|
169
+
170
+
171
+ ### BUYBACK_HOOK
172
+
173
+ The buyback hook used as a data hook to route payments through buyback pools.
174
+
175
+
176
+ ```solidity
177
+ function BUYBACK_HOOK() external view returns (IJBRulesetDataHook);
178
+ ```
179
+ **Returns**
180
+
181
+ |Name|Type|Description|
182
+ |----|----|-----------|
183
+ |`<none>`|`IJBRulesetDataHook`|The buyback hook contract.|
184
+
68
185
 
69
186
  ### HOOK_DEPLOYER
70
187
 
188
+ The deployer used to create tiered ERC-721 hooks for revnets.
189
+
71
190
 
72
191
  ```solidity
73
192
  function HOOK_DEPLOYER() external view returns (IJB721TiersHookDeployer);
74
193
  ```
194
+ **Returns**
195
+
196
+ |Name|Type|Description|
197
+ |----|----|-----------|
198
+ |`<none>`|`IJB721TiersHookDeployer`|The hook deployer contract.|
75
199
 
76
- ### amountToAutoIssue
200
+
201
+ ### LOANS
202
+
203
+ The loan contract used by all revnets.
77
204
 
78
205
 
79
206
  ```solidity
80
- function amountToAutoIssue(uint256 revnetId, uint256 stageId, address beneficiary) external view returns (uint256);
207
+ function LOANS() external view returns (address);
81
208
  ```
209
+ **Returns**
82
210
 
83
- ### buybackHookOf
211
+ |Name|Type|Description|
212
+ |----|----|-----------|
213
+ |`<none>`|`address`|The loans contract address.|
214
+
215
+
216
+ ### amountToAutoIssue
217
+
218
+ The number of revnet tokens that can be auto-minted for a beneficiary during a stage.
84
219
 
85
220
 
86
221
  ```solidity
87
- function buybackHookOf(uint256 revnetId) external view returns (IJBRulesetDataHook);
222
+ function amountToAutoIssue(uint256 revnetId, uint256 stageId, address beneficiary) external view returns (uint256);
88
223
  ```
224
+ **Parameters**
225
+
226
+ |Name|Type|Description|
227
+ |----|----|-----------|
228
+ |`revnetId`|`uint256`|The ID of the revnet.|
229
+ |`stageId`|`uint256`|The ID of the stage.|
230
+ |`beneficiary`|`address`|The beneficiary of the auto-mint.|
231
+
232
+ **Returns**
233
+
234
+ |Name|Type|Description|
235
+ |----|----|-----------|
236
+ |`<none>`|`uint256`|The number of tokens available to auto-issue.|
237
+
89
238
 
90
239
  ### cashOutDelayOf
91
240
 
241
+ The timestamp when cash outs become available for a revnet's participants.
242
+
92
243
 
93
244
  ```solidity
94
245
  function cashOutDelayOf(uint256 revnetId) external view returns (uint256);
95
246
  ```
247
+ **Parameters**
248
+
249
+ |Name|Type|Description|
250
+ |----|----|-----------|
251
+ |`revnetId`|`uint256`|The ID of the revnet.|
252
+
253
+ **Returns**
254
+
255
+ |Name|Type|Description|
256
+ |----|----|-----------|
257
+ |`<none>`|`uint256`|The cash out delay timestamp.|
258
+
96
259
 
97
260
  ### deploySuckersFor
98
261
 
262
+ Deploy new suckers for an existing revnet.
263
+
99
264
 
100
265
  ```solidity
101
266
  function deploySuckersFor(
@@ -105,66 +270,142 @@ function deploySuckersFor(
105
270
  external
106
271
  returns (address[] memory suckers);
107
272
  ```
273
+ **Parameters**
274
+
275
+ |Name|Type|Description|
276
+ |----|----|-----------|
277
+ |`revnetId`|`uint256`|The ID of the revnet to deploy suckers for.|
278
+ |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet.|
279
+
280
+ **Returns**
281
+
282
+ |Name|Type|Description|
283
+ |----|----|-----------|
284
+ |`suckers`|`address[]`|The addresses of the deployed suckers.|
285
+
108
286
 
109
287
  ### hashedEncodedConfigurationOf
110
288
 
289
+ The hashed encoded configuration of each revnet.
290
+
111
291
 
112
292
  ```solidity
113
293
  function hashedEncodedConfigurationOf(uint256 revnetId) external view returns (bytes32);
114
294
  ```
295
+ **Parameters**
296
+
297
+ |Name|Type|Description|
298
+ |----|----|-----------|
299
+ |`revnetId`|`uint256`|The ID of the revnet.|
300
+
301
+ **Returns**
302
+
303
+ |Name|Type|Description|
304
+ |----|----|-----------|
305
+ |`<none>`|`bytes32`|The hashed encoded configuration.|
306
+
115
307
 
116
308
  ### isSplitOperatorOf
117
309
 
310
+ Whether an address is a revnet's split operator.
311
+
118
312
 
119
313
  ```solidity
120
314
  function isSplitOperatorOf(uint256 revnetId, address addr) external view returns (bool);
121
315
  ```
316
+ **Parameters**
122
317
 
123
- ### loansOf
318
+ |Name|Type|Description|
319
+ |----|----|-----------|
320
+ |`revnetId`|`uint256`|The ID of the revnet.|
321
+ |`addr`|`address`|The address to check.|
124
322
 
323
+ **Returns**
324
+
325
+ |Name|Type|Description|
326
+ |----|----|-----------|
327
+ |`<none>`|`bool`|A flag indicating whether the address is the revnet's split operator.|
125
328
 
126
- ```solidity
127
- function loansOf(uint256 revnetId) external view returns (address);
128
- ```
129
329
 
130
330
  ### tiered721HookOf
131
331
 
332
+ Each revnet's tiered ERC-721 hook.
333
+
132
334
 
133
335
  ```solidity
134
336
  function tiered721HookOf(uint256 revnetId) external view returns (IJB721TiersHook);
135
337
  ```
338
+ **Parameters**
339
+
340
+ |Name|Type|Description|
341
+ |----|----|-----------|
342
+ |`revnetId`|`uint256`|The ID of the revnet.|
343
+
344
+ **Returns**
345
+
346
+ |Name|Type|Description|
347
+ |----|----|-----------|
348
+ |`<none>`|`IJB721TiersHook`|The tiered ERC-721 hook.|
349
+
136
350
 
137
351
  ### autoIssueFor
138
352
 
353
+ Auto-mint a revnet's tokens from a stage for a beneficiary.
354
+
139
355
 
140
356
  ```solidity
141
357
  function autoIssueFor(uint256 revnetId, uint256 stageId, address beneficiary) external;
142
358
  ```
359
+ **Parameters**
360
+
361
+ |Name|Type|Description|
362
+ |----|----|-----------|
363
+ |`revnetId`|`uint256`|The ID of the revnet to auto-mint tokens from.|
364
+ |`stageId`|`uint256`|The ID of the stage auto-mint tokens are available from.|
365
+ |`beneficiary`|`address`|The address to auto-mint tokens to.|
366
+
143
367
 
144
368
  ### deployFor
145
369
 
370
+ Deploy a revnet, or initialize an existing Juicebox project as a revnet.
371
+
146
372
 
147
373
  ```solidity
148
374
  function deployFor(
149
375
  uint256 revnetId,
150
376
  REVConfig memory configuration,
151
377
  JBTerminalConfig[] memory terminalConfigurations,
152
- REVBuybackHookConfig memory buybackHookConfiguration,
153
378
  REVSuckerDeploymentConfig memory suckerDeploymentConfiguration
154
379
  )
155
380
  external
156
381
  returns (uint256);
157
382
  ```
383
+ **Parameters**
384
+
385
+ |Name|Type|Description|
386
+ |----|----|-----------|
387
+ |`revnetId`|`uint256`|The ID of the Juicebox project to initialize. Send 0 to deploy a new revnet.|
388
+ |`configuration`|`REVConfig`|Core revnet configuration.|
389
+ |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet.|
390
+ |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for cross-chain token transfers.|
391
+
392
+ **Returns**
393
+
394
+ |Name|Type|Description|
395
+ |----|----|-----------|
396
+ |`<none>`|`uint256`|The ID of the newly created or initialized revnet.|
397
+
158
398
 
159
399
  ### deployWith721sFor
160
400
 
401
+ Deploy a revnet with tiered ERC-721s and optional croptop posting support.
402
+
161
403
 
162
404
  ```solidity
163
405
  function deployWith721sFor(
164
406
  uint256 revnetId,
165
407
  REVConfig calldata configuration,
166
408
  JBTerminalConfig[] memory terminalConfigurations,
167
- REVBuybackHookConfig memory buybackHookConfiguration,
168
409
  REVSuckerDeploymentConfig memory suckerDeploymentConfiguration,
169
410
  REVDeploy721TiersHookConfig memory tiered721HookConfiguration,
170
411
  REVCroptopAllowedPost[] memory allowedPosts
@@ -172,13 +413,55 @@ function deployWith721sFor(
172
413
  external
173
414
  returns (uint256, IJB721TiersHook hook);
174
415
  ```
416
+ **Parameters**
417
+
418
+ |Name|Type|Description|
419
+ |----|----|-----------|
420
+ |`revnetId`|`uint256`|The ID of the Juicebox project to initialize. Send 0 to deploy a new revnet.|
421
+ |`configuration`|`REVConfig`|Core revnet configuration.|
422
+ |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet.|
423
+ |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for cross-chain token transfers.|
424
+ |`tiered721HookConfiguration`|`REVDeploy721TiersHookConfig`|How to set up the tiered ERC-721 hook.|
425
+ |`allowedPosts`|`REVCroptopAllowedPost[]`|Restrictions on which croptop posts are allowed on the revnet's ERC-721 tiers.|
426
+
427
+ **Returns**
428
+
429
+ |Name|Type|Description|
430
+ |----|----|-----------|
431
+ |`<none>`|`uint256`|The ID of the newly created or initialized revnet.|
432
+ |`hook`|`IJB721TiersHook`|The tiered ERC-721 hook that was deployed for the revnet.|
433
+
175
434
 
176
435
  ### setSplitOperatorOf
177
436
 
437
+ Change a revnet's split operator. Only the current split operator can call this.
438
+
178
439
 
179
440
  ```solidity
180
441
  function setSplitOperatorOf(uint256 revnetId, address newSplitOperator) external;
181
442
  ```
443
+ **Parameters**
444
+
445
+ |Name|Type|Description|
446
+ |----|----|-----------|
447
+ |`revnetId`|`uint256`|The ID of the revnet.|
448
+ |`newSplitOperator`|`address`|The new split operator's address.|
449
+
450
+
451
+ ### burnHeldTokensOf
452
+
453
+ Burn any of a revnet's tokens held by this contract.
454
+
455
+
456
+ ```solidity
457
+ function burnHeldTokensOf(uint256 revnetId) external;
458
+ ```
459
+ **Parameters**
460
+
461
+ |Name|Type|Description|
462
+ |----|----|-----------|
463
+ |`revnetId`|`uint256`|The ID of the revnet whose tokens should be burned.|
464
+
182
465
 
183
466
  ## Events
184
467
  ### ReplaceSplitOperator
@@ -205,7 +488,6 @@ event DeployRevnet(
205
488
  uint256 indexed revnetId,
206
489
  REVConfig configuration,
207
490
  JBTerminalConfig[] terminalConfigurations,
208
- REVBuybackHookConfig buybackHookConfiguration,
209
491
  REVSuckerDeploymentConfig suckerDeploymentConfiguration,
210
492
  JBRulesetConfig[] rulesetConfigurations,
211
493
  bytes32 encodedConfigurationHash,
@@ -235,9 +517,9 @@ event StoreAutoIssuanceAmount(
235
517
  );
236
518
  ```
237
519
 
238
- ### SetAdditionalOperator
520
+ ### BurnHeldTokens
239
521
 
240
522
  ```solidity
241
- event SetAdditionalOperator(uint256 revnetId, address additionalOperator, uint256[] permissionIds, address caller);
523
+ event BurnHeldTokens(uint256 indexed revnetId, uint256 count, address caller);
242
524
  ```
243
525