@bananapus/core-v6 0.0.81 → 0.0.83
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/README.md +11 -11
- package/package.json +3 -3
- package/references/entrypoints.md +1 -1
- package/references/types-errors-events.md +8 -8
- package/src/JBChainlinkV3PriceFeed.sol +5 -0
- package/src/JBChainlinkV3SequencerPriceFeed.sol +3 -0
- package/src/JBController.sol +41 -17
- package/src/JBDirectory.sol +11 -4
- package/src/JBERC20.sol +3 -0
- package/src/JBFeelessAddresses.sol +3 -0
- package/src/JBFundAccessLimits.sol +5 -0
- package/src/JBMultiTerminal.sol +45 -35
- package/src/JBPermissions.sol +8 -5
- package/src/JBPrices.sol +9 -0
- package/src/JBProjects.sol +5 -0
- package/src/JBRulesets.sol +22 -16
- package/src/JBSplits.sol +5 -0
- package/src/JBTerminalStore.sol +34 -13
- package/src/JBTokens.sol +21 -0
- package/src/abstract/JBControlled.sol +1 -0
- package/src/abstract/JBPermissioned.sol +2 -3
- package/src/enums/JBApprovalStatus.sol +6 -6
- package/src/interfaces/IJBCashOutTerminal.sol +1 -2
- package/src/interfaces/IJBController.sol +2 -2
- package/src/interfaces/IJBFeelessAddresses.sol +1 -2
- package/src/interfaces/IJBFeelessHook.sol +2 -2
- package/src/libraries/JBMetadataResolver.sol +9 -1
- package/src/libraries/JBPayoutSplitGroupLib.sol +14 -0
- package/src/periphery/JBMatchingPriceFeed.sol +3 -1
- package/src/structs/JBAccountingContext.sol +1 -2
- package/src/structs/JBAfterCashOutRecordedContext.sol +1 -2
- package/src/structs/JBCashOutHookSpecification.sol +1 -2
- package/src/structs/JBPayHookSpecification.sol +1 -2
- package/src/structs/JBSplit.sol +1 -2
|
@@ -329,8 +329,8 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
329
329
|
/// @notice Mints new project tokens (or credits) to a beneficiary, optionally reserving a portion for the ruleset's
|
|
330
330
|
/// reserved splits.
|
|
331
331
|
/// @param projectId The ID of the project whose project tokens are being minted.
|
|
332
|
-
/// @param tokenCount The total number of project tokens to mint
|
|
333
|
-
/// `useReservedPercent` is true
|
|
332
|
+
/// @param tokenCount The total number of project tokens to mint, including reserved tokens if
|
|
333
|
+
/// `useReservedPercent` is true.
|
|
334
334
|
/// @param beneficiary The address that receives the non-reserved portion of the minted project tokens.
|
|
335
335
|
/// @param memo A memo to pass along to the emitted event.
|
|
336
336
|
/// @param useReservedPercent Whether to apply the ruleset's reserved percent.
|
|
@@ -13,8 +13,7 @@ interface IJBFeelessAddresses {
|
|
|
13
13
|
/// @param caller The address that set the feeless status.
|
|
14
14
|
event SetFeelessAddress(uint256 indexed projectId, address indexed addr, bool indexed isFeeless, address caller);
|
|
15
15
|
|
|
16
|
-
/// @notice The optional
|
|
17
|
-
/// zero address to disable.
|
|
16
|
+
/// @notice The optional owner-set hook that can grant feeless status. Set to the zero address to disable.
|
|
18
17
|
/// @param hook The new feeless hook. The zero address disables hook consultation.
|
|
19
18
|
/// @param caller The address that set the hook.
|
|
20
19
|
event SetFeelessHook(IJBFeelessHook indexed hook, address caller);
|
|
@@ -17,8 +17,8 @@ interface IJBFeelessHook is IERC165 {
|
|
|
17
17
|
/// the terminal (so it gets fee-free cash-outs when zapping, but does NOT get feeless status when it merely
|
|
18
18
|
/// appears as a split recipient of someone else's payout).
|
|
19
19
|
/// @param projectId The ID of the project the fee would be charged on behalf of.
|
|
20
|
-
/// @param addr The address being checked
|
|
21
|
-
///
|
|
20
|
+
/// @param addr The address being checked, typically a payout recipient, surplus allowance beneficiary, or cash-out
|
|
21
|
+
/// beneficiary.
|
|
22
22
|
/// @param caller The outer caller that initiated the terminal operation, or `address(0)` if not provided.
|
|
23
23
|
/// @return A flag indicating whether the address is feeless for the project under the hook's custom logic.
|
|
24
24
|
function isFeeless(uint256 projectId, address addr, address caller) external view returns (bool);
|
|
@@ -25,9 +25,16 @@ pragma solidity 0.8.28;
|
|
|
25
25
|
* +-----------------------+
|
|
26
26
|
*/
|
|
27
27
|
library JBMetadataResolver {
|
|
28
|
+
/// @notice Thrown when the data to add is not padded to a multiple of 32 bytes.
|
|
28
29
|
error JBMetadataResolver_DataNotPadded(uint256 dataLength);
|
|
30
|
+
|
|
31
|
+
/// @notice Thrown when the IDs and datas arrays have mismatched lengths.
|
|
29
32
|
error JBMetadataResolver_LengthMismatch(uint256 idsLength, uint256 datasLength);
|
|
33
|
+
|
|
34
|
+
/// @notice Thrown when the metadata offset exceeds the maximum addressable offset of 255.
|
|
30
35
|
error JBMetadataResolver_MetadataTooLong(uint256 offset, uint256 maxOffset);
|
|
36
|
+
|
|
37
|
+
/// @notice Thrown when the metadata is shorter than the minimum required length.
|
|
31
38
|
error JBMetadataResolver_MetadataTooShort(uint256 metadataLength, uint256 minMetadataLength);
|
|
32
39
|
|
|
33
40
|
// Constants alphabetized per STYLE_GUIDE; trailing comments document derivation.
|
|
@@ -260,7 +267,7 @@ library JBMetadataResolver {
|
|
|
260
267
|
if (parsedId == id) {
|
|
261
268
|
// Are we at the end of the lookup table (either at the start of data's or next offset is 0/in the
|
|
262
269
|
// padding)
|
|
263
|
-
// If not, only return until from this offset to the
|
|
270
|
+
// If not, only return until from this offset to the beginning of the next offset
|
|
264
271
|
uint256 end = (i + NEXT_ID_OFFSET >= firstOffset * WORD_SIZE || metadata[i + NEXT_ID_OFFSET] == 0)
|
|
265
272
|
? metadata.length
|
|
266
273
|
: uint256(uint8(metadata[i + NEXT_ID_OFFSET])) * WORD_SIZE;
|
|
@@ -295,6 +302,7 @@ library JBMetadataResolver {
|
|
|
295
302
|
/// @param start The start index to slice at.
|
|
296
303
|
/// @param end The end index to slice at.
|
|
297
304
|
/// @param slicedBytes The sliced array.
|
|
305
|
+
/// @return slicedBytes The sliced array.
|
|
298
306
|
function _sliceBytes(bytes memory data, uint256 start, uint256 end)
|
|
299
307
|
private
|
|
300
308
|
pure
|
|
@@ -44,8 +44,22 @@ interface IJBPayoutSplitGroupExecutor {
|
|
|
44
44
|
/// @dev Extracted as an external library to reduce `JBMultiTerminal` bytecode size. Called via DELEGATECALL, so events
|
|
45
45
|
/// are emitted from the terminal's address.
|
|
46
46
|
library JBPayoutSplitGroupLib {
|
|
47
|
+
/// @notice A payout to a split reverted, so the amount was returned to the project's balance.
|
|
48
|
+
/// @param projectId The ID of the project whose payout reverted.
|
|
49
|
+
/// @param split The split that was being paid when the revert occurred.
|
|
50
|
+
/// @param amount The amount that was being sent to the split.
|
|
51
|
+
/// @param reason The reason the payout reverted.
|
|
52
|
+
/// @param caller The address that called the payout function.
|
|
47
53
|
event PayoutReverted(uint256 indexed projectId, JBSplit split, uint256 amount, bytes reason, address caller);
|
|
48
54
|
|
|
55
|
+
/// @notice A payout was sent to a split.
|
|
56
|
+
/// @param projectId The ID of the project that the payout was made from.
|
|
57
|
+
/// @param rulesetId The ID of the ruleset the split belongs to.
|
|
58
|
+
/// @param group The group the split belongs to.
|
|
59
|
+
/// @param split The split that was paid.
|
|
60
|
+
/// @param amount The amount that was sent to the split.
|
|
61
|
+
/// @param netAmount The amount that the split recipient actually received, after fees.
|
|
62
|
+
/// @param caller The address that called the payout function.
|
|
49
63
|
event SendPayoutToSplit(
|
|
50
64
|
uint256 indexed projectId,
|
|
51
65
|
uint256 indexed rulesetId,
|
|
@@ -8,7 +8,9 @@ import {IJBPriceFeed} from "../interfaces/IJBPriceFeed.sol";
|
|
|
8
8
|
contract JBMatchingPriceFeed is IJBPriceFeed {
|
|
9
9
|
constructor() {}
|
|
10
10
|
|
|
11
|
-
/// @
|
|
11
|
+
/// @notice Gets the current price (per 1 unit) from the feed.
|
|
12
|
+
/// @param decimals The number of decimals the return value should use.
|
|
13
|
+
/// @return The current unit price from the feed, as a fixed point number with the specified number of decimals.
|
|
12
14
|
function currentUnitPrice(uint256 decimals) public view virtual override returns (uint256) {
|
|
13
15
|
return 10 ** decimals;
|
|
14
16
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity ^0.8.0;
|
|
3
3
|
|
|
4
|
-
/// @notice Describes how a terminal accounts for a specific token — its address, decimal precision, and
|
|
5
|
-
/// currency
|
|
4
|
+
/// @notice Describes how a terminal accounts for a specific token — its address, decimal precision, and the currency
|
|
6
5
|
/// it's priced in. Used when recording payments, payouts, and cash outs to ensure correct fixed-point arithmetic.
|
|
7
6
|
/// @custom:member token The token address (use `JBConstants.NATIVE_TOKEN` for ETH).
|
|
8
7
|
/// @custom:member decimals The number of decimals for this token's fixed-point amounts (e.g. 18 for ETH, 6 for USDC).
|
|
@@ -9,8 +9,7 @@ import {JBTokenAmount} from "./JBTokenAmount.sol";
|
|
|
9
9
|
/// @custom:member cashOutCount The number of project tokens to cash out.
|
|
10
10
|
/// @custom:member cashOutTaxRate The current ruleset's cash out tax rate, out of
|
|
11
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
|
|
12
|
+
/// @custom:member reclaimedAmount The token amount reclaimed from the project's terminal balance. Includes the token
|
|
14
13
|
/// reclaimed, the value, the number of decimals included, and the currency of the amount.
|
|
15
14
|
/// @custom:member forwardedAmount The token amount forwarded to the cash out hook. Includes the token
|
|
16
15
|
/// forwarded, the value, the number of decimals included, and the currency of the amount.
|
|
@@ -3,8 +3,7 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {IJBCashOutHook} from "../interfaces/IJBCashOutHook.sol";
|
|
5
5
|
|
|
6
|
-
/// @notice A cash out hook specification sent from the ruleset's data hook back to the terminal
|
|
7
|
-
/// fulfilled by the terminal.
|
|
6
|
+
/// @notice A cash out hook specification sent from the ruleset's data hook back to the terminal for fulfillment.
|
|
8
7
|
/// @custom:member hook The cash out hook to use when fulfilling this specification.
|
|
9
8
|
/// @custom:member noop A flag indicating if the hook callback should be skipped.
|
|
10
9
|
/// @custom:member amount The amount to send to the hook.
|
|
@@ -3,8 +3,7 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {IJBPayHook} from "../interfaces/IJBPayHook.sol";
|
|
5
5
|
|
|
6
|
-
/// @notice A pay hook specification sent from the ruleset's data hook back to the terminal
|
|
7
|
-
/// fulfilled by the terminal.
|
|
6
|
+
/// @notice A pay hook specification sent from the ruleset's data hook back to the terminal for fulfillment.
|
|
8
7
|
/// @custom:member hook The pay hook to use when fulfilling this specification.
|
|
9
8
|
/// @custom:member noop A flag indicating if the hook callback should be skipped.
|
|
10
9
|
/// @custom:member amount The amount to send to the hook.
|
package/src/structs/JBSplit.sol
CHANGED
|
@@ -15,8 +15,7 @@ import {IJBSplitHook} from "./../interfaces/IJBSplitHook.sol";
|
|
|
15
15
|
/// `beneficiary`.
|
|
16
16
|
/// @custom:member percent The percent of the total token amount that this split sends. This number is out of
|
|
17
17
|
/// `JBConstants.SPLITS_TOTAL_PERCENT`.
|
|
18
|
-
/// @custom:member projectId The ID of a project to `pay`, if applicable. Resulting tokens
|
|
19
|
-
/// `beneficiary`.
|
|
18
|
+
/// @custom:member projectId The ID of a project to `pay`, if applicable. Resulting tokens are routed to `beneficiary`.
|
|
20
19
|
/// @custom:member beneficiary Receives this split's tokens if the `hook` and `projectId` are zero. If the `projectId`
|
|
21
20
|
/// is specified, the `beneficiary` receives any project tokens minted by this split. If `beneficiary` is `address(0)`,
|
|
22
21
|
/// the application processing the split decides on the recipient. For example, the terminal uses `msg.sender` for
|