@bananapus/core-v6 0.0.39 → 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.
Files changed (37) hide show
  1. package/package.json +1 -1
  2. package/src/JBChainlinkV3SequencerPriceFeed.sol +1 -1
  3. package/src/JBController.sol +16 -16
  4. package/src/JBDirectory.sol +4 -4
  5. package/src/JBERC20.sol +5 -5
  6. package/src/JBFundAccessLimits.sol +5 -5
  7. package/src/JBMultiTerminal.sol +103 -100
  8. package/src/JBPermissions.sol +2 -2
  9. package/src/JBPrices.sol +3 -3
  10. package/src/JBRulesets.sol +6 -4
  11. package/src/JBSplits.sol +2 -2
  12. package/src/JBTerminalStore.sol +33 -33
  13. package/src/JBTokens.sol +6 -6
  14. package/src/interfaces/IJBCashOutTerminal.sol +6 -6
  15. package/src/interfaces/IJBController.sol +11 -11
  16. package/src/interfaces/IJBMigratable.sol +5 -5
  17. package/src/interfaces/IJBPayoutTerminal.sol +3 -3
  18. package/src/interfaces/IJBPermissions.sol +4 -4
  19. package/src/interfaces/IJBPermitTerminal.sol +1 -1
  20. package/src/interfaces/IJBPrices.sol +4 -4
  21. package/src/interfaces/IJBRulesets.sol +6 -3
  22. package/src/interfaces/IJBTerminal.sol +10 -10
  23. package/src/interfaces/IJBTerminalStore.sol +20 -20
  24. package/src/interfaces/IJBTokens.sol +6 -6
  25. package/src/libraries/JBCashOuts.sol +4 -4
  26. package/src/libraries/JBPayoutSplitGroupLib.sol +5 -5
  27. package/src/libraries/JBSurplus.sol +1 -1
  28. package/src/structs/JBAfterCashOutRecordedContext.sol +10 -9
  29. package/src/structs/JBAfterPayRecordedContext.sol +5 -5
  30. package/src/structs/JBBeforeCashOutRecordedContext.sol +8 -7
  31. package/src/structs/JBBeforePayRecordedContext.sol +6 -5
  32. package/src/structs/JBFee.sol +1 -1
  33. package/src/structs/JBPermissionsData.sol +3 -3
  34. package/src/structs/JBRuleset.sol +3 -2
  35. package/src/structs/JBRulesetConfig.sol +2 -1
  36. package/src/structs/JBRulesetMetadata.sol +6 -5
  37. package/src/structs/JBSplitHookContext.sol +2 -2
@@ -59,7 +59,7 @@ interface IJBTerminalStore {
59
59
 
60
60
  /// @notice Returns the reclaimable surplus for a project given a cash-out count, total supply, and surplus.
61
61
  /// @param projectId The ID of the project.
62
- /// @param cashOutCount The number of tokens being cashed out.
62
+ /// @param cashOutCount The number of tokens to cash out.
63
63
  /// @param totalSupply The total token supply.
64
64
  /// @param surplus The project's surplus.
65
65
  /// @return The reclaimable surplus amount.
@@ -76,7 +76,7 @@ interface IJBTerminalStore {
76
76
  /// @notice Returns the reclaimable surplus for a project across multiple terminals, considering only specific
77
77
  /// tokens.
78
78
  /// @param projectId The ID of the project.
79
- /// @param cashOutCount The number of tokens being cashed out.
79
+ /// @param cashOutCount The number of tokens to cash out.
80
80
  /// @param terminals The terminals to include in the surplus calculation. If empty, all project terminals are used.
81
81
  /// @param tokens The tokens to include in the surplus calculation.
82
82
  /// @param decimals The number of decimals to express the result with.
@@ -114,7 +114,7 @@ interface IJBTerminalStore {
114
114
 
115
115
  /// @notice Returns the reclaimable surplus for a project across all terminals using all accounting contexts.
116
116
  /// @param projectId The ID of the project.
117
- /// @param cashOutCount The number of tokens being cashed out.
117
+ /// @param cashOutCount The number of tokens to cash out.
118
118
  /// @param decimals The number of decimals to express the result with.
119
119
  /// @param currency The currency to express the result in.
120
120
  /// @return The reclaimable surplus amount.
@@ -145,9 +145,9 @@ interface IJBTerminalStore {
145
145
  /// @notice Simulates a cash out without modifying state.
146
146
  /// @param terminal The terminal to simulate the cash out from.
147
147
  /// @param holder The address cashing out.
148
- /// @param projectId The ID of the project being cashed out from.
149
- /// @param cashOutCount The number of project tokens being cashed out.
150
- /// @param tokenToReclaim The token being reclaimed.
148
+ /// @param projectId The ID of the project to cash out from.
149
+ /// @param cashOutCount The number of project tokens to cash out.
150
+ /// @param tokenToReclaim The token to reclaim.
151
151
  /// @param beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address.
152
152
  /// @param metadata Extra data to pass along to the data hook.
153
153
  /// @return ruleset The project's current ruleset.
@@ -175,8 +175,8 @@ interface IJBTerminalStore {
175
175
  /// @notice Simulates a payment without modifying state.
176
176
  /// @param terminal The terminal to simulate the payment from.
177
177
  /// @param payer The address of the payer.
178
- /// @param amount The amount being paid.
179
- /// @param projectId The ID of the project being paid.
178
+ /// @param amount The amount to pay.
179
+ /// @param projectId The ID of the project to pay.
180
180
  /// @param beneficiary The address to mint project tokens to.
181
181
  /// @param metadata Extra data to pass along to the data hook.
182
182
  /// @return ruleset The project's current ruleset.
@@ -237,15 +237,15 @@ interface IJBTerminalStore {
237
237
 
238
238
  /// @notice Records a balance addition for a project.
239
239
  /// @param projectId The ID of the project.
240
- /// @param token The token being added.
241
- /// @param amount The amount being added.
240
+ /// @param token The token added.
241
+ /// @param amount The amount added.
242
242
  function recordAddedBalanceFor(uint256 projectId, address token, uint256 amount) external;
243
243
 
244
244
  /// @notice Records a cash out from a project.
245
245
  /// @param holder The address cashing out.
246
- /// @param projectId The ID of the project being cashed out from.
247
- /// @param cashOutCount The number of project tokens being cashed out.
248
- /// @param tokenToReclaim The token being reclaimed.
246
+ /// @param projectId The ID of the project to cash out from.
247
+ /// @param cashOutCount The number of project tokens to cash out.
248
+ /// @param tokenToReclaim The token to reclaim.
249
249
  /// @param beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address. Passed through to data
250
250
  /// hooks so they can skip their own fees when value stays in the protocol (e.g. project-to-project routing).
251
251
  /// @param metadata Extra data to pass along to the data hook.
@@ -271,8 +271,8 @@ interface IJBTerminalStore {
271
271
 
272
272
  /// @notice Records a payment to a project.
273
273
  /// @param payer The address of the payer.
274
- /// @param amount The amount being paid.
275
- /// @param projectId The ID of the project being paid.
274
+ /// @param amount The amount to pay.
275
+ /// @param projectId The ID of the project to pay.
276
276
  /// @param beneficiary The address to mint project tokens to.
277
277
  /// @param metadata Extra data to pass along to the data hook.
278
278
  /// @return ruleset The project's current ruleset.
@@ -290,8 +290,8 @@ interface IJBTerminalStore {
290
290
 
291
291
  /// @notice Records a payout from a project.
292
292
  /// @param projectId The ID of the project paying out.
293
- /// @param token The token being paid out.
294
- /// @param amount The amount being paid out.
293
+ /// @param token The token to pay out.
294
+ /// @param amount The amount to pay out.
295
295
  /// @param currency The currency the amount is denominated in.
296
296
  /// @return ruleset The project's current ruleset.
297
297
  /// @return amountPaidOut The amount paid out in the token's native decimals.
@@ -305,14 +305,14 @@ interface IJBTerminalStore {
305
305
  returns (JBRuleset memory ruleset, uint256 amountPaidOut);
306
306
 
307
307
  /// @notice Records a terminal migration for a project.
308
- /// @param projectId The ID of the project being migrated.
309
- /// @param token The token being migrated.
308
+ /// @param projectId The ID of the project to migrate.
309
+ /// @param token The token to migrate.
310
310
  /// @return balance The balance that was migrated.
311
311
  function recordTerminalMigration(uint256 projectId, address token) external returns (uint256 balance);
312
312
 
313
313
  /// @notice Records surplus allowance usage for a project.
314
314
  /// @param projectId The ID of the project using surplus allowance.
315
- /// @param token The token being used.
315
+ /// @param token The token to use.
316
316
  /// @param amount The amount of surplus allowance to use.
317
317
  /// @param currency The currency the amount is denominated in.
318
318
  /// @return ruleset The project's current ruleset.
@@ -88,7 +88,7 @@ interface IJBTokens {
88
88
  /// @return The credit balance.
89
89
  function creditBalanceOf(address holder, uint256 projectId) external view returns (uint256);
90
90
 
91
- /// @notice Returns the project ID associated with a token.
91
+ /// @notice The project ID that a given ERC-20 token contract is associated with.
92
92
  /// @param token The token to get the project ID of.
93
93
  /// @return The project ID.
94
94
  function projectIdOf(IJBToken token) external view returns (uint256);
@@ -116,13 +116,13 @@ interface IJBTokens {
116
116
 
117
117
  /// @notice Burns tokens and/or credits from a holder's balance.
118
118
  /// @param holder The address to burn tokens from.
119
- /// @param projectId The ID of the project whose tokens are being burned.
119
+ /// @param projectId The ID of the project to burn tokens for.
120
120
  /// @param count The number of tokens to burn.
121
121
  function burnFrom(address holder, uint256 projectId, uint256 count) external;
122
122
 
123
123
  /// @notice Claims tokens from a holder's credits into a beneficiary's account.
124
124
  /// @param holder The address to claim credits from.
125
- /// @param projectId The ID of the project whose tokens are being claimed.
125
+ /// @param projectId The ID of the project to claim tokens for.
126
126
  /// @param count The number of tokens to claim.
127
127
  /// @param beneficiary The address to send the claimed tokens to.
128
128
  function claimTokensFor(address holder, uint256 projectId, uint256 count, address beneficiary) external;
@@ -144,7 +144,7 @@ interface IJBTokens {
144
144
 
145
145
  /// @notice Mints tokens or credits for a holder.
146
146
  /// @param holder The address to mint tokens for.
147
- /// @param projectId The ID of the project whose tokens are being minted.
147
+ /// @param projectId The ID of the project to mint tokens for.
148
148
  /// @param count The number of tokens to mint.
149
149
  /// @return token The project's token, if one exists.
150
150
  function mintFor(address holder, uint256 projectId, uint256 count) external returns (IJBToken token);
@@ -155,14 +155,14 @@ interface IJBTokens {
155
155
  function setTokenFor(uint256 projectId, IJBToken token) external;
156
156
 
157
157
  /// @notice Sets the name and symbol of a project's token.
158
- /// @param projectId The ID of the project whose token is being updated.
158
+ /// @param projectId The ID of the project to update the token for.
159
159
  /// @param name The new name.
160
160
  /// @param symbol The new symbol.
161
161
  function setTokenMetadataFor(uint256 projectId, string calldata name, string calldata symbol) external;
162
162
 
163
163
  /// @notice Transfers credits from one holder to another.
164
164
  /// @param holder The address to transfer credits from.
165
- /// @param projectId The ID of the project whose credits are being transferred.
165
+ /// @param projectId The ID of the project to transfer credits for.
166
166
  /// @param recipient The address to transfer credits to.
167
167
  /// @param count The number of credits to transfer.
168
168
  function transferCreditsFrom(address holder, uint256 projectId, address recipient, uint256 count) external;
@@ -16,11 +16,11 @@ library JBCashOuts {
16
16
  error JBCashOuts_DesiredOutputNotAchievable();
17
17
 
18
18
  /// @notice Returns the amount of surplus terminal tokens which can be reclaimed based on the total surplus, the
19
- /// number of tokens being cashed out, the total token supply, and the ruleset's cash out tax rate.
19
+ /// number of tokens to cash out, the total token supply, and the ruleset's cash out tax rate.
20
20
  /// @param surplus The total amount of surplus terminal tokens.
21
- /// @param cashOutCount The number of tokens being cashed out, as a fixed point number with 18 decimals.
21
+ /// @param cashOutCount The number of tokens to cash out, as a fixed point number with 18 decimals.
22
22
  /// @param totalSupply The total token supply, as a fixed point number with 18 decimals.
23
- /// @param cashOutTaxRate The current ruleset's cash out tax rate.
23
+ /// @param cashOutTaxRate The current ruleset's cash out tax rate, out of `JBConstants.MAX_CASH_OUT_TAX_RATE`.
24
24
  /// @return reclaimableSurplus The amount of surplus tokens that can be reclaimed.
25
25
  function cashOutFrom(
26
26
  uint256 surplus,
@@ -64,7 +64,7 @@ library JBCashOuts {
64
64
  /// @param surplus The total amount of surplus terminal tokens.
65
65
  /// @param desiredOutput The minimum amount of surplus tokens the caller wants to receive.
66
66
  /// @param totalSupply The total token supply, as a fixed point number with 18 decimals.
67
- /// @param cashOutTaxRate The current ruleset's cash out tax rate.
67
+ /// @param cashOutTaxRate The current ruleset's cash out tax rate, out of `JBConstants.MAX_CASH_OUT_TAX_RATE`.
68
68
  /// @return count The minimum number of tokens to cash out.
69
69
  function minCashOutCountFor(
70
70
  uint256 surplus,
@@ -44,9 +44,9 @@ library JBPayoutSplitGroupLib {
44
44
  /// @param splits The splits contract to read splits from.
45
45
  /// @param store The terminal store used to restore balance when a payout fails.
46
46
  /// @param projectId The ID of the project to send the payouts of.
47
- /// @param token The address of the token being paid out.
48
- /// @param rulesetId The ID of the ruleset of the split group being paid.
49
- /// @param amount The total amount being paid out.
47
+ /// @param token The address of the token to pay out.
48
+ /// @param rulesetId The ID of the ruleset of the split group to pay.
49
+ /// @param amount The total amount to pay out.
50
50
  /// @param caller The original caller of the terminal payout flow.
51
51
  /// @return leftoverAmount The leftover amount after split payouts.
52
52
  /// @return amountEligibleForFees The amount of payouts that are eligible for fees.
@@ -121,8 +121,8 @@ library JBPayoutSplitGroupLib {
121
121
  /// @param store The terminal store used to restore balance when a payout fails.
122
122
  /// @param split The split to pay.
123
123
  /// @param projectId The ID of the project the split was specified by.
124
- /// @param token The address of the token being paid out.
125
- /// @param amount The total amount that the split is being paid.
124
+ /// @param token The address of the token to pay out.
125
+ /// @param amount The total amount that the split is paid.
126
126
  /// @param caller The original caller of the terminal payout flow.
127
127
  /// @return netPayoutAmount The amount sent to the split after subtracting fees.
128
128
  function _sendPayoutToSplit(
@@ -8,7 +8,7 @@ import {IJBTerminal} from "../interfaces/IJBTerminal.sol";
8
8
  /// usage. Aggregates across multiple terminals and tokens, converting to a common currency via `JBPrices`.
9
9
  library JBSurplus {
10
10
  /// @notice Gets the total current surplus amount across all of a project's terminals.
11
- /// @dev This amount changes as the value of the balances changes in relation to the currency being used to measure
11
+ /// @dev This amount changes as the value of the balances changes in relation to the currency used to measure
12
12
  /// the project's payout limits.
13
13
  /// @param projectId The ID of the project to get the total surplus for.
14
14
  /// @param terminals The terminals to look for surplus within.
@@ -3,16 +3,17 @@ pragma solidity ^0.8.0;
3
3
 
4
4
  import {JBTokenAmount} from "./JBTokenAmount.sol";
5
5
 
6
- /// @custom:member holder The holder of the tokens being cashed out.
7
- /// @custom:member projectId The ID of the project being cashed out from.
8
- /// @custom:member rulesetId The ID of the ruleset the cash out is being made during.
9
- /// @custom:member cashOutCount The number of project tokens being cashed out.
10
- /// @custom:member cashOutTaxRate The current ruleset's cash out tax rate.
11
- /// @custom:member reclaimedAmount The token amount being reclaimed from the project's terminal balance. Includes the
12
- /// token being
6
+ /// @custom:member holder The holder of the tokens to cash out.
7
+ /// @custom:member projectId The ID of the project to cash out from.
8
+ /// @custom:member rulesetId The ID of the ruleset the cash out is made during.
9
+ /// @custom:member cashOutCount The number of project tokens to cash out.
10
+ /// @custom:member cashOutTaxRate The current ruleset's cash out tax rate, out of
11
+ /// `JBConstants.MAX_CASH_OUT_TAX_RATE`.
12
+ /// @custom:member reclaimedAmount The token amount reclaimed from the project's terminal balance. Includes the
13
+ /// token
13
14
  /// reclaimed, the value, the number of decimals included, and the currency of the amount.
14
- /// @custom:member forwardedAmount The token amount being forwarded to the cash out hook. Includes the token
15
- /// being forwarded, the value, the number of decimals included, and the currency of the amount.
15
+ /// @custom:member forwardedAmount The token amount forwarded to the cash out hook. Includes the token
16
+ /// forwarded, the value, the number of decimals included, and the currency of the amount.
16
17
  /// @custom:member beneficiary The address the reclaimed amount will be sent to.
17
18
  /// @custom:member hookMetadata Extra data specified by the data hook, which is sent to the cash out hook.
18
19
  /// @custom:member cashOutMetadata Extra data specified by the account cashing out, which is sent to the cash out hook.
@@ -4,12 +4,12 @@ pragma solidity ^0.8.0;
4
4
  import {JBTokenAmount} from "./JBTokenAmount.sol";
5
5
 
6
6
  /// @custom:member payer The address the payment originated from.
7
- /// @custom:member projectId The ID of the project being paid.
8
- /// @custom:member rulesetId The ID of the ruleset the payment is being made during.
9
- /// @custom:member amount The payment's token amount. Includes the token being paid, the value, the number of decimals
7
+ /// @custom:member projectId The ID of the project to pay.
8
+ /// @custom:member rulesetId The ID of the ruleset the payment is made during.
9
+ /// @custom:member amount The payment's token amount. Includes the token paid, the value, the number of decimals
10
10
  /// included, and the currency of the amount.
11
- /// @custom:member forwardedAmount The token amount being forwarded to the pay hook. Includes the token
12
- /// being paid, the value, the number of decimals included, and the currency of the amount.
11
+ /// @custom:member forwardedAmount The token amount forwarded to the pay hook. Includes the token
12
+ /// paid, the value, the number of decimals included, and the currency of the amount.
13
13
  /// @custom:member weight The current ruleset's weight (used to determine how many tokens should be minted).
14
14
  /// @custom:member newlyIssuedTokenCount The number of project tokens minted for the beneficiary.
15
15
  /// @custom:member beneficiary The address which receives any tokens this payment yields.
@@ -5,17 +5,18 @@ import {JBTokenAmount} from "./JBTokenAmount.sol";
5
5
 
6
6
  /// @notice Context sent from the terminal to the ruleset's data hook upon cash out.
7
7
  /// @custom:member terminal The terminal that is facilitating the cash out.
8
- /// @custom:member holder The holder of the tokens being cashed out.
9
- /// @custom:member projectId The ID of the project whose tokens are being cashed out.
10
- /// @custom:member rulesetId The ID of the ruleset the cash out is being made during.
11
- /// @custom:member cashOutCount The number of tokens being cashed out, as a fixed point number with 18 decimals.
12
- /// @custom:member totalSupply The total token supply being used for the calculation, as a fixed point number with 18
8
+ /// @custom:member holder The holder of the tokens to cash out.
9
+ /// @custom:member projectId The ID of the project cashing out tokens.
10
+ /// @custom:member rulesetId The ID of the ruleset the cash out is made during.
11
+ /// @custom:member cashOutCount The number of tokens to cash out, as a fixed point number with 18 decimals.
12
+ /// @custom:member totalSupply The total token supply to use for the calculation, as a fixed point number with 18
13
13
  /// decimals.
14
14
  /// @custom:member surplus The surplus amount used for the calculation, as a fixed point number with 18 decimals.
15
15
  /// Includes the token of the surplus, the surplus value, the number of decimals
16
16
  /// included, and the currency of the surplus.
17
- /// @custom:member useTotalSurplus If surplus across all of a project's terminals is being used when making cash outs.
18
- /// @custom:member cashOutTaxRate The cash out tax rate of the ruleset the cash out is being made during.
17
+ /// @custom:member useTotalSurplus If true, use surplus across all of a project's terminals when calculating cash outs.
18
+ /// @custom:member cashOutTaxRate The cash out tax rate of the ruleset the cash out is made during, out of
19
+ /// `JBConstants.MAX_CASH_OUT_TAX_RATE`.
19
20
  /// @custom:member beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address. Useful for data hooks
20
21
  /// that charge their own fees — they can skip fees when value stays in the protocol (e.g. project-to-project
21
22
  /// routing).
@@ -6,14 +6,15 @@ import {JBTokenAmount} from "./JBTokenAmount.sol";
6
6
  /// @notice Context sent from the terminal to the ruleset's data hook upon payment.
7
7
  /// @custom:member terminal The terminal that is facilitating the payment.
8
8
  /// @custom:member payer The address that the payment originated from.
9
- /// @custom:member amount The payment's token amount, including the token being paid, the value, the number of decimals
9
+ /// @custom:member amount The payment's token amount, including the token paid, the value, the number of decimals
10
10
  /// included, and the currency of the amount.
11
- /// @custom:member projectId The ID of the project being paid.
12
- /// @custom:member rulesetId The ID of the ruleset the payment is being made during.
11
+ /// @custom:member projectId The ID of the project to pay.
12
+ /// @custom:member rulesetId The ID of the ruleset the payment is made during.
13
13
  /// @custom:member beneficiary The specified address that should be the beneficiary of anything that this payment
14
14
  /// yields.
15
- /// @custom:member weight The weight of the ruleset during which the payment is being made.
16
- /// @custom:member reservedPercent The reserved percent of the ruleset the payment is being made during.
15
+ /// @custom:member weight The weight of the ruleset during which the payment is made.
16
+ /// @custom:member reservedPercent The reserved percent of the ruleset the payment is made during, out of
17
+ /// `JBConstants.MAX_RESERVED_PERCENT`.
17
18
  /// @custom:member metadata Extra data specified by the payer.
18
19
  struct JBBeforePayRecordedContext {
19
20
  address terminal;
@@ -2,7 +2,7 @@
2
2
  pragma solidity ^0.8.0;
3
3
 
4
4
  /// @custom:member amount The total amount the fee was taken from, as a fixed point number with the same number of
5
- /// decimals as the terminal in which this struct was created.
5
+ /// decimals as the token's accounting context.
6
6
  /// @custom:member beneficiary The address that will receive the tokens that are minted as a result of the fee payment.
7
7
  /// @custom:member unlockTimestamp The timestamp at which the fee is unlocked and can be processed.
8
8
  struct JBFee {
@@ -1,11 +1,11 @@
1
1
  // SPDX-License-Identifier: MIT
2
2
  pragma solidity ^0.8.0;
3
3
 
4
- /// @custom:member operator The address that permissions are being given to.
5
- /// @custom:member projectId The ID of the project the operator is being given permissions for. Operators only have
4
+ /// @custom:member operator The address to give permissions to.
5
+ /// @custom:member projectId The ID of the project to give the operator permissions for. Operators only have
6
6
  /// permissions under this project's scope. An ID of 0 is a wildcard, which gives an operator permissions across all
7
7
  /// projects.
8
- /// @custom:member permissionIds The IDs of the permissions being given. See the `JBPermissionIds` library.
8
+ /// @custom:member permissionIds The IDs of the permissions to grant. See the `JBPermissionIds` library.
9
9
  struct JBPermissionsData {
10
10
  address operator;
11
11
  uint64 projectId;
@@ -15,8 +15,9 @@ import {IJBRulesetApprovalHook} from "./../interfaces/IJBRulesetApprovalHook.sol
15
15
  /// @custom:member duration How many seconds the ruleset lasts. 0 = no auto-cycling (must be explicitly replaced).
16
16
  /// @custom:member weight Tokens minted per unit paid (18 decimals). The terminal divides payment amount by weight to
17
17
  /// determine token issuance. Higher weight = more tokens per unit of payment.
18
- /// @custom:member weightCutPercent How much to reduce weight each cycle (out of 1,000,000,000). 100,000,000 = 10% cut
19
- /// per cycle. 0 = no decay. Only applies when a cycle auto-rolls without an explicitly queued replacement.
18
+ /// @custom:member weightCutPercent How much to reduce weight each cycle, out of
19
+ /// `JBConstants.MAX_WEIGHT_CUT_PERCENT`. 100,000,000 = 10% cut per cycle. 0 = no decay. Only applies when a cycle
20
+ /// auto-rolls without an explicitly queued replacement.
20
21
  /// @custom:member approvalHook A contract that gates whether queued rulesets can take effect (e.g. `JBDeadline` for
21
22
  /// minimum notice periods). If the hook rejects a queued ruleset, the current one continues.
22
23
  /// @custom:member metadata Packed 256-bit field containing reservedPercent, cashOutTaxRate, baseCurrency, boolean
@@ -14,7 +14,8 @@ import {JBSplitGroup} from "./JBSplitGroup.sol";
14
14
  /// @custom:member duration How long the ruleset lasts in seconds. 0 = stays active until explicitly replaced.
15
15
  /// @custom:member weight Tokens minted per unit of payment (18 decimals). Pass 1 to inherit decayed weight from the
16
16
  /// previous ruleset. Pass 0 for no token issuance.
17
- /// @custom:member weightCutPercent Decay rate per cycle (out of 1,000,000,000). 100,000,000 = 10% cut. 0 = no decay.
17
+ /// @custom:member weightCutPercent Decay rate per cycle, out of `JBConstants.MAX_WEIGHT_CUT_PERCENT`. 100,000,000 =
18
+ /// 10% cut. 0 = no decay.
18
19
  /// @custom:member approvalHook Contract that must approve the *next* queued ruleset for it to take effect.
19
20
  /// @custom:member metadata The ruleset's behavioral flags and parameters (see `JBRulesetMetadata`).
20
21
  /// @custom:member splitGroups How payouts and reserved tokens are distributed during this ruleset.
@@ -3,10 +3,11 @@ pragma solidity ^0.8.0;
3
3
 
4
4
  /// @notice Human-readable configuration for a ruleset's behavioral flags and parameters. This struct is packed into
5
5
  /// 256 bits for on-chain storage (see `JBRulesetMetadataResolver` for the packing layout).
6
- /// @custom:member reservedPercent Percentage of newly minted tokens set aside for the reserved token split group
7
- /// (0–10,000 basis points). 5,000 = 50% reserved.
8
- /// @custom:member cashOutTaxRate Tax applied when holders cash out tokens (0–10,000 basis points). Higher rate = less
9
- /// reclaim per token. 0 = proportional, 10,000 = no reclaim (100% tax).
6
+ /// @custom:member reservedPercent Percentage of newly minted tokens set aside for the reserved token split group,
7
+ /// out of `JBConstants.MAX_RESERVED_PERCENT`. 5,000 = 50% reserved.
8
+ /// @custom:member cashOutTaxRate Tax applied when holders cash out tokens, out of
9
+ /// `JBConstants.MAX_CASH_OUT_TAX_RATE`. Higher rate = less reclaim per token. 0 = proportional, 10,000 = no reclaim
10
+ /// (100% tax).
10
11
  /// @custom:member baseCurrency The currency used to interpret the ruleset's weight for token issuance. Convention:
11
12
  /// `uint32(uint160(tokenAddress))` for tokens, or `JBCurrencyIds.ETH`/`JBCurrencyIds.USD` for well-known currencies.
12
13
  /// @custom:member pausePay If `true`, the project cannot receive payments during this ruleset.
@@ -21,7 +22,7 @@ pragma solidity ^0.8.0;
21
22
  /// @custom:member ownerMustSendPayouts If `true`, only the project owner can trigger payout distribution.
22
23
  /// @custom:member holdFees If `true`, fees are accumulated but not processed until a future ruleset (or manually).
23
24
  /// @custom:member useTotalSurplusForCashOuts If `true`, cash-out calculations use surplus across all terminals (not
24
- /// just the one being cashed out from).
25
+ /// just the one to cash out from).
25
26
  /// @custom:member useDataHookForPay If `true`, the data hook is called before recording payments.
26
27
  /// @custom:member useDataHookForCashOut If `true`, the data hook is called before recording cash outs.
27
28
  /// @custom:member dataHook Contract called before pay/cash-out to potentially override token counts or add hooks.
@@ -3,8 +3,8 @@ pragma solidity ^0.8.0;
3
3
 
4
4
  import {JBSplit} from "./JBSplit.sol";
5
5
 
6
- /// @custom:member token The token being sent to the split hook.
7
- /// @custom:member amount The amount being sent to the split hook, as a fixed point number.
6
+ /// @custom:member token The token to send to the split hook.
7
+ /// @custom:member amount The amount to send to the split hook, as a fixed point number.
8
8
  /// @custom:member decimals The number of decimals in the amount.
9
9
  /// @custom:member projectId The project the split belongs to.
10
10
  /// @custom:member groupId The group the split belongs to. By convention, this ID is `uint256(uint160(tokenAddress))`