@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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bananapus/core-v6",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@ import {JBChainlinkV3PriceFeed} from "./JBChainlinkV3PriceFeed.sol";
8
8
 
9
9
  /// @notice Extends `JBChainlinkV3PriceFeed` with L2 sequencer uptime checks (for Optimism, Arbitrum, etc.). Reverts if
10
10
  /// the sequencer is down or has not been back online for at least `GRACE_PERIOD_TIME` seconds — preventing stale
11
- /// prices from being used immediately after an outage.
11
+ /// prices from to use immediately after an outage.
12
12
  contract JBChainlinkV3SequencerPriceFeed is JBChainlinkV3PriceFeed {
13
13
  //*********************************************************************//
14
14
  // --------------------------- custom errors ------------------------- //
@@ -176,7 +176,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
176
176
  /// ruleset must have `allowAddPriceFeed` enabled.
177
177
  /// @param projectId The ID of the project to add the feed for.
178
178
  /// @param pricingCurrency The currency the feed's output price is in terms of.
179
- /// @param unitCurrency The currency being priced by the feed.
179
+ /// @param unitCurrency The currency the feed prices.
180
180
  /// @param feed The address of the price feed to add.
181
181
  function addPriceFeedFor(
182
182
  uint256 projectId,
@@ -204,7 +204,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
204
204
 
205
205
  /// @notice Called after this controller has been set as the project's controller in the directory.
206
206
  /// @dev Can only be called by the directory.
207
- /// @param from The controller being migrated from.
207
+ /// @param from The controller to migrate from.
208
208
  /// @param projectId The ID of the project that migrated to this controller.
209
209
  function afterReceiveMigrationFrom(IERC165 from, uint256 projectId) external view override {
210
210
  from; // Suppress unused variable warning.
@@ -214,9 +214,9 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
214
214
  if (_msgSender() != address(DIRECTORY)) revert JBController_OnlyDirectory(_msgSender(), DIRECTORY);
215
215
  }
216
216
 
217
- /// @notice Prepares this controller to receive a project being migrated from another controller.
217
+ /// @notice Prepares this controller to receive a project to migrate from another controller.
218
218
  /// @dev This controller should not be the project's controller yet.
219
- /// @param from The controller being migrated from.
219
+ /// @param from The controller to migrate from.
220
220
  /// @param projectId The ID of the project that will migrate to this controller.
221
221
  function beforeReceiveMigrationFrom(IERC165 from, uint256 projectId) external override {
222
222
  // Keep a reference to the sender.
@@ -243,8 +243,8 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
243
243
  /// @notice Burns a holder's project tokens (or credits), permanently removing them from supply. Used by terminals
244
244
  /// during cash outs, or directly by holders who want to burn voluntarily.
245
245
  /// @dev Can only be called by the holder, an operator with `BURN_TOKENS` permission, or a project terminal.
246
- /// @param holder The address whose tokens are being burned.
247
- /// @param projectId The ID of the project whose tokens are being burned.
246
+ /// @param holder The address to burn tokens for.
247
+ /// @param projectId The ID of the project to burn tokens for.
248
248
  /// @param tokenCount The number of tokens to burn.
249
249
  /// @param memo A memo to pass along to the emitted event.
250
250
  function burnTokensOf(
@@ -279,7 +279,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
279
279
  /// wallet. Credits and ERC-20 tokens are interchangeable — this just makes them transferable/tradeable.
280
280
  /// @dev Can only be called by the credit holder or an operator with `CLAIM_TOKENS` permission.
281
281
  /// @param holder The address to redeem credits from.
282
- /// @param projectId The ID of the project whose tokens are being claimed.
282
+ /// @param projectId The ID of the project to claim tokens for.
283
283
  /// @param tokenCount The number of tokens to claim.
284
284
  /// @param beneficiary The account the claimed tokens will go to.
285
285
  function claimTokensFor(
@@ -338,9 +338,9 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
338
338
  /// terminal.
339
339
  /// @dev Can only be called by this controller.
340
340
  /// @param terminal The terminal to pay.
341
- /// @param projectId The ID of the project being paid.
342
- /// @param token The token being paid with.
343
- /// @param splitTokenCount The number of tokens being paid.
341
+ /// @param projectId The ID of the project to pay.
342
+ /// @param token The token to pay with.
343
+ /// @param splitTokenCount The number of tokens to pay.
344
344
  /// @param beneficiary The payment's beneficiary.
345
345
  /// @param metadata The pay metadata sent to the terminal.
346
346
  function executePayReservedTokenToTerminal(
@@ -521,7 +521,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
521
521
  /// reserved percent (which accumulates until `sendReservedTokensToSplitsOf` is called).
522
522
  /// @dev Can be called by the project owner, an operator with `MINT_TOKENS` permission, a project terminal, or the
523
523
  /// data hook. If `allowOwnerMinting` is false in the current ruleset, only terminals and the data hook can mint.
524
- /// @param projectId The ID of the project whose tokens are being minted.
524
+ /// @param projectId The ID of the project to mint tokens for.
525
525
  /// @param tokenCount The number of tokens to mint, including any reserved tokens.
526
526
  /// @param beneficiary The address which will receive the (non-reserved) tokens.
527
527
  /// @param memo A memo to pass along to the emitted event.
@@ -694,7 +694,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
694
694
  /// @notice Sets the name and symbol of a project's token.
695
695
  /// @dev Can only be called by the project's owner or an address with the owner's permission to
696
696
  /// `SET_TOKEN_METADATA`.
697
- /// @param projectId The ID of the project whose token is being updated.
697
+ /// @param projectId The ID of the project to update the token for.
698
698
  /// @param name The new name.
699
699
  /// @param symbol The new symbol.
700
700
  function setTokenMetadataOf(uint256 projectId, string calldata name, string calldata symbol) external override {
@@ -729,7 +729,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
729
729
  /// @dev Can only be called by the credit holder or an operator with `TRANSFER_CREDITS` permission. The current
730
730
  /// ruleset must not have credit transfers paused.
731
731
  /// @param holder The address to transfer credits from.
732
- /// @param projectId The ID of the project whose credits are being transferred.
732
+ /// @param projectId The ID of the project to transfer credits for.
733
733
  /// @param recipient The address to transfer credits to.
734
734
  /// @param creditCount The number of credits to transfer.
735
735
  function transferCreditsFrom(
@@ -844,7 +844,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
844
844
  }
845
845
 
846
846
  /// @notice Previews how many beneficiary and reserved tokens `mintTokensOf(...)` would produce.
847
- /// @param projectId The ID of the project whose tokens are being minted.
847
+ /// @param projectId The ID of the project to mint tokens for.
848
848
  /// @param tokenCount The number of tokens to mint, including any reserved tokens.
849
849
  /// @param useReservedPercent Whether to apply the ruleset's reserved percent.
850
850
  /// @return beneficiaryTokenCount The number of tokens that would be minted for the beneficiary.
@@ -960,7 +960,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
960
960
 
961
961
  /// @notice Queues one or more rulesets and stores information pertinent to the configuration.
962
962
  /// @param projectId The ID of the project to queue rulesets for.
963
- /// @param rulesetConfigurations The rulesets being queued.
963
+ /// @param rulesetConfigurations The rulesets to queue.
964
964
  /// @return rulesetId The ID of the last ruleset that was successfully queued.
965
965
  function _queueRulesets(
966
966
  uint256 projectId,
@@ -1238,7 +1238,7 @@ contract JBController is JBPermissioned, ERC2771Context, IJBController, IJBMigra
1238
1238
 
1239
1239
  /// @notice Splits a token count into beneficiary and reserved portions.
1240
1240
  /// @param tokenCount The total token count, including reserved tokens.
1241
- /// @param reservedPercent The reserved percent to apply.
1241
+ /// @param reservedPercent The reserved percent to apply, out of `JBConstants.MAX_RESERVED_PERCENT`.
1242
1242
  /// @return beneficiaryTokenCount The number of tokens for the beneficiary.
1243
1243
  /// @return reservedTokenCount The number of tokens to reserve.
1244
1244
  function _splitTokenCount(
@@ -93,7 +93,7 @@ contract JBDirectory is JBPermissioned, Ownable, IJBDirectory {
93
93
  /// `SET_CONTROLLER` permission.
94
94
  /// - OR the caller is the project's current controller.
95
95
  /// - OR the caller `isAllowedToSetFirstController` and the project has no controller yet.
96
- /// @param projectId The ID of the project whose controller is being set.
96
+ /// @param projectId The ID of the project to set the controller for.
97
97
  /// @param controller The address of the controller to set.
98
98
  function setControllerOf(uint256 projectId, IERC165 controller) external override {
99
99
  // Keep a reference to the current controller.
@@ -172,9 +172,9 @@ contract JBDirectory is JBPermissioned, Ownable, IJBDirectory {
172
172
  /// @dev Can only be called by the project's owner or an address with `SET_PRIMARY_TERMINAL` permission. The
173
173
  /// terminal must accept the token for this project. If the terminal isn't already in the project's terminal list,
174
174
  /// it will be added automatically (requires `ADD_TERMINALS` permission).
175
- /// @param projectId The ID of the project whose primary terminal is being set.
175
+ /// @param projectId The ID of the project to set the primary terminal for.
176
176
  /// @param token The token to set the primary terminal for.
177
- /// @param terminal The terminal being set as the primary terminal.
177
+ /// @param terminal The terminal to set as the primary terminal.
178
178
  function setPrimaryTerminalOf(uint256 projectId, address token, IJBTerminal terminal) external override {
179
179
  // Enforce permissions.
180
180
  _requirePermissionFrom({
@@ -209,7 +209,7 @@ contract JBDirectory is JBPermissioned, Ownable, IJBDirectory {
209
209
  /// cash outs for a project. This overwrites the existing list.
210
210
  /// @dev Can only be called by the project's owner, an address with `SET_TERMINALS` permission, or the project's
211
211
  /// controller. Unless the caller is the controller, the ruleset must have `allowSetTerminals` enabled.
212
- /// @param projectId The ID of the project whose terminals are being set.
212
+ /// @param projectId The ID of the project to set terminals for.
213
213
  /// @param terminals An array of terminal addresses to set for the project.
214
214
  function setTerminalsOf(uint256 projectId, IJBTerminal[] calldata terminals) external override {
215
215
  // Cache the controller to avoid redundant storage reads.
package/src/JBERC20.sol CHANGED
@@ -127,7 +127,7 @@ contract JBERC20 is ERC20Votes, ERC20Permit, JBPermissioned, IERC1271, IJBToken
127
127
  /// @notice Validates a signature on behalf of this token contract (ERC-1271).
128
128
  /// @dev Allows the project owner or an operator with `SIGN_FOR_ERC20` permission to sign messages on behalf of
129
129
  /// this token. Useful for Etherscan contract verification and other off-chain signature flows.
130
- /// @param hash The hash of the data being signed.
130
+ /// @param hash The hash of the data to sign.
131
131
  /// @param signature The signature to validate.
132
132
  /// @return magicValue `0x1626ba7e` if the signature is valid, `0xffffffff` otherwise.
133
133
  function isValidSignature(bytes32 hash, bytes memory signature) external view override returns (bytes4 magicValue) {
@@ -170,17 +170,17 @@ contract JBERC20 is ERC20Votes, ERC20Permit, JBPermissioned, IERC1271, IJBToken
170
170
  return super.decimals();
171
171
  }
172
172
 
173
- /// @notice The token's name.
173
+ /// @notice The token's name, set during initialization.
174
174
  function name() public view virtual override returns (string memory) {
175
175
  return _name;
176
176
  }
177
177
 
178
- /// @notice Required override.
178
+ /// @notice The current nonce for a given account, used for permit signatures.
179
179
  function nonces(address owner) public view virtual override(ERC20Permit, Nonces) returns (uint256) {
180
180
  return super.nonces(owner);
181
181
  }
182
182
 
183
- /// @notice The token's symbol.
183
+ /// @notice The token's ticker symbol, set during initialization.
184
184
  function symbol() public view virtual override returns (string memory) {
185
185
  return _symbol;
186
186
  }
@@ -195,7 +195,7 @@ contract JBERC20 is ERC20Votes, ERC20Permit, JBPermissioned, IERC1271, IJBToken
195
195
  // ----------------------- public transactions ----------------------- //
196
196
  //*********************************************************************//
197
197
 
198
- /// @notice Initializes the token.
198
+ /// @notice Initialize a new project token with the given name, symbol, and owner.
199
199
  /// @param name_ The token's name.
200
200
  /// @param symbol_ The token's symbol.
201
201
  /// @param tokens The JBTokens contract that manages this token.
@@ -70,7 +70,7 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
70
70
  /// surplus. Both reset each funding cycle.
71
71
  /// @dev Only a project's controller can set fund access limits (called during `queueRulesetsOf`).
72
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 whose fund access limits are being set.
73
+ /// @param projectId The ID of the project to set fund access limits for.
74
74
  /// @param rulesetId The ID of the ruleset that the limits will apply within.
75
75
  /// @param fundAccessLimitGroups An array containing payout limits and surplus allowances for each payment terminal.
76
76
  /// Amounts are fixed point numbers using the same number of decimals as the associated terminal.
@@ -159,7 +159,7 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
159
159
 
160
160
  /// @notice Look up how much a project can distribute (via `sendPayoutsOf`) from a specific terminal and token,
161
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.
162
+ /// @dev The fixed point return amount uses the same number of decimals as the token's accounting context.
163
163
  /// @param projectId The project's ID.
164
164
  /// @param rulesetId The ruleset's ID.
165
165
  /// @param terminal The terminal the payout limit applies to.
@@ -203,7 +203,7 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
203
203
 
204
204
  /// @notice Get all payout limits for a project's terminal and token during a ruleset. A project can have multiple
205
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.
206
+ /// @dev The fixed point `amount`s returned use the same number of decimals as the token's accounting context.
207
207
  /// @param projectId The project's ID.
208
208
  /// @param rulesetId The ruleset's ID.
209
209
  /// @param terminal The terminal the payout limits apply to.
@@ -250,7 +250,7 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
250
250
 
251
251
  /// @notice Look up how much a project's owner can withdraw from the surplus (via `useAllowanceOf`) from a specific
252
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.
253
+ /// @dev The fixed point return amount uses the same number of decimals as the token's accounting context.
254
254
  /// @param projectId The project's ID.
255
255
  /// @param rulesetId The ruleset's ID.
256
256
  /// @param terminal The terminal the surplus allowance applies to.
@@ -295,7 +295,7 @@ contract JBFundAccessLimits is JBControlled, IJBFundAccessLimits {
295
295
 
296
296
  /// @notice Get all surplus allowances for a project's terminal and token during a ruleset. Like payout limits, a
297
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.
298
+ /// @dev The fixed point `amount`s returned use the same number of decimals as the token's accounting context.
299
299
  /// @param projectId The project's ID.
300
300
  /// @param rulesetId The ruleset's ID.
301
301
  /// @param terminal The terminal the surplus allowances apply to.