@rev-net/core-v6 0.0.13 → 0.0.14

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 (41) hide show
  1. package/CHANGE_LOG.md +8 -3
  2. package/package.json +1 -1
  3. package/deployments/revnet-core-v5/arbitrum/REVDeployer.json +0 -2821
  4. package/deployments/revnet-core-v5/arbitrum/REVLoans.json +0 -2260
  5. package/deployments/revnet-core-v5/arbitrum_sepolia/REVDeployer.json +0 -2821
  6. package/deployments/revnet-core-v5/arbitrum_sepolia/REVLoans.json +0 -2260
  7. package/deployments/revnet-core-v5/base/REVDeployer.json +0 -2825
  8. package/deployments/revnet-core-v5/base/REVLoans.json +0 -2264
  9. package/deployments/revnet-core-v5/base_sepolia/REVDeployer.json +0 -2825
  10. package/deployments/revnet-core-v5/base_sepolia/REVLoans.json +0 -2264
  11. package/deployments/revnet-core-v5/ethereum/REVDeployer.json +0 -2825
  12. package/deployments/revnet-core-v5/ethereum/REVLoans.json +0 -2264
  13. package/deployments/revnet-core-v5/optimism/REVDeployer.json +0 -2821
  14. package/deployments/revnet-core-v5/optimism/REVLoans.json +0 -2260
  15. package/deployments/revnet-core-v5/optimism_sepolia/REVDeployer.json +0 -2825
  16. package/deployments/revnet-core-v5/optimism_sepolia/REVLoans.json +0 -2264
  17. package/deployments/revnet-core-v5/sepolia/REVDeployer.json +0 -2825
  18. package/deployments/revnet-core-v5/sepolia/REVLoans.json +0 -2264
  19. package/docs/book.css +0 -13
  20. package/docs/book.toml +0 -13
  21. package/docs/solidity.min.js +0 -74
  22. package/docs/src/README.md +0 -185
  23. package/docs/src/SUMMARY.md +0 -18
  24. package/docs/src/src/README.md +0 -7
  25. package/docs/src/src/REVDeployer.sol/contract.REVDeployer.md +0 -999
  26. package/docs/src/src/REVLoans.sol/contract.REVLoans.md +0 -1108
  27. package/docs/src/src/interfaces/IREVDeployer.sol/interface.IREVDeployer.md +0 -525
  28. package/docs/src/src/interfaces/IREVLoans.sol/interface.IREVLoans.md +0 -598
  29. package/docs/src/src/interfaces/README.md +0 -5
  30. package/docs/src/src/structs/README.md +0 -12
  31. package/docs/src/src/structs/REVAutoIssuance.sol/struct.REVAutoIssuance.md +0 -19
  32. package/docs/src/src/structs/REVBuybackHookConfig.sol/struct.REVBuybackHookConfig.md +0 -19
  33. package/docs/src/src/structs/REVBuybackPoolConfig.sol/struct.REVBuybackPoolConfig.md +0 -21
  34. package/docs/src/src/structs/REVConfig.sol/struct.REVConfig.md +0 -23
  35. package/docs/src/src/structs/REVCroptopAllowedPost.sol/struct.REVCroptopAllowedPost.md +0 -32
  36. package/docs/src/src/structs/REVDeploy721TiersHookConfig.sol/struct.REVDeploy721TiersHookConfig.md +0 -34
  37. package/docs/src/src/structs/REVDescription.sol/struct.REVDescription.md +0 -23
  38. package/docs/src/src/structs/REVLoan.sol/struct.REVLoan.md +0 -28
  39. package/docs/src/src/structs/REVLoanSource.sol/struct.REVLoanSource.md +0 -16
  40. package/docs/src/src/structs/REVStageConfig.sol/struct.REVStageConfig.md +0 -44
  41. package/docs/src/src/structs/REVSuckerDeploymentConfig.sol/struct.REVSuckerDeploymentConfig.md +0 -16
@@ -1,999 +0,0 @@
1
- # REVDeployer
2
- [Git Source](https://github.com/rev-net/revnet-core-v6/blob/94c003a3a16de2bd012d63cccedd6bd38d21f6e7/src/REVDeployer.sol)
3
-
4
- **Inherits:**
5
- ERC2771Context, [IREVDeployer](/src/interfaces/IREVDeployer.sol/interface.IREVDeployer.md), IJBRulesetDataHook, IJBCashOutHook, IERC721Receiver
6
-
7
- `REVDeployer` deploys, manages, and operates Revnets.
8
-
9
- Revnets are unowned Juicebox projects which operate autonomously after deployment.
10
-
11
-
12
- ## State Variables
13
- ### CASH_OUT_DELAY
14
- The number of seconds until a revnet's participants can cash out, starting from the time when that
15
- revnet is deployed to a new network.
16
- - Only applies to existing revnets which are deploying onto a new network.
17
- - To prevent liquidity/arbitrage issues which might arise when an existing revnet adds a brand-new treasury.
18
-
19
- 30 days, in seconds.
20
-
21
-
22
- ```solidity
23
- uint256 public constant override CASH_OUT_DELAY = 2_592_000
24
- ```
25
-
26
-
27
- ### FEE
28
- The cash out fee (as a fraction out of `JBConstants.MAX_FEE`).
29
- Cashout fees are paid to the revnet with the `FEE_REVNET_ID`.
30
-
31
- Fees are charged on cashouts if the cash out tax rate is greater than 0%.
32
-
33
- When suckers withdraw funds, they do not pay cash out fees.
34
-
35
-
36
- ```solidity
37
- uint256 public constant override FEE = 25
38
- ```
39
-
40
-
41
- ### DEFAULT_BUYBACK_POOL_FEE
42
- The default Uniswap pool fee tier used when auto-configuring buyback pools.
43
-
44
- 10_000 = 1%. This is the standard fee tier for most project token pairs.
45
-
46
-
47
- ```solidity
48
- uint24 public constant DEFAULT_BUYBACK_POOL_FEE = 10_000
49
- ```
50
-
51
-
52
- ### DEFAULT_BUYBACK_TWAP_WINDOW
53
- The default TWAP window used when auto-configuring buyback pools.
54
-
55
- 2 days provides robust manipulation resistance.
56
-
57
-
58
- ```solidity
59
- uint32 public constant DEFAULT_BUYBACK_TWAP_WINDOW = 2 days
60
- ```
61
-
62
-
63
- ### BUYBACK_HOOK
64
- The buyback hook used as a data hook to route payments through buyback pools.
65
-
66
-
67
- ```solidity
68
- IJBRulesetDataHook public immutable override BUYBACK_HOOK
69
- ```
70
-
71
-
72
- ### CONTROLLER
73
- The controller used to create and manage Juicebox projects for revnets.
74
-
75
-
76
- ```solidity
77
- IJBController public immutable override CONTROLLER
78
- ```
79
-
80
-
81
- ### DIRECTORY
82
- The directory of terminals and controllers for Juicebox projects (and revnets).
83
-
84
-
85
- ```solidity
86
- IJBDirectory public immutable override DIRECTORY
87
- ```
88
-
89
-
90
- ### FEE_REVNET_ID
91
- The Juicebox project ID of the revnet that receives cash out fees.
92
-
93
-
94
- ```solidity
95
- uint256 public immutable override FEE_REVNET_ID
96
- ```
97
-
98
-
99
- ### HOOK_DEPLOYER
100
- Deploys tiered ERC-721 hooks for revnets.
101
-
102
-
103
- ```solidity
104
- IJB721TiersHookDeployer public immutable override HOOK_DEPLOYER
105
- ```
106
-
107
-
108
- ### LOANS
109
- The loan contract used by all revnets.
110
-
111
- Revnets can offer loans to their participants, collateralized by their tokens.
112
- Participants can borrow up to the current cash out value of their tokens.
113
-
114
-
115
- ```solidity
116
- address public immutable override LOANS
117
- ```
118
-
119
-
120
- ### PERMISSIONS
121
- Stores Juicebox project (and revnet) access permissions.
122
-
123
-
124
- ```solidity
125
- IJBPermissions public immutable override PERMISSIONS
126
- ```
127
-
128
-
129
- ### PROJECTS
130
- Mints ERC-721s that represent Juicebox project (and revnet) ownership and transfers.
131
-
132
-
133
- ```solidity
134
- IJBProjects public immutable override PROJECTS
135
- ```
136
-
137
-
138
- ### PUBLISHER
139
- Manages the publishing of ERC-721 posts to revnet's tiered ERC-721 hooks.
140
-
141
-
142
- ```solidity
143
- CTPublisher public immutable override PUBLISHER
144
- ```
145
-
146
-
147
- ### SUCKER_REGISTRY
148
- Deploys and tracks suckers for revnets.
149
-
150
-
151
- ```solidity
152
- IJBSuckerRegistry public immutable override SUCKER_REGISTRY
153
- ```
154
-
155
-
156
- ### amountToAutoIssue
157
- The number of revnet tokens which can be "auto-minted" (minted without payments)
158
- for a specific beneficiary during a stage. Think of this as a per-stage premint.
159
-
160
- These tokens can be minted with `autoIssueFor(…)`.
161
-
162
-
163
- ```solidity
164
- mapping(uint256 revnetId => mapping(uint256 stageId => mapping(address beneficiary => uint256)))
165
- public
166
- override amountToAutoIssue
167
- ```
168
-
169
-
170
- ### cashOutDelayOf
171
- The timestamp of when cashouts will become available to a specific revnet's participants.
172
-
173
- Only applies to existing revnets which are deploying onto a new network.
174
-
175
-
176
- ```solidity
177
- mapping(uint256 revnetId => uint256 cashOutDelay) public override cashOutDelayOf
178
- ```
179
-
180
-
181
- ### hashedEncodedConfigurationOf
182
- The hashed encoded configuration of each revnet.
183
-
184
- This is used to ensure that the encoded configuration of a revnet is the same when deploying suckers for
185
- omnichain operations.
186
-
187
-
188
- ```solidity
189
- mapping(uint256 revnetId => bytes32 hashedEncodedConfiguration) public override hashedEncodedConfigurationOf
190
- ```
191
-
192
-
193
- ### tiered721HookOf
194
- Each revnet's tiered ERC-721 hook.
195
-
196
-
197
- ```solidity
198
- mapping(uint256 revnetId => IJB721TiersHook tiered721Hook) public override tiered721HookOf
199
- ```
200
-
201
-
202
- ### _extraOperatorPermissions
203
- A list of `JBPermissonIds` indices to grant to the split operator of a specific revnet.
204
-
205
- These should be set in the revnet's deployment process.
206
-
207
-
208
- ```solidity
209
- mapping(uint256 revnetId => uint256[]) internal _extraOperatorPermissions
210
- ```
211
-
212
-
213
- ## Functions
214
- ### constructor
215
-
216
-
217
- ```solidity
218
- constructor(
219
- IJBController controller,
220
- IJBSuckerRegistry suckerRegistry,
221
- uint256 feeRevnetId,
222
- IJB721TiersHookDeployer hookDeployer,
223
- CTPublisher publisher,
224
- IJBRulesetDataHook buybackHook,
225
- address loans,
226
- address trustedForwarder
227
- )
228
- ERC2771Context(trustedForwarder);
229
- ```
230
- **Parameters**
231
-
232
- |Name|Type|Description|
233
- |----|----|-----------|
234
- |`controller`|`IJBController`|The controller to use for launching and operating the Juicebox projects which will be revnets.|
235
- |`suckerRegistry`|`IJBSuckerRegistry`|The registry to use for deploying and tracking each revnet's suckers.|
236
- |`feeRevnetId`|`uint256`|The Juicebox project ID of the revnet that will receive fees.|
237
- |`hookDeployer`|`IJB721TiersHookDeployer`|The deployer to use for revnet's tiered ERC-721 hooks.|
238
- |`publisher`|`CTPublisher`|The croptop publisher revnets can use to publish ERC-721 posts to their tiered ERC-721 hooks.|
239
- |`buybackHook`|`IJBRulesetDataHook`|The buyback hook used as a data hook to route payments through buyback pools.|
240
- |`loans`|`address`|The loan contract used by all revnets.|
241
- |`trustedForwarder`|`address`|The trusted forwarder for the ERC2771Context.|
242
-
243
-
244
- ### beforePayRecordedWith
245
-
246
- Before a revnet processes an incoming payment, determine the weight and pay hooks to use.
247
-
248
- This function is part of `IJBRulesetDataHook`, and gets called before the revnet processes a payment.
249
-
250
-
251
- ```solidity
252
- function beforePayRecordedWith(JBBeforePayRecordedContext calldata context)
253
- external
254
- view
255
- override
256
- returns (uint256 weight, JBPayHookSpecification[] memory hookSpecifications);
257
- ```
258
- **Parameters**
259
-
260
- |Name|Type|Description|
261
- |----|----|-----------|
262
- |`context`|`JBBeforePayRecordedContext`|Standard Juicebox payment context. See `JBBeforePayRecordedContext`.|
263
-
264
- **Returns**
265
-
266
- |Name|Type|Description|
267
- |----|----|-----------|
268
- |`weight`|`uint256`|The weight which revnet tokens are minted relative to. This can be used to customize how many tokens get minted by a payment.|
269
- |`hookSpecifications`|`JBPayHookSpecification[]`|Amounts (out of what's being paid in) to be sent to pay hooks instead of being paid into the revnet. Useful for automatically routing funds from a treasury as payments come in.|
270
-
271
-
272
- ### beforeCashOutRecordedWith
273
-
274
- Determine how a cash out from a revnet should be processed.
275
-
276
- This function is part of `IJBRulesetDataHook`, and gets called before the revnet processes a cash out.
277
-
278
- If a sucker is cashing out, no taxes or fees are imposed.
279
-
280
-
281
- ```solidity
282
- function beforeCashOutRecordedWith(JBBeforeCashOutRecordedContext calldata context)
283
- external
284
- view
285
- override
286
- returns (
287
- uint256 cashOutTaxRate,
288
- uint256 cashOutCount,
289
- uint256 totalSupply,
290
- JBCashOutHookSpecification[] memory hookSpecifications
291
- );
292
- ```
293
- **Parameters**
294
-
295
- |Name|Type|Description|
296
- |----|----|-----------|
297
- |`context`|`JBBeforeCashOutRecordedContext`|Standard Juicebox cash out context. See `JBBeforeCashOutRecordedContext`.|
298
-
299
- **Returns**
300
-
301
- |Name|Type|Description|
302
- |----|----|-----------|
303
- |`cashOutTaxRate`|`uint256`|The cash out tax rate, which influences the amount of terminal tokens which get cashed out.|
304
- |`cashOutCount`|`uint256`|The number of revnet tokens that are cashed out.|
305
- |`totalSupply`|`uint256`|The total revnet token supply.|
306
- |`hookSpecifications`|`JBCashOutHookSpecification[]`|The amount of funds and the data to send to cash out hooks (this contract).|
307
-
308
-
309
- ### hasMintPermissionFor
310
-
311
- A flag indicating whether an address has permission to mint a revnet's tokens on-demand.
312
-
313
- Required by the `IJBRulesetDataHook` interface.
314
-
315
-
316
- ```solidity
317
- function hasMintPermissionFor(
318
- uint256 revnetId,
319
- JBRuleset calldata ruleset,
320
- address addr
321
- )
322
- external
323
- view
324
- override
325
- returns (bool);
326
- ```
327
- **Parameters**
328
-
329
- |Name|Type|Description|
330
- |----|----|-----------|
331
- |`revnetId`|`uint256`|The ID of the revnet to check permissions for.|
332
- |`ruleset`|`JBRuleset`|The ruleset to check the mint permission for.|
333
- |`addr`|`address`|The address to check the mint permission of.|
334
-
335
- **Returns**
336
-
337
- |Name|Type|Description|
338
- |----|----|-----------|
339
- |`<none>`|`bool`|flag A flag indicating whether the address has permission to mint the revnet's tokens on-demand.|
340
-
341
-
342
- ### onERC721Received
343
-
344
- Make sure this contract can only receive project NFTs from `JBProjects`.
345
-
346
-
347
- ```solidity
348
- function onERC721Received(address, address, uint256, bytes calldata) external view returns (bytes4);
349
- ```
350
-
351
- ### isSplitOperatorOf
352
-
353
- A flag indicating whether an address is a revnet's split operator.
354
-
355
-
356
- ```solidity
357
- function isSplitOperatorOf(uint256 revnetId, address addr) public view override returns (bool);
358
- ```
359
- **Parameters**
360
-
361
- |Name|Type|Description|
362
- |----|----|-----------|
363
- |`revnetId`|`uint256`|The ID of the revnet.|
364
- |`addr`|`address`|The address to check.|
365
-
366
- **Returns**
367
-
368
- |Name|Type|Description|
369
- |----|----|-----------|
370
- |`<none>`|`bool`|flag A flag indicating whether the address is the revnet's split operator.|
371
-
372
-
373
- ### supportsInterface
374
-
375
- Indicates if this contract adheres to the specified interface.
376
-
377
- See `IERC165.supportsInterface`.
378
-
379
-
380
- ```solidity
381
- function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool);
382
- ```
383
- **Returns**
384
-
385
- |Name|Type|Description|
386
- |----|----|-----------|
387
- |`<none>`|`bool`|A flag indicating if the provided interface ID is supported.|
388
-
389
-
390
- ### _checkIfIsSplitOperatorOf
391
-
392
- If the specified address is not the revnet's current split operator, revert.
393
-
394
-
395
- ```solidity
396
- function _checkIfIsSplitOperatorOf(uint256 revnetId, address operator) internal view;
397
- ```
398
- **Parameters**
399
-
400
- |Name|Type|Description|
401
- |----|----|-----------|
402
- |`revnetId`|`uint256`|The ID of the revnet to check split operator status for.|
403
- |`operator`|`address`|The address being checked.|
404
-
405
-
406
- ### _isSuckerOf
407
-
408
- A flag indicating whether an address is a revnet's sucker.
409
-
410
-
411
- ```solidity
412
- function _isSuckerOf(uint256 revnetId, address addr) internal view returns (bool);
413
- ```
414
- **Parameters**
415
-
416
- |Name|Type|Description|
417
- |----|----|-----------|
418
- |`revnetId`|`uint256`|The ID of the revnet to check sucker status for.|
419
- |`addr`|`address`|The address being checked.|
420
-
421
- **Returns**
422
-
423
- |Name|Type|Description|
424
- |----|----|-----------|
425
- |`<none>`|`bool`|isSucker A flag indicating whether the address is one of the revnet's suckers.|
426
-
427
-
428
- ### _makeLoanFundAccessLimitsAndBuybackPools
429
-
430
- Initialize fund access limits for the loan contract and configure buyback pools for each terminal token.
431
-
432
- Returns an unlimited surplus allowance for each terminal+token pair derived from the terminal
433
- configurations. Also auto-configures a buyback pool for each token with sensible defaults (1% fee, 2-day TWAP).
434
-
435
-
436
- ```solidity
437
- function _makeLoanFundAccessLimitsAndBuybackPools(
438
- uint256 revnetId,
439
- JBTerminalConfig[] calldata terminalConfigurations
440
- )
441
- internal
442
- returns (JBFundAccessLimitGroup[] memory fundAccessLimitGroups);
443
- ```
444
- **Parameters**
445
-
446
- |Name|Type|Description|
447
- |----|----|-----------|
448
- |`revnetId`|`uint256`|The ID of the revnet to configure buyback pools for.|
449
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
450
-
451
- **Returns**
452
-
453
- |Name|Type|Description|
454
- |----|----|-----------|
455
- |`fundAccessLimitGroups`|`JBFundAccessLimitGroup[]`|The fund access limit groups for the loans.|
456
-
457
-
458
- ### _makeRulesetConfiguration
459
-
460
- Make a ruleset configuration for a revnet's stage.
461
-
462
-
463
- ```solidity
464
- function _makeRulesetConfiguration(
465
- uint32 baseCurrency,
466
- REVStageConfig calldata stageConfiguration,
467
- JBFundAccessLimitGroup[] memory fundAccessLimitGroups
468
- )
469
- internal
470
- view
471
- returns (JBRulesetConfig memory);
472
- ```
473
- **Parameters**
474
-
475
- |Name|Type|Description|
476
- |----|----|-----------|
477
- |`baseCurrency`|`uint32`|The base currency of the revnet.|
478
- |`stageConfiguration`|`REVStageConfig`|The stage configuration to make a ruleset for.|
479
- |`fundAccessLimitGroups`|`JBFundAccessLimitGroup[]`|The fund access limit groups to set up for the ruleset.|
480
-
481
- **Returns**
482
-
483
- |Name|Type|Description|
484
- |----|----|-----------|
485
- |`<none>`|`JBRulesetConfig`|rulesetConfiguration The ruleset configuration.|
486
-
487
-
488
- ### _nextProjectId
489
-
490
- Returns the next project ID.
491
-
492
-
493
- ```solidity
494
- function _nextProjectId() internal view returns (uint256);
495
- ```
496
- **Returns**
497
-
498
- |Name|Type|Description|
499
- |----|----|-----------|
500
- |`<none>`|`uint256`|nextProjectId The next project ID.|
501
-
502
-
503
- ### _splitOperatorPermissionIndexesOf
504
-
505
- Returns the permissions that the split operator should be granted for a revnet.
506
-
507
-
508
- ```solidity
509
- function _splitOperatorPermissionIndexesOf(uint256 revnetId)
510
- internal
511
- view
512
- returns (uint256[] memory allOperatorPermissions);
513
- ```
514
- **Parameters**
515
-
516
- |Name|Type|Description|
517
- |----|----|-----------|
518
- |`revnetId`|`uint256`|The ID of the revnet to get split operator permissions for.|
519
-
520
- **Returns**
521
-
522
- |Name|Type|Description|
523
- |----|----|-----------|
524
- |`allOperatorPermissions`|`uint256[]`|The permissions that the split operator should be granted for the revnet, including both default and custom permissions.|
525
-
526
-
527
- ### afterCashOutRecordedWith
528
-
529
- Processes the fee from a cash out.
530
-
531
-
532
- ```solidity
533
- function afterCashOutRecordedWith(JBAfterCashOutRecordedContext calldata context) external payable;
534
- ```
535
- **Parameters**
536
-
537
- |Name|Type|Description|
538
- |----|----|-----------|
539
- |`context`|`JBAfterCashOutRecordedContext`|Cash out context passed in by the terminal.|
540
-
541
-
542
- ### autoIssueFor
543
-
544
- Auto-mint a revnet's tokens from a stage for a beneficiary.
545
-
546
-
547
- ```solidity
548
- function autoIssueFor(uint256 revnetId, uint256 stageId, address beneficiary) external override;
549
- ```
550
- **Parameters**
551
-
552
- |Name|Type|Description|
553
- |----|----|-----------|
554
- |`revnetId`|`uint256`|The ID of the revnet to auto-mint tokens from.|
555
- |`stageId`|`uint256`|The ID of the stage auto-mint tokens are available from.|
556
- |`beneficiary`|`address`|The address to auto-mint tokens to.|
557
-
558
-
559
- ### deployFor
560
-
561
- Launch a revnet, or initialize an existing Juicebox project as a revnet.
562
-
563
- When initializing an existing project (revnetId != 0):
564
- - The project must not yet have a controller or rulesets. `JBController.launchRulesetsFor` enforces this —
565
- it reverts if rulesets have already been launched, and `JBDirectory.setControllerOf` only allows setting the
566
- first controller. This means conversion only works for blank projects (just an ID with no on-chain state).
567
- - This is useful in deploy scripts where the project ID is needed before configuration (e.g. for cross-chain
568
- sucker peer mappings): create the project first, then initialize it as a revnet here.
569
- - Initialization is a one-way operation: the project's ownership NFT is permanently transferred to this
570
- REVDeployer, and the project becomes subject to immutable revnet rules. This cannot be undone.
571
-
572
-
573
- ```solidity
574
- function deployFor(
575
- uint256 revnetId,
576
- REVConfig calldata configuration,
577
- JBTerminalConfig[] calldata terminalConfigurations,
578
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
579
- )
580
- external
581
- override
582
- returns (uint256);
583
- ```
584
- **Parameters**
585
-
586
- |Name|Type|Description|
587
- |----|----|-----------|
588
- |`revnetId`|`uint256`|The ID of the Juicebox project to initialize as a revnet. Send 0 to deploy a new revnet.|
589
- |`configuration`|`REVConfig`|Core revnet configuration. See `REVConfig`.|
590
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
591
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet. Suckers facilitate cross-chain token transfers between peer revnets on different networks.|
592
-
593
- **Returns**
594
-
595
- |Name|Type|Description|
596
- |----|----|-----------|
597
- |`<none>`|`uint256`|revnetId The ID of the newly created revnet.|
598
-
599
-
600
- ### deploySuckersFor
601
-
602
- Deploy new suckers for an existing revnet.
603
-
604
- Only the revnet's split operator can deploy new suckers.
605
-
606
-
607
- ```solidity
608
- function deploySuckersFor(
609
- uint256 revnetId,
610
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
611
- )
612
- external
613
- override
614
- returns (address[] memory suckers);
615
- ```
616
- **Parameters**
617
-
618
- |Name|Type|Description|
619
- |----|----|-----------|
620
- |`revnetId`|`uint256`|The ID of the revnet to deploy suckers for. See `_makeRulesetConfigurations(…)` for encoding details. Clients can read the encoded configuration from the `DeployRevnet` event emitted by this contract.|
621
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet.|
622
-
623
-
624
- ### deployWith721sFor
625
-
626
- Launch a revnet which sells tiered ERC-721s and (optionally) allows croptop posts to its ERC-721 tiers.
627
-
628
- When initializing an existing project (revnetId != 0), the project must be blank (no controller or
629
- rulesets). The initialization is irreversible. See `deployFor` documentation for full details.
630
-
631
-
632
- ```solidity
633
- function deployWith721sFor(
634
- uint256 revnetId,
635
- REVConfig calldata configuration,
636
- JBTerminalConfig[] calldata terminalConfigurations,
637
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration,
638
- REVDeploy721TiersHookConfig calldata tiered721HookConfiguration,
639
- REVCroptopAllowedPost[] calldata allowedPosts
640
- )
641
- external
642
- override
643
- returns (uint256, IJB721TiersHook hook);
644
- ```
645
- **Parameters**
646
-
647
- |Name|Type|Description|
648
- |----|----|-----------|
649
- |`revnetId`|`uint256`|The ID of the Juicebox project to initialize as a revnet. Send 0 to deploy a new revnet.|
650
- |`configuration`|`REVConfig`|Core revnet configuration. See `REVConfig`.|
651
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
652
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet. Suckers facilitate cross-chain token transfers between peer revnets on different networks.|
653
- |`tiered721HookConfiguration`|`REVDeploy721TiersHookConfig`|How to set up the tiered ERC-721 hook for the revnet.|
654
- |`allowedPosts`|`REVCroptopAllowedPost[]`|Restrictions on which croptop posts are allowed on the revnet's ERC-721 tiers.|
655
-
656
- **Returns**
657
-
658
- |Name|Type|Description|
659
- |----|----|-----------|
660
- |`<none>`|`uint256`|revnetId The ID of the newly created revnet.|
661
- |`hook`|`IJB721TiersHook`|The address of the tiered ERC-721 hook that was deployed for the revnet.|
662
-
663
-
664
- ### burnHeldTokensOf
665
-
666
- Burn any of a revnet's tokens held by this contract.
667
-
668
- Project tokens can end up here from reserved token distribution when splits don't sum to 100%.
669
-
670
-
671
- ```solidity
672
- function burnHeldTokensOf(uint256 revnetId) external override;
673
- ```
674
- **Parameters**
675
-
676
- |Name|Type|Description|
677
- |----|----|-----------|
678
- |`revnetId`|`uint256`|The ID of the revnet whose tokens should be burned.|
679
-
680
-
681
- ### setSplitOperatorOf
682
-
683
- Change a revnet's split operator.
684
-
685
- Only a revnet's current split operator can set a new split operator.
686
-
687
-
688
- ```solidity
689
- function setSplitOperatorOf(uint256 revnetId, address newSplitOperator) external override;
690
- ```
691
- **Parameters**
692
-
693
- |Name|Type|Description|
694
- |----|----|-----------|
695
- |`revnetId`|`uint256`|The ID of the revnet to set the split operator of.|
696
- |`newSplitOperator`|`address`|The new split operator's address.|
697
-
698
-
699
- ### _beforeTransferTo
700
-
701
- Logic to be triggered before transferring tokens from this contract.
702
-
703
-
704
- ```solidity
705
- function _beforeTransferTo(address to, address token, uint256 amount) internal returns (uint256);
706
- ```
707
- **Parameters**
708
-
709
- |Name|Type|Description|
710
- |----|----|-----------|
711
- |`to`|`address`|The address the transfer is going to.|
712
- |`token`|`address`|The token being transferred.|
713
- |`amount`|`uint256`|The number of tokens being transferred, as a fixed point number with the same number of decimals as the token specifies.|
714
-
715
- **Returns**
716
-
717
- |Name|Type|Description|
718
- |----|----|-----------|
719
- |`<none>`|`uint256`|payValue The value to attach to the transaction being sent.|
720
-
721
-
722
- ### _deploy721RevnetFor
723
-
724
- Deploy a revnet which sells tiered ERC-721s and (optionally) allows croptop posts to its ERC-721 tiers.
725
-
726
-
727
- ```solidity
728
- function _deploy721RevnetFor(
729
- uint256 revnetId,
730
- bool shouldDeployNewRevnet,
731
- REVConfig calldata configuration,
732
- JBTerminalConfig[] calldata terminalConfigurations,
733
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration,
734
- REVDeploy721TiersHookConfig calldata tiered721HookConfiguration,
735
- REVCroptopAllowedPost[] calldata allowedPosts
736
- )
737
- internal
738
- returns (IJB721TiersHook hook);
739
- ```
740
- **Parameters**
741
-
742
- |Name|Type|Description|
743
- |----|----|-----------|
744
- |`revnetId`|`uint256`|The ID of the Juicebox project to turn into a revnet. Send 0 to deploy a new revnet.|
745
- |`shouldDeployNewRevnet`|`bool`|Whether to deploy a new revnet or convert an existing Juicebox project into a revnet.|
746
- |`configuration`|`REVConfig`|Core revnet configuration. See `REVConfig`.|
747
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
748
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet. Suckers facilitate cross-chain token transfers between peer revnets on different networks.|
749
- |`tiered721HookConfiguration`|`REVDeploy721TiersHookConfig`|How to set up the tiered ERC-721 hook for the revnet.|
750
- |`allowedPosts`|`REVCroptopAllowedPost[]`|Restrictions on which croptop posts are allowed on the revnet's ERC-721 tiers.|
751
-
752
- **Returns**
753
-
754
- |Name|Type|Description|
755
- |----|----|-----------|
756
- |`hook`|`IJB721TiersHook`|The address of the tiered ERC-721 hook that was deployed for the revnet.|
757
-
758
-
759
- ### _deployRevnetFor
760
-
761
- Deploy a revnet, or initialize an existing Juicebox project as a revnet.
762
-
763
- When initializing an existing project (`shouldDeployNewRevnet == false`):
764
- - The project must be blank — no controller or rulesets. This is enforced by `JBController.launchRulesetsFor`,
765
- which reverts if rulesets exist, and by `JBDirectory.setControllerOf`, which only allows setting the first
766
- controller. Without a controller, no tokens or terminals can exist, so the project is guaranteed to be
767
- uninitialized.
768
- - The project's JBProjects NFT is permanently transferred to this contract. This is irreversible.
769
-
770
-
771
- ```solidity
772
- function _deployRevnetFor(
773
- uint256 revnetId,
774
- bool shouldDeployNewRevnet,
775
- REVConfig calldata configuration,
776
- JBTerminalConfig[] calldata terminalConfigurations,
777
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration,
778
- JBRulesetConfig[] memory rulesetConfigurations,
779
- bytes32 encodedConfigurationHash
780
- )
781
- internal;
782
- ```
783
- **Parameters**
784
-
785
- |Name|Type|Description|
786
- |----|----|-----------|
787
- |`revnetId`|`uint256`|The ID of the Juicebox project to initialize as a revnet. Send 0 to deploy a new revnet.|
788
- |`shouldDeployNewRevnet`|`bool`|Whether to deploy a new revnet or convert an existing Juicebox project into a revnet.|
789
- |`configuration`|`REVConfig`|Core revnet configuration. See `REVConfig`.|
790
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
791
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet. Suckers facilitate cross-chain token transfers between peer revnets on different networks.|
792
- |`rulesetConfigurations`|`JBRulesetConfig[]`|The rulesets to set up for the revnet.|
793
- |`encodedConfigurationHash`|`bytes32`|A hash that represents the revnet's configuration. See `_makeRulesetConfigurations(…)` for encoding details. Clients can read the encoded configuration from the `DeployRevnet` event emitted by this contract.|
794
-
795
-
796
- ### _deploySuckersFor
797
-
798
-
799
- ```solidity
800
- function _deploySuckersFor(
801
- uint256 revnetId,
802
- bytes32 encodedConfigurationHash,
803
- REVSuckerDeploymentConfig calldata suckerDeploymentConfiguration
804
- )
805
- internal
806
- returns (address[] memory suckers);
807
- ```
808
- **Parameters**
809
-
810
- |Name|Type|Description|
811
- |----|----|-----------|
812
- |`revnetId`|`uint256`||
813
- |`encodedConfigurationHash`|`bytes32`|A hash that represents the revnet's configuration. See `_makeRulesetConfigurations(…)` for encoding details. Clients can read the encoded configuration from the `DeployRevnet` event emitted by this contract.|
814
- |`suckerDeploymentConfiguration`|`REVSuckerDeploymentConfig`|The suckers to set up for the revnet.|
815
-
816
-
817
- ### _makeRulesetConfigurations
818
-
819
- Convert a revnet's stages into a series of Juicebox project rulesets.
820
-
821
- Stage transitions affect outstanding loan health. When a new stage activates, parameters such as
822
- `cashOutTaxRate` and `weight` change, which directly impact the borrowable amount calculated by
823
- `REVLoans._borrowableAmountFrom`. Loans originated under a previous stage's parameters may become
824
- under-collateralized if the new stage has a higher `cashOutTaxRate` (reducing the borrowable amount per unit
825
- of collateral) or lower issuance weight (reducing the surplus-per-token ratio). Borrowers should monitor
826
- upcoming stage transitions and adjust their positions accordingly, as loans that fall below their required
827
- collateralization may become eligible for liquidation.
828
-
829
-
830
- ```solidity
831
- function _makeRulesetConfigurations(
832
- uint256 revnetId,
833
- REVConfig calldata configuration,
834
- JBTerminalConfig[] calldata terminalConfigurations
835
- )
836
- internal
837
- returns (JBRulesetConfig[] memory rulesetConfigurations, bytes32 encodedConfigurationHash);
838
- ```
839
- **Parameters**
840
-
841
- |Name|Type|Description|
842
- |----|----|-----------|
843
- |`revnetId`|`uint256`|The ID of the revnet to make rulesets for.|
844
- |`configuration`|`REVConfig`|The configuration containing the revnet's stages.|
845
- |`terminalConfigurations`|`JBTerminalConfig[]`|The terminals to set up for the revnet. Used for payments and cash outs.|
846
-
847
- **Returns**
848
-
849
- |Name|Type|Description|
850
- |----|----|-----------|
851
- |`rulesetConfigurations`|`JBRulesetConfig[]`|A list of ruleset configurations defined by the stages.|
852
- |`encodedConfigurationHash`|`bytes32`|A hash that represents the revnet's configuration. Used for sucker deployment salts.|
853
-
854
-
855
- ### _setCashOutDelayIfNeeded
856
-
857
- Sets the cash out delay if the revnet's stages are already in progress.
858
-
859
- This prevents cash out liquidity/arbitrage issues for existing revnets which
860
- are deploying to a new chain.
861
-
862
-
863
- ```solidity
864
- function _setCashOutDelayIfNeeded(uint256 revnetId, REVStageConfig calldata firstStageConfig) internal;
865
- ```
866
- **Parameters**
867
-
868
- |Name|Type|Description|
869
- |----|----|-----------|
870
- |`revnetId`|`uint256`|The ID of the revnet to set the cash out delay for.|
871
- |`firstStageConfig`|`REVStageConfig`|The revnet's first stage.|
872
-
873
-
874
- ### _setPermission
875
-
876
- Grants a permission to an address (an "operator").
877
-
878
-
879
- ```solidity
880
- function _setPermission(address operator, uint256 revnetId, uint8 permissionId) internal;
881
- ```
882
- **Parameters**
883
-
884
- |Name|Type|Description|
885
- |----|----|-----------|
886
- |`operator`|`address`|The address to give the permission to.|
887
- |`revnetId`|`uint256`|The ID of the revnet to scope the permission for.|
888
- |`permissionId`|`uint8`|The ID of the permission to set. See `JBPermissionIds`.|
889
-
890
-
891
- ### _setPermissionsFor
892
-
893
- Grants a permission to an address (an "operator").
894
-
895
-
896
- ```solidity
897
- function _setPermissionsFor(
898
- address account,
899
- address operator,
900
- uint256 revnetId,
901
- uint8[] memory permissionIds
902
- )
903
- internal;
904
- ```
905
- **Parameters**
906
-
907
- |Name|Type|Description|
908
- |----|----|-----------|
909
- |`account`|`address`|The account granting the permission.|
910
- |`operator`|`address`|The address to give the permission to.|
911
- |`revnetId`|`uint256`|The ID of the revnet to scope the permission for.|
912
- |`permissionIds`|`uint8[]`|An array of permission IDs to set. See `JBPermissionIds`.|
913
-
914
-
915
- ### _setSplitOperatorOf
916
-
917
- Give a split operator their permissions.
918
-
919
- Only a revnet's current split operator can set a new split operator, by calling `setSplitOperatorOf(…)`.
920
-
921
-
922
- ```solidity
923
- function _setSplitOperatorOf(uint256 revnetId, address operator) internal;
924
- ```
925
- **Parameters**
926
-
927
- |Name|Type|Description|
928
- |----|----|-----------|
929
- |`revnetId`|`uint256`|The ID of the revnet to set the split operator of.|
930
- |`operator`|`address`|The new split operator's address.|
931
-
932
-
933
- ## Errors
934
- ### REVDeployer_AutoIssuanceBeneficiaryZeroAddress
935
-
936
- ```solidity
937
- error REVDeployer_AutoIssuanceBeneficiaryZeroAddress();
938
- ```
939
-
940
- ### REVDeployer_CashOutDelayNotFinished
941
-
942
- ```solidity
943
- error REVDeployer_CashOutDelayNotFinished(uint256 cashOutDelay, uint256 blockTimestamp);
944
- ```
945
-
946
- ### REVDeployer_CashOutsCantBeTurnedOffCompletely
947
-
948
- ```solidity
949
- error REVDeployer_CashOutsCantBeTurnedOffCompletely(uint256 cashOutTaxRate, uint256 maxCashOutTaxRate);
950
- ```
951
-
952
- ### REVDeployer_MustHaveSplits
953
-
954
- ```solidity
955
- error REVDeployer_MustHaveSplits();
956
- ```
957
-
958
- ### REVDeployer_NothingToAutoIssue
959
-
960
- ```solidity
961
- error REVDeployer_NothingToAutoIssue();
962
- ```
963
-
964
- ### REVDeployer_RulesetDoesNotAllowDeployingSuckers
965
-
966
- ```solidity
967
- error REVDeployer_RulesetDoesNotAllowDeployingSuckers();
968
- ```
969
-
970
- ### REVDeployer_StageNotStarted
971
-
972
- ```solidity
973
- error REVDeployer_StageNotStarted(uint256 stageId);
974
- ```
975
-
976
- ### REVDeployer_StagesRequired
977
-
978
- ```solidity
979
- error REVDeployer_StagesRequired();
980
- ```
981
-
982
- ### REVDeployer_StageTimesMustIncrease
983
-
984
- ```solidity
985
- error REVDeployer_StageTimesMustIncrease();
986
- ```
987
-
988
- ### REVDeployer_NothingToBurn
989
-
990
- ```solidity
991
- error REVDeployer_NothingToBurn();
992
- ```
993
-
994
- ### REVDeployer_Unauthorized
995
-
996
- ```solidity
997
- error REVDeployer_Unauthorized(uint256 revnetId, address caller);
998
- ```
999
-