@bananapus/core-v6 0.0.38 → 0.0.40
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/foundry.toml +1 -1
- package/package.json +1 -1
- package/src/JBChainlinkV3PriceFeed.sol +4 -1
- package/src/JBChainlinkV3SequencerPriceFeed.sol +4 -2
- package/src/JBController.sol +67 -58
- package/src/JBDeadline.sol +4 -4
- package/src/JBDirectory.sol +38 -36
- package/src/JBERC20.sol +10 -9
- package/src/JBFeelessAddresses.sol +6 -3
- package/src/JBFundAccessLimits.sol +26 -22
- package/src/JBMultiTerminal.sol +128 -125
- package/src/JBPermissions.sol +35 -38
- package/src/JBPrices.sol +25 -20
- package/src/JBProjects.sol +6 -3
- package/src/JBRulesets.sol +45 -42
- package/src/JBSplits.sol +19 -17
- package/src/JBTerminalStore.sol +57 -50
- package/src/JBTokens.sol +42 -32
- package/src/abstract/JBControlled.sol +3 -1
- package/src/abstract/JBPermissioned.sol +3 -1
- package/src/enums/JBApprovalStatus.sol +7 -1
- package/src/interfaces/IJBCashOutTerminal.sol +5 -5
- package/src/interfaces/IJBController.sol +13 -12
- package/src/interfaces/IJBDirectory.sol +3 -1
- package/src/interfaces/IJBMigratable.sol +5 -5
- package/src/interfaces/IJBMultiTerminal.sol +3 -2
- package/src/interfaces/IJBPayoutTerminal.sol +3 -3
- package/src/interfaces/IJBPermissions.sol +6 -5
- package/src/interfaces/IJBPermitTerminal.sol +1 -1
- package/src/interfaces/IJBPrices.sol +7 -5
- package/src/interfaces/IJBRulesets.sol +2 -1
- package/src/interfaces/IJBSplits.sol +2 -1
- package/src/interfaces/IJBTerminal.sol +13 -11
- package/src/interfaces/IJBTerminalStore.sol +23 -21
- package/src/interfaces/IJBTokens.sol +8 -7
- package/src/libraries/JBCashOuts.sol +8 -3
- package/src/libraries/JBConstants.sol +12 -3
- package/src/libraries/JBCurrencyIds.sol +2 -0
- package/src/libraries/JBFees.sol +5 -1
- package/src/libraries/JBFixedPointNumber.sol +2 -0
- package/src/libraries/JBPayoutSplitGroupLib.sol +10 -7
- package/src/libraries/JBRulesetMetadataResolver.sol +4 -0
- package/src/libraries/JBSplitGroupIds.sol +2 -1
- package/src/libraries/JBSurplus.sol +4 -2
- package/src/periphery/JBMatchingPriceFeed.sol +2 -0
- package/src/structs/JBAccountingContext.sol +7 -4
- package/src/structs/JBAfterCashOutRecordedContext.sol +8 -8
- package/src/structs/JBAfterPayRecordedContext.sol +5 -5
- package/src/structs/JBBeforeCashOutRecordedContext.sol +7 -7
- package/src/structs/JBBeforePayRecordedContext.sol +5 -5
- package/src/structs/JBFundAccessLimitGroup.sol +10 -17
- package/src/structs/JBPermissionsData.sol +3 -3
- package/src/structs/JBRuleset.sol +18 -26
- package/src/structs/JBRulesetConfig.sol +13 -25
- package/src/structs/JBRulesetMetadata.sol +25 -32
- package/src/structs/JBSplitHookContext.sol +2 -2
|
@@ -7,8 +7,12 @@ import {IJBFundAccessLimits} from "./interfaces/IJBFundAccessLimits.sol";
|
|
|
7
7
|
import {JBCurrencyAmount} from "./structs/JBCurrencyAmount.sol";
|
|
8
8
|
import {JBFundAccessLimitGroup} from "./structs/JBFundAccessLimitGroup.sol";
|
|
9
9
|
|
|
10
|
-
/// @notice
|
|
11
|
-
///
|
|
10
|
+
/// @notice Controls how much a project can withdraw from its terminals each funding cycle. Two types of limits:
|
|
11
|
+
/// **Payout limits** cap how much can be distributed to splits and the project owner. **Surplus allowances** cap how
|
|
12
|
+
/// much the project owner can pull from the surplus (funds above payout limits). Both reset each ruleset cycle.
|
|
13
|
+
/// @dev Limits are denominated in a currency (which may differ from the held token) and resolved at withdrawal time
|
|
14
|
+
/// via `JBPrices`. An empty `fundAccessLimitGroups` array means zero access (not unlimited) — use `type(uint224).max`
|
|
15
|
+
/// for unlimited.
|
|
12
16
|
contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
13
17
|
//*********************************************************************//
|
|
14
18
|
// --------------------------- custom errors ------------------------- //
|
|
@@ -61,11 +65,12 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
|
61
65
|
// ---------------------- external transactions ---------------------- //
|
|
62
66
|
//*********************************************************************//
|
|
63
67
|
|
|
64
|
-
/// @notice
|
|
65
|
-
///
|
|
66
|
-
///
|
|
67
|
-
///
|
|
68
|
-
/// @
|
|
68
|
+
/// @notice Configure how much a project can withdraw from each of its terminals during a ruleset. Payout limits
|
|
69
|
+
/// cap how much can be distributed to splits/owner; surplus allowances cap how much extra the owner can pull from
|
|
70
|
+
/// surplus. Both reset each funding cycle.
|
|
71
|
+
/// @dev Only a project's controller can set fund access limits (called during `queueRulesetsOf`).
|
|
72
|
+
/// @dev Limits within each group must be sorted by currency in strictly increasing order to prevent duplicates.
|
|
73
|
+
/// @param projectId The ID of the project to set fund access limits for.
|
|
69
74
|
/// @param rulesetId The ID of the ruleset that the limits will apply within.
|
|
70
75
|
/// @param fundAccessLimitGroups An array containing payout limits and surplus allowances for each payment terminal.
|
|
71
76
|
/// Amounts are fixed point numbers using the same number of decimals as the associated terminal.
|
|
@@ -152,14 +157,15 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
|
152
157
|
// ------------------------- external views -------------------------- //
|
|
153
158
|
//*********************************************************************//
|
|
154
159
|
|
|
155
|
-
/// @notice
|
|
156
|
-
///
|
|
160
|
+
/// @notice Look up how much a project can distribute (via `sendPayoutsOf`) from a specific terminal and token,
|
|
161
|
+
/// denominated in a specific currency. Returns 0 if no limit is configured for that currency.
|
|
162
|
+
/// @dev The fixed point return amount uses the same number of decimals as the terminal.
|
|
157
163
|
/// @param projectId The project's ID.
|
|
158
164
|
/// @param rulesetId The ruleset's ID.
|
|
159
165
|
/// @param terminal The terminal the payout limit applies to.
|
|
160
166
|
/// @param token The token the payout limit applies to.
|
|
161
167
|
/// @param currency The currency the payout limit is denominated in.
|
|
162
|
-
/// @return payoutLimit The payout limit, as a fixed point number with the same number of decimals as the
|
|
168
|
+
/// @return payoutLimit The payout limit, as a fixed point number with the same number of decimals as the
|
|
163
169
|
/// terminal.
|
|
164
170
|
function payoutLimitOf(
|
|
165
171
|
uint256 projectId,
|
|
@@ -195,10 +201,9 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
|
195
201
|
}
|
|
196
202
|
}
|
|
197
203
|
|
|
198
|
-
/// @notice
|
|
199
|
-
///
|
|
200
|
-
///
|
|
201
|
-
/// @dev The fixed point `amount`s returned will use the same number of decimals as the `terminal`.
|
|
204
|
+
/// @notice Get all payout limits for a project's terminal and token during a ruleset. A project can have multiple
|
|
205
|
+
/// payout limits denominated in different currencies (e.g. 10,000 USD + 5 ETH). Each is enforced independently.
|
|
206
|
+
/// @dev The fixed point `amount`s returned use the same number of decimals as the terminal.
|
|
202
207
|
/// @param projectId The project's ID.
|
|
203
208
|
/// @param rulesetId The ruleset's ID.
|
|
204
209
|
/// @param terminal The terminal the payout limits apply to.
|
|
@@ -243,15 +248,16 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
|
243
248
|
}
|
|
244
249
|
}
|
|
245
250
|
|
|
246
|
-
/// @notice
|
|
247
|
-
///
|
|
251
|
+
/// @notice Look up how much a project's owner can withdraw from the surplus (via `useAllowanceOf`) from a specific
|
|
252
|
+
/// terminal and token, denominated in a specific currency. Returns 0 if no allowance is configured.
|
|
253
|
+
/// @dev The fixed point return amount uses the same number of decimals as the terminal.
|
|
248
254
|
/// @param projectId The project's ID.
|
|
249
255
|
/// @param rulesetId The ruleset's ID.
|
|
250
256
|
/// @param terminal The terminal the surplus allowance applies to.
|
|
251
257
|
/// @param token The token the surplus allowance applies to.
|
|
252
258
|
/// @param currency The currency that the surplus allowance is denominated in.
|
|
253
259
|
/// @return surplusAllowance The surplus allowance, as a fixed point number with the same number of decimals as the
|
|
254
|
-
///
|
|
260
|
+
/// terminal.
|
|
255
261
|
function surplusAllowanceOf(
|
|
256
262
|
uint256 projectId,
|
|
257
263
|
uint256 rulesetId,
|
|
@@ -287,11 +293,9 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
|
|
|
287
293
|
}
|
|
288
294
|
}
|
|
289
295
|
|
|
290
|
-
/// @notice
|
|
291
|
-
///
|
|
292
|
-
///
|
|
293
|
-
/// currency.
|
|
294
|
-
/// @dev The fixed point `amount`s returned will use the same number of decimals as the `terminal`.
|
|
296
|
+
/// @notice Get all surplus allowances for a project's terminal and token during a ruleset. Like payout limits, a
|
|
297
|
+
/// project can have multiple surplus allowances in different currencies, each enforced independently.
|
|
298
|
+
/// @dev The fixed point `amount`s returned use the same number of decimals as the terminal.
|
|
295
299
|
/// @param projectId The project's ID.
|
|
296
300
|
/// @param rulesetId The ruleset's ID.
|
|
297
301
|
/// @param terminal The terminal the surplus allowances apply to.
|