@rev-net/core-v6 0.0.40 → 0.0.41
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.
- package/package.json +1 -1
- package/src/REVDeployer.sol +44 -52
- package/src/REVHiddenTokens.sol +1 -1
- package/src/REVLoans.sol +132 -138
- package/src/REVOwner.sol +25 -27
- package/src/interfaces/IREVDeployer.sol +10 -10
- package/src/interfaces/IREVHiddenTokens.sol +4 -4
- package/src/interfaces/IREVLoans.sol +28 -28
- package/src/structs/REV721TiersHookFlags.sol +4 -5
- package/src/structs/REVCroptopAllowedPost.sol +7 -8
- package/src/structs/REVDeploy721TiersHookConfig.sol +10 -10
- package/src/structs/REVLoan.sol +2 -1
- package/src/structs/REVLoanSource.sol +2 -2
- package/src/structs/REVSuckerDeploymentConfig.sol +2 -2
package/src/REVOwner.sol
CHANGED
|
@@ -83,12 +83,12 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
83
83
|
//*********************************************************************//
|
|
84
84
|
|
|
85
85
|
/// @notice The timestamp of when cashouts will become available to a specific revnet's participants.
|
|
86
|
-
/// @dev Only applies to existing revnets
|
|
87
|
-
/// @custom:param revnetId The ID of the revnet to
|
|
86
|
+
/// @dev Only applies to existing revnets deploying onto a new network.
|
|
87
|
+
/// @custom:param revnetId The ID of the revnet to check the cash out delay for.
|
|
88
88
|
mapping(uint256 revnetId => uint256 cashOutDelay) public cashOutDelayOf;
|
|
89
89
|
|
|
90
90
|
/// @notice Each revnet's tiered ERC-721 hook.
|
|
91
|
-
/// @custom:param revnetId The ID of the revnet to
|
|
91
|
+
/// @custom:param revnetId The ID of the revnet to look up.
|
|
92
92
|
// slither-disable-next-line uninitialized-state
|
|
93
93
|
mapping(uint256 revnetId => IJB721TiersHook tiered721Hook) public tiered721HookOf;
|
|
94
94
|
|
|
@@ -143,12 +143,11 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
143
143
|
/// fee (2.5%) applies on top of the rev fee. The fee hook spec amount sent to `afterCashOutRecordedWith` will have
|
|
144
144
|
/// the protocol fee deducted by the terminal before reaching this contract.
|
|
145
145
|
/// @param context Standard Juicebox cash out context. See `JBBeforeCashOutRecordedContext`.
|
|
146
|
-
/// @return cashOutTaxRate The cash out tax rate, which influences the amount of terminal tokens
|
|
147
|
-
/// out.
|
|
148
|
-
/// @return cashOutCount The number of revnet tokens that are cashed out.
|
|
146
|
+
/// @return cashOutTaxRate The cash out tax rate, which influences the amount of terminal tokens reclaimed.
|
|
147
|
+
/// @return cashOutCount The number of revnet tokens to cash out.
|
|
149
148
|
/// @return totalSupply The total token supply across all chains (for both proportional reclaim and tax).
|
|
150
149
|
/// @return effectiveSurplusValue The global surplus across all chains for proportional reclaim.
|
|
151
|
-
/// @return hookSpecifications The amount of funds and
|
|
150
|
+
/// @return hookSpecifications The amount of funds and data to send to cash out hooks (this contract).
|
|
152
151
|
function beforeCashOutRecordedWith(JBBeforeCashOutRecordedContext calldata context)
|
|
153
152
|
external
|
|
154
153
|
view
|
|
@@ -302,8 +301,8 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
302
301
|
/// @param context Standard Juicebox payment context. See `JBBeforePayRecordedContext`.
|
|
303
302
|
/// @return weight The weight which revnet tokens are minted relative to. This can be used to customize how many
|
|
304
303
|
/// tokens get minted by a payment.
|
|
305
|
-
/// @return hookSpecifications Amounts (out of what's
|
|
306
|
-
///
|
|
304
|
+
/// @return hookSpecifications Amounts (out of what's paid in) to send to pay hooks instead of adding to the
|
|
305
|
+
/// revnet. Useful for automatically routing funds from a treasury as payments come in.
|
|
307
306
|
function beforePayRecordedWith(JBBeforePayRecordedContext calldata context)
|
|
308
307
|
external
|
|
309
308
|
view
|
|
@@ -357,12 +356,11 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
357
356
|
|
|
358
357
|
/// @notice Returns whether an address may mint a revnet's tokens on-demand. Grants permission to: the loans
|
|
359
358
|
/// contract (re-mints collateral on repayment), hidden tokens contract (re-mints on reveal), buyback hook and its
|
|
360
|
-
/// delegates
|
|
361
|
-
/// (mints tokens from pool swaps), and suckers (mints bridged tokens on the destination chain).
|
|
359
|
+
/// delegates (mints tokens from pool swaps), and suckers (mints bridged tokens on the destination chain).
|
|
362
360
|
/// @dev Part of `IJBRulesetDataHook`.
|
|
363
|
-
/// @param revnetId The ID of the revnet to check
|
|
364
|
-
/// @param ruleset The ruleset to check
|
|
365
|
-
/// @param addr The address to check
|
|
361
|
+
/// @param revnetId The ID of the revnet to check.
|
|
362
|
+
/// @param ruleset The ruleset to check against.
|
|
363
|
+
/// @param addr The address to check.
|
|
366
364
|
/// @return flag A flag indicating whether the address has permission to mint the revnet's tokens on-demand.
|
|
367
365
|
function hasMintPermissionFor(
|
|
368
366
|
uint256 revnetId,
|
|
@@ -385,9 +383,9 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
385
383
|
/// @dev Hidden tokens are intentionally excluded. Revnet operators can hide tokens as a security handle without
|
|
386
384
|
/// changing loan or cash-out math for other holders. Outstanding loan debt is counted as both surplus and balance:
|
|
387
385
|
/// it is value owed back to this chain's revnet and should travel to peer snapshots with the collateral supply.
|
|
388
|
-
/// @param revnetId The ID of the revnet
|
|
389
|
-
/// @param decimals The decimals the returned surplus
|
|
390
|
-
/// @param currency The currency the returned surplus
|
|
386
|
+
/// @param revnetId The ID of the revnet to snapshot.
|
|
387
|
+
/// @param decimals The decimals to use for the returned surplus.
|
|
388
|
+
/// @param currency The currency to denominate the returned surplus in.
|
|
391
389
|
/// @return supply The loan-collateral supply to include in the peer snapshot.
|
|
392
390
|
/// @return surplus The outstanding loan debt to include in `sourceSurplus`.
|
|
393
391
|
/// @return balance The outstanding loan debt to include in `sourceBalance`.
|
|
@@ -409,7 +407,7 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
409
407
|
// --------------------- external transactions ----------------------- //
|
|
410
408
|
//*********************************************************************//
|
|
411
409
|
|
|
412
|
-
/// @notice
|
|
410
|
+
/// @notice Process the fee from a cash out.
|
|
413
411
|
/// @param context Cash out context passed in by the terminal.
|
|
414
412
|
function afterCashOutRecordedWith(JBAfterCashOutRecordedContext calldata context) external payable override {
|
|
415
413
|
// No caller validation needed — this hook only pays fees to the fee project using funds forwarded by the
|
|
@@ -519,8 +517,8 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
519
517
|
//*********************************************************************//
|
|
520
518
|
|
|
521
519
|
/// @notice A flag indicating whether an address is a revnet's sucker.
|
|
522
|
-
/// @param revnetId The ID of the revnet to check
|
|
523
|
-
/// @param addr The address
|
|
520
|
+
/// @param revnetId The ID of the revnet to check.
|
|
521
|
+
/// @param addr The address to check.
|
|
524
522
|
/// @return isSucker A flag indicating whether the address is one of the revnet's suckers.
|
|
525
523
|
function _isSuckerOf(uint256 revnetId, address addr) internal view returns (bool) {
|
|
526
524
|
return SUCKER_REGISTRY.isSuckerOf({projectId: revnetId, addr: addr});
|
|
@@ -530,8 +528,8 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
530
528
|
/// @dev This is included in cash-out and peer-snapshot math because borrowed funds are still owed to the revnet
|
|
531
529
|
/// and collateral can re-enter supply when the loan is repaid.
|
|
532
530
|
/// @param revnetId The ID of the revnet to check.
|
|
533
|
-
/// @param decimals The decimals the resulting fixed point debt value
|
|
534
|
-
/// @param currency The currency the resulting debt value
|
|
531
|
+
/// @param decimals The decimals to use for the resulting fixed point debt value.
|
|
532
|
+
/// @param currency The currency to denominate the resulting debt value in.
|
|
535
533
|
/// @return borrowedAmount The local outstanding loan debt converted into `currency`.
|
|
536
534
|
/// @return collateralCount The local burned loan collateral count.
|
|
537
535
|
function _localLoanStateOf(
|
|
@@ -597,12 +595,12 @@ contract REVOwner is IJBRulesetDataHook, IJBCashOutHook, IJBPeerChainAdjustedAcc
|
|
|
597
595
|
// --------------------- internal transactions ----------------------- //
|
|
598
596
|
//*********************************************************************//
|
|
599
597
|
|
|
600
|
-
/// @notice Logic to
|
|
601
|
-
/// @param to The address
|
|
602
|
-
/// @param token The token
|
|
603
|
-
/// @param amount The number of tokens
|
|
598
|
+
/// @notice Logic to trigger before transferring tokens from this contract.
|
|
599
|
+
/// @param to The address to transfer to.
|
|
600
|
+
/// @param token The token to transfer.
|
|
601
|
+
/// @param amount The number of tokens to transfer, as a fixed point number with the same number of decimals
|
|
604
602
|
/// as the token specifies.
|
|
605
|
-
/// @return payValue The value to attach to the transaction
|
|
603
|
+
/// @return payValue The value to attach to the transaction.
|
|
606
604
|
function _beforeTransferTo(address to, address token, uint256 amount) internal returns (uint256) {
|
|
607
605
|
// If the token is the native token, no allowance needed.
|
|
608
606
|
if (token == JBConstants.NATIVE_TOKEN) return amount;
|
|
@@ -136,8 +136,8 @@ interface IREVDeployer {
|
|
|
136
136
|
/// @return The hook deployer contract.
|
|
137
137
|
function HOOK_DEPLOYER() external view returns (IJB721TiersHookDeployer);
|
|
138
138
|
|
|
139
|
-
/// @notice
|
|
140
|
-
/// @param revnetId The ID of the revnet.
|
|
139
|
+
/// @notice Check whether an address is a revnet's split operator.
|
|
140
|
+
/// @param revnetId The ID of the revnet to check.
|
|
141
141
|
/// @param addr The address to check.
|
|
142
142
|
/// @return A flag indicating whether the address is the revnet's split operator.
|
|
143
143
|
function isSplitOperatorOf(uint256 revnetId, address addr) external view returns (bool);
|
|
@@ -167,13 +167,13 @@ interface IREVDeployer {
|
|
|
167
167
|
function SUCKER_REGISTRY() external view returns (IJBSuckerRegistry);
|
|
168
168
|
|
|
169
169
|
/// @notice Auto-mint a revnet's tokens from a stage for a beneficiary.
|
|
170
|
-
/// @param revnetId The ID of the revnet to auto-mint tokens
|
|
171
|
-
/// @param stageId The ID of the stage auto-mint tokens
|
|
172
|
-
/// @param beneficiary The address to auto-
|
|
170
|
+
/// @param revnetId The ID of the revnet to auto-mint tokens for.
|
|
171
|
+
/// @param stageId The ID of the stage to auto-mint tokens from.
|
|
172
|
+
/// @param beneficiary The address to send auto-minted tokens to.
|
|
173
173
|
function autoIssueFor(uint256 revnetId, uint256 stageId, address beneficiary) external;
|
|
174
174
|
|
|
175
175
|
/// @notice Burn any of a revnet's tokens held by this contract.
|
|
176
|
-
/// @param revnetId The ID of the revnet
|
|
176
|
+
/// @param revnetId The ID of the revnet to burn tokens for.
|
|
177
177
|
function burnHeldTokensOf(uint256 revnetId) external;
|
|
178
178
|
|
|
179
179
|
/// @notice Deploy a revnet with a tiered ERC-721 hook and optional croptop posting support.
|
|
@@ -182,10 +182,10 @@ interface IREVDeployer {
|
|
|
182
182
|
/// @param configuration Core revnet configuration.
|
|
183
183
|
/// @param terminalConfigurations The terminals to set up for the revnet.
|
|
184
184
|
/// @param suckerDeploymentConfiguration The suckers to set up for cross-chain token transfers.
|
|
185
|
-
/// @param tiered721HookConfiguration How to
|
|
186
|
-
/// @param allowedPosts Restrictions on which croptop posts
|
|
185
|
+
/// @param tiered721HookConfiguration How to configure the tiered ERC-721 hook for the revnet.
|
|
186
|
+
/// @param allowedPosts Restrictions on which croptop posts to allow on the revnet's ERC-721 tiers.
|
|
187
187
|
/// @return The ID of the newly created or initialized revnet.
|
|
188
|
-
/// @return hook The tiered ERC-721 hook
|
|
188
|
+
/// @return hook The tiered ERC-721 hook deployed for the revnet.
|
|
189
189
|
function deployFor(
|
|
190
190
|
uint256 revnetId,
|
|
191
191
|
REVConfig memory configuration,
|
|
@@ -204,7 +204,7 @@ interface IREVDeployer {
|
|
|
204
204
|
/// @param terminalConfigurations The terminals to set up for the revnet.
|
|
205
205
|
/// @param suckerDeploymentConfiguration The suckers to set up for cross-chain token transfers.
|
|
206
206
|
/// @return The ID of the newly created or initialized revnet.
|
|
207
|
-
/// @return hook The tiered ERC-721 hook
|
|
207
|
+
/// @return hook The tiered ERC-721 hook deployed for the revnet.
|
|
208
208
|
function deployFor(
|
|
209
209
|
uint256 revnetId,
|
|
210
210
|
REVConfig memory configuration,
|
|
@@ -10,14 +10,14 @@ import {IJBController} from "@bananapus/core-v6/src/interfaces/IJBController.sol
|
|
|
10
10
|
interface IREVHiddenTokens {
|
|
11
11
|
/// @notice Emitted when a holder is allowed or disallowed to hide their own tokens.
|
|
12
12
|
/// @param revnetId The ID of the revnet.
|
|
13
|
-
/// @param holder The holder
|
|
13
|
+
/// @param holder The holder to allow or disallow.
|
|
14
14
|
/// @param isAllowed Whether the holder is allowed.
|
|
15
15
|
event SetTokenHidingAllowed(uint256 indexed revnetId, address indexed holder, bool isAllowed);
|
|
16
16
|
|
|
17
17
|
/// @notice Emitted when tokens are hidden (burned and tracked for later reveal).
|
|
18
|
-
/// @param revnetId The ID of the revnet whose tokens
|
|
18
|
+
/// @param revnetId The ID of the revnet whose tokens were hidden.
|
|
19
19
|
/// @param tokenCount The number of tokens hidden.
|
|
20
|
-
/// @param holder The address whose tokens
|
|
20
|
+
/// @param holder The address whose tokens were hidden.
|
|
21
21
|
/// @param caller The address that hid the tokens.
|
|
22
22
|
event HideTokens(uint256 indexed revnetId, uint256 tokenCount, address holder, address caller);
|
|
23
23
|
|
|
@@ -44,7 +44,7 @@ interface IREVHiddenTokens {
|
|
|
44
44
|
function totalHiddenOf(uint256 revnetId) external view returns (uint256);
|
|
45
45
|
|
|
46
46
|
/// @notice Whether a holder is allowed to hide their own tokens.
|
|
47
|
-
/// @param holder The holder
|
|
47
|
+
/// @param holder The holder to check.
|
|
48
48
|
/// @param revnetId The ID of the revnet.
|
|
49
49
|
/// @return Whether the holder is allowed.
|
|
50
50
|
function tokenHidingIsAllowedFor(address holder, uint256 revnetId) external view returns (bool);
|
|
@@ -89,10 +89,10 @@ interface IREVLoans {
|
|
|
89
89
|
event SetTokenUriResolver(IJBTokenUriResolver indexed resolver, address caller);
|
|
90
90
|
|
|
91
91
|
/// @notice The amount that can be borrowed from a revnet given a certain amount of collateral.
|
|
92
|
-
/// @param revnetId The ID of the revnet to
|
|
93
|
-
/// @param collateralCount The amount of collateral
|
|
94
|
-
/// @param decimals The decimals the resulting fixed point value
|
|
95
|
-
/// @param currency The currency
|
|
92
|
+
/// @param revnetId The ID of the revnet to borrow from.
|
|
93
|
+
/// @param collateralCount The amount of collateral to secure the loan with.
|
|
94
|
+
/// @param decimals The decimals to use for the resulting fixed point value.
|
|
95
|
+
/// @param currency The currency to denominate the resulting amount in.
|
|
96
96
|
/// @return The amount that can be borrowed from the revnet.
|
|
97
97
|
function borrowableAmountFrom(
|
|
98
98
|
uint256 revnetId,
|
|
@@ -108,9 +108,9 @@ interface IREVLoans {
|
|
|
108
108
|
/// @return The controller contract.
|
|
109
109
|
function CONTROLLER() external view returns (IJBController);
|
|
110
110
|
|
|
111
|
-
/// @notice Determines the source fee amount for a loan
|
|
112
|
-
/// @param loan The loan
|
|
113
|
-
/// @param amount The amount
|
|
111
|
+
/// @notice Determines the source fee amount for a loan when paying off a certain amount.
|
|
112
|
+
/// @param loan The loan to determine the source fee for.
|
|
113
|
+
/// @param amount The amount to pay off.
|
|
114
114
|
/// @return sourceFeeAmount The source fee amount for the loan.
|
|
115
115
|
function determineSourceFeeAmount(
|
|
116
116
|
REVLoan memory loan,
|
|
@@ -125,9 +125,9 @@ interface IREVLoans {
|
|
|
125
125
|
function DIRECTORY() external view returns (IJBDirectory);
|
|
126
126
|
|
|
127
127
|
/// @notice Whether a revnet currently has outstanding loans from the specified terminal in the specified token.
|
|
128
|
-
/// @param revnetId The ID of the revnet
|
|
129
|
-
/// @param terminal The terminal
|
|
130
|
-
/// @param token The token
|
|
128
|
+
/// @param revnetId The ID of the revnet to check.
|
|
129
|
+
/// @param terminal The terminal to check.
|
|
130
|
+
/// @param token The token to check.
|
|
131
131
|
/// @return A flag indicating if the revnet has an active loan source.
|
|
132
132
|
function isLoanSourceOf(uint256 revnetId, IJBPayoutTerminal terminal, address token) external view returns (bool);
|
|
133
133
|
|
|
@@ -135,8 +135,8 @@ interface IREVLoans {
|
|
|
135
135
|
/// @return The loan liquidation duration in seconds.
|
|
136
136
|
function LOAN_LIQUIDATION_DURATION() external view returns (uint256);
|
|
137
137
|
|
|
138
|
-
/// @notice Get a loan's details.
|
|
139
|
-
/// @param loanId The ID of the loan to
|
|
138
|
+
/// @notice Get a loan's full details -- amount, collateral, creation time, prepaid fee, and source.
|
|
139
|
+
/// @param loanId The ID of the loan to look up.
|
|
140
140
|
/// @return The loan data.
|
|
141
141
|
function loanOf(uint256 loanId) external view returns (REVLoan memory);
|
|
142
142
|
|
|
@@ -176,8 +176,8 @@ interface IREVLoans {
|
|
|
176
176
|
/// @return The REV prepaid fee percent.
|
|
177
177
|
function REV_PREPAID_FEE_PERCENT() external view returns (uint256);
|
|
178
178
|
|
|
179
|
-
/// @notice The revnet ID for
|
|
180
|
-
/// @param loanId The loan ID to
|
|
179
|
+
/// @notice The revnet ID for a given loan ID.
|
|
180
|
+
/// @param loanId The loan ID to look up.
|
|
181
181
|
/// @return The ID of the revnet.
|
|
182
182
|
function revnetIdOfLoanWith(uint256 loanId) external view returns (uint256);
|
|
183
183
|
|
|
@@ -186,9 +186,9 @@ interface IREVLoans {
|
|
|
186
186
|
function tokenUriResolver() external view returns (IJBTokenUriResolver);
|
|
187
187
|
|
|
188
188
|
/// @notice The total amount loaned out by a revnet from a specified terminal in a specified token.
|
|
189
|
-
/// @param revnetId The ID of the revnet
|
|
190
|
-
/// @param terminal The terminal
|
|
191
|
-
/// @param token The token
|
|
189
|
+
/// @param revnetId The ID of the revnet to check.
|
|
190
|
+
/// @param terminal The terminal the loans were issued from.
|
|
191
|
+
/// @param token The token loaned.
|
|
192
192
|
/// @return The total amount borrowed.
|
|
193
193
|
function totalBorrowedFrom(
|
|
194
194
|
uint256 revnetId,
|
|
@@ -213,15 +213,15 @@ interface IREVLoans {
|
|
|
213
213
|
function totalLoansBorrowedFor(uint256 revnetId) external view returns (uint256);
|
|
214
214
|
|
|
215
215
|
/// @notice Open a loan by borrowing from a revnet. Collateral tokens are burned and only re-minted upon repayment.
|
|
216
|
-
/// @param revnetId The ID of the revnet
|
|
216
|
+
/// @param revnetId The ID of the revnet to borrow from.
|
|
217
217
|
/// @param source The source of the loan (terminal and token).
|
|
218
218
|
/// @param minBorrowAmount The minimum amount to borrow, denominated in the source's token.
|
|
219
219
|
/// @param collateralCount The amount of tokens to use as collateral for the loan.
|
|
220
220
|
/// @param beneficiary The address that will receive the borrowed funds and fee payment tokens.
|
|
221
221
|
/// @param prepaidFeePercent The fee percent to charge upfront, in terms of `JBConstants.MAX_FEE`.
|
|
222
|
-
/// @param holder The address whose tokens
|
|
223
|
-
/// @return loanId The ID of the loan created
|
|
224
|
-
/// @return The loan created
|
|
222
|
+
/// @param holder The address whose tokens to use as collateral and who receives the loan NFT.
|
|
223
|
+
/// @return loanId The ID of the loan created.
|
|
224
|
+
/// @return The loan created.
|
|
225
225
|
function borrowFrom(
|
|
226
226
|
uint256 revnetId,
|
|
227
227
|
REVLoanSource calldata source,
|
|
@@ -234,7 +234,7 @@ interface IREVLoans {
|
|
|
234
234
|
external
|
|
235
235
|
returns (uint256 loanId, REVLoan memory);
|
|
236
236
|
|
|
237
|
-
/// @notice
|
|
237
|
+
/// @notice Liquidate loans that have exceeded the liquidation duration, permanently destroying their collateral.
|
|
238
238
|
/// @param revnetId The ID of the revnet to liquidate loans from.
|
|
239
239
|
/// @param startingLoanId The loan number to start iterating from.
|
|
240
240
|
/// @param count The number of loans to iterate over.
|
|
@@ -245,7 +245,7 @@ interface IREVLoans {
|
|
|
245
245
|
/// @param collateralCountToTransfer The amount of collateral to transfer from the original loan.
|
|
246
246
|
/// @param source The source of the new loan (terminal and token). Must match the existing loan's source.
|
|
247
247
|
/// @param minBorrowAmount The minimum amount to borrow for the new loan.
|
|
248
|
-
/// @param collateralCountToAdd Additional collateral to add to the new loan from
|
|
248
|
+
/// @param collateralCountToAdd Additional collateral to add to the new loan from your balance.
|
|
249
249
|
/// @param beneficiary The address that will receive the borrowed funds and fee payment tokens.
|
|
250
250
|
/// @param prepaidFeePercent The fee percent to charge upfront for the new loan.
|
|
251
251
|
/// @return reallocatedLoanId The ID of the reallocated (reduced) loan.
|
|
@@ -265,13 +265,13 @@ interface IREVLoans {
|
|
|
265
265
|
returns (uint256 reallocatedLoanId, uint256 newLoanId, REVLoan memory reallocatedLoan, REVLoan memory newLoan);
|
|
266
266
|
|
|
267
267
|
/// @notice Repay a loan or return excess collateral no longer needed to support the loan.
|
|
268
|
-
/// @param loanId The ID of the loan
|
|
268
|
+
/// @param loanId The ID of the loan to repay.
|
|
269
269
|
/// @param maxRepayBorrowAmount The maximum amount to repay, denominated in the source's token.
|
|
270
270
|
/// @param collateralCountToReturn The amount of collateral to return from the loan.
|
|
271
|
-
/// @param beneficiary The address
|
|
271
|
+
/// @param beneficiary The address to receive the returned collateral and fee payment tokens.
|
|
272
272
|
/// @param allowance A permit2 allowance to facilitate the repayment transfer.
|
|
273
|
-
/// @return paidOffLoanId The ID of the loan after
|
|
274
|
-
/// @return paidOffloan The loan after
|
|
273
|
+
/// @return paidOffLoanId The ID of the loan after repayment.
|
|
274
|
+
/// @return paidOffloan The loan after repayment.
|
|
275
275
|
function repayLoan(
|
|
276
276
|
uint256 loanId,
|
|
277
277
|
uint256 maxRepayBorrowAmount,
|
|
@@ -283,7 +283,7 @@ interface IREVLoans {
|
|
|
283
283
|
payable
|
|
284
284
|
returns (uint256 paidOffLoanId, REVLoan memory paidOffloan);
|
|
285
285
|
|
|
286
|
-
/// @notice
|
|
286
|
+
/// @notice Set the address of the resolver used to retrieve the token URI of loans.
|
|
287
287
|
/// @param resolver The new token URI resolver.
|
|
288
288
|
function setTokenUriResolver(IJBTokenUriResolver resolver) external;
|
|
289
289
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
/// @custom:member noNewTiersWithReserves
|
|
5
|
-
/// @custom:member noNewTiersWithVotes
|
|
6
|
-
/// @custom:member noNewTiersWithOwnerMinting
|
|
7
|
-
/// @custom:member preventOverspending
|
|
8
|
-
/// prevented.
|
|
4
|
+
/// @custom:member noNewTiersWithReserves Whether to forbid new tiers with non-zero reserve frequency.
|
|
5
|
+
/// @custom:member noNewTiersWithVotes Whether to forbid new tiers with voting units.
|
|
6
|
+
/// @custom:member noNewTiersWithOwnerMinting Whether to forbid new tiers with owner minting.
|
|
7
|
+
/// @custom:member preventOverspending Whether to prevent payments exceeding the price of minted NFTs.
|
|
9
8
|
struct REV721TiersHookFlags {
|
|
10
9
|
bool noNewTiersWithReserves;
|
|
11
10
|
bool noNewTiersWithVotes;
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
4
|
/// @notice Criteria for allowed posts.
|
|
5
|
-
/// @custom:member category
|
|
6
|
-
/// @custom:member minimumPrice The minimum price
|
|
7
|
-
/// @custom:member minimumTotalSupply The minimum total supply of NFTs
|
|
8
|
-
/// @custom:member maxTotalSupply The max total supply of NFTs
|
|
9
|
-
///
|
|
10
|
-
///
|
|
11
|
-
///
|
|
12
|
-
/// @custom:member allowedAddresses A list of addresses that are allowed to post on the category through Croptop.
|
|
5
|
+
/// @custom:member category The category to allow posts for.
|
|
6
|
+
/// @custom:member minimumPrice The minimum price a post to the specified category must cost.
|
|
7
|
+
/// @custom:member minimumTotalSupply The minimum total supply of NFTs to make available when minting.
|
|
8
|
+
/// @custom:member maxTotalSupply The max total supply of NFTs to make available when minting. Leave as 0 for unlimited.
|
|
9
|
+
/// @custom:member maximumSplitPercent The maximum split percent (out of JBConstants.SPLITS_TOTAL_PERCENT) a poster can
|
|
10
|
+
/// set. 0 means splits are not allowed.
|
|
11
|
+
/// @custom:member allowedAddresses The addresses allowed to post on the category through Croptop.
|
|
13
12
|
struct REVCroptopAllowedPost {
|
|
14
13
|
uint24 category;
|
|
15
14
|
uint104 minimumPrice;
|
|
@@ -3,16 +3,16 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {REVBaseline721HookConfig} from "./REVBaseline721HookConfig.sol";
|
|
5
5
|
|
|
6
|
-
/// @custom:member baseline721HookConfiguration The baseline config.
|
|
7
|
-
/// @custom:member salt The salt to
|
|
8
|
-
/// @custom:member preventSplitOperatorAdjustingTiers
|
|
9
|
-
///
|
|
10
|
-
/// @custom:member preventSplitOperatorUpdatingMetadata
|
|
11
|
-
///
|
|
12
|
-
/// @custom:member preventSplitOperatorMinting
|
|
13
|
-
///
|
|
14
|
-
/// @custom:member preventSplitOperatorIncreasingDiscountPercent
|
|
15
|
-
///
|
|
6
|
+
/// @custom:member baseline721HookConfiguration The baseline 721 hook config.
|
|
7
|
+
/// @custom:member salt The salt to derive the collection's address from.
|
|
8
|
+
/// @custom:member preventSplitOperatorAdjustingTiers Whether to prevent the split operator from adding and removing
|
|
9
|
+
/// tiers.
|
|
10
|
+
/// @custom:member preventSplitOperatorUpdatingMetadata Whether to prevent the split operator from updating the 721's
|
|
11
|
+
/// metadata.
|
|
12
|
+
/// @custom:member preventSplitOperatorMinting Whether to prevent the split operator from minting 721s from tiers that
|
|
13
|
+
/// allow it.
|
|
14
|
+
/// @custom:member preventSplitOperatorIncreasingDiscountPercent Whether to prevent the split operator from increasing
|
|
15
|
+
/// the discount of a tier.
|
|
16
16
|
struct REVDeploy721TiersHookConfig {
|
|
17
17
|
REVBaseline721HookConfig baseline721HookConfiguration;
|
|
18
18
|
bytes32 salt;
|
package/src/structs/REVLoan.sol
CHANGED
|
@@ -11,7 +11,8 @@ import {REVLoanSource} from "./REVLoanSource.sol";
|
|
|
11
11
|
/// @custom:member createdAt The timestamp when the loan was created.
|
|
12
12
|
/// @custom:member prepaidFeePercent The percentage of fees prepaid at creation (determines prepaid duration).
|
|
13
13
|
/// @custom:member prepaidDuration The duration (seconds) during which repayment costs nothing beyond the original
|
|
14
|
-
/// amount.
|
|
14
|
+
/// amount.
|
|
15
|
+
/// @custom:member source The terminal and token from which funds were drawn.
|
|
15
16
|
struct REVLoan {
|
|
16
17
|
uint112 amount;
|
|
17
18
|
uint112 collateral;
|
|
@@ -3,8 +3,8 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {IJBPayoutTerminal} from "@bananapus/core-v6/src/interfaces/IJBPayoutTerminal.sol";
|
|
5
5
|
|
|
6
|
-
/// @custom:member token The token
|
|
7
|
-
/// @custom:member terminal The terminal
|
|
6
|
+
/// @custom:member token The token to loan.
|
|
7
|
+
/// @custom:member terminal The terminal to loan from.
|
|
8
8
|
struct REVLoanSource {
|
|
9
9
|
address token;
|
|
10
10
|
IJBPayoutTerminal terminal;
|
|
@@ -3,8 +3,8 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
5
5
|
|
|
6
|
-
/// @custom:member deployerConfigurations The
|
|
7
|
-
/// @custom:member salt The salt to use for
|
|
6
|
+
/// @custom:member deployerConfigurations The configuration for bridging tokens to other chains.
|
|
7
|
+
/// @custom:member salt The salt to use for deterministic sucker addresses across chains.
|
|
8
8
|
struct REVSuckerDeploymentConfig {
|
|
9
9
|
JBSuckerDeployerConfig[] deployerConfigurations;
|
|
10
10
|
bytes32 salt;
|