@bananapus/core-v6 0.0.39 → 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/package.json +1 -1
- package/src/JBChainlinkV3SequencerPriceFeed.sol +1 -1
- package/src/JBController.sol +15 -15
- package/src/JBDirectory.sol +4 -4
- package/src/JBERC20.sol +5 -5
- package/src/JBFundAccessLimits.sol +1 -1
- package/src/JBMultiTerminal.sol +77 -77
- package/src/JBPermissions.sol +2 -2
- package/src/JBPrices.sol +3 -3
- package/src/JBRulesets.sol +1 -1
- package/src/JBSplits.sol +2 -2
- package/src/JBTerminalStore.sol +33 -33
- package/src/JBTokens.sol +6 -6
- package/src/interfaces/IJBCashOutTerminal.sol +5 -5
- package/src/interfaces/IJBController.sol +10 -10
- package/src/interfaces/IJBMigratable.sol +5 -5
- package/src/interfaces/IJBPayoutTerminal.sol +3 -3
- package/src/interfaces/IJBPermissions.sol +4 -4
- package/src/interfaces/IJBPermitTerminal.sol +1 -1
- package/src/interfaces/IJBPrices.sol +4 -4
- package/src/interfaces/IJBTerminal.sol +10 -10
- package/src/interfaces/IJBTerminalStore.sol +20 -20
- package/src/interfaces/IJBTokens.sol +6 -6
- package/src/libraries/JBCashOuts.sol +2 -2
- package/src/libraries/JBPayoutSplitGroupLib.sol +5 -5
- package/src/libraries/JBSurplus.sol +1 -1
- 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/JBPermissionsData.sol +3 -3
- package/src/structs/JBRulesetMetadata.sol +1 -1
- package/src/structs/JBSplitHookContext.sol +2 -2
package/src/JBPermissions.sol
CHANGED
|
@@ -40,7 +40,7 @@ contract JBPermissions is ERC2771Context, IJBPermissions {
|
|
|
40
40
|
/// permission
|
|
41
41
|
/// is granted. See `JBPermissionIds` for the meaning of each ID.
|
|
42
42
|
/// @custom:param operator The address of the operator.
|
|
43
|
-
/// @custom:param account The address of the account
|
|
43
|
+
/// @custom:param account The address of the account operated on behalf of.
|
|
44
44
|
/// @custom:param projectId The project ID the permissions are scoped to. An ID of 0 grants permissions across all
|
|
45
45
|
/// projects.
|
|
46
46
|
mapping(address operator => mapping(address account => mapping(uint256 projectId => uint256)))
|
|
@@ -62,7 +62,7 @@ contract JBPermissions is ERC2771Context, IJBPermissions {
|
|
|
62
62
|
/// @dev Only the account itself can set permissions without restriction. A ROOT operator on a specific project can
|
|
63
63
|
/// set non-ROOT permissions for that same project on the account's behalf, but cannot grant ROOT or set wildcard
|
|
64
64
|
/// (project ID 0) permissions — preventing privilege escalation.
|
|
65
|
-
/// @param account The account
|
|
65
|
+
/// @param account The account to configure operator permissions for.
|
|
66
66
|
/// @param permissionsData The operator address, project scope, and permission IDs to set.
|
|
67
67
|
function setPermissionsFor(address account, JBPermissionsData calldata permissionsData) external override {
|
|
68
68
|
// Pack the permission IDs into a uint256.
|
package/src/JBPrices.sol
CHANGED
|
@@ -53,7 +53,7 @@ contract JBPrices is JBControlled, JBPermissioned, ERC2771Context, Ownable, IJBP
|
|
|
53
53
|
/// @custom:param projectId The ID of the project the feed applies to. Feeds stored in ID 0 are used by default for
|
|
54
54
|
/// all projects.
|
|
55
55
|
/// @custom:param pricingCurrency The currency the feed's resulting price is in terms of.
|
|
56
|
-
/// @custom:param unitCurrency The currency
|
|
56
|
+
/// @custom:param unitCurrency The currency the feed prices.
|
|
57
57
|
mapping(uint256 projectId => mapping(uint256 pricingCurrency => mapping(uint256 unitCurrency => IJBPriceFeed)))
|
|
58
58
|
public
|
|
59
59
|
override priceFeedFor;
|
|
@@ -95,7 +95,7 @@ contract JBPrices is JBControlled, JBPermissioned, ERC2771Context, Ownable, IJBP
|
|
|
95
95
|
/// authorization. A default feed for a pair blocks per-project overrides for that same pair.
|
|
96
96
|
/// @param projectId The ID of the project to add a feed for. Pass 0 for a protocol-wide default.
|
|
97
97
|
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
98
|
-
/// @param unitCurrency The currency
|
|
98
|
+
/// @param unitCurrency The currency the feed prices.
|
|
99
99
|
/// @param feed The address of the price feed to add.
|
|
100
100
|
function addPriceFeedFor(
|
|
101
101
|
uint256 projectId,
|
|
@@ -165,7 +165,7 @@ contract JBPrices is JBControlled, JBPermissioned, ERC2771Context, Ownable, IJBP
|
|
|
165
165
|
/// default. Reverts with `JBPrices_PriceFeedNotFound` if no feed exists in any direction.
|
|
166
166
|
/// @param projectId The ID of the project to check the feed for. Falls back to project 0 (protocol defaults).
|
|
167
167
|
/// @param pricingCurrency The currency the result is denominated in.
|
|
168
|
-
/// @param unitCurrency The currency
|
|
168
|
+
/// @param unitCurrency The currency to price.
|
|
169
169
|
/// @param decimals The number of decimals the returned fixed point price should include.
|
|
170
170
|
/// @return The `pricingCurrency` price of 1 `unitCurrency`, as a fixed point number with the specified number of
|
|
171
171
|
/// decimals.
|
package/src/JBRulesets.sol
CHANGED
|
@@ -791,7 +791,7 @@ contract JBRulesets is JBControlled, IJBRulesets {
|
|
|
791
791
|
/// @notice Initializes a ruleset with the specified properties.
|
|
792
792
|
/// @param projectId The ID of the project to initialize the ruleset for.
|
|
793
793
|
/// @param baseRuleset The ruleset struct to base the newly initialized one on.
|
|
794
|
-
/// @param rulesetId The `rulesetId` for the ruleset
|
|
794
|
+
/// @param rulesetId The `rulesetId` for the ruleset to initialize.
|
|
795
795
|
/// @param mustStartAtOrAfter The earliest time the ruleset can start. The ruleset cannot start before this
|
|
796
796
|
/// timestamp.
|
|
797
797
|
/// @param weight The weight to give the newly initialized ruleset.
|
package/src/JBSplits.sol
CHANGED
|
@@ -13,7 +13,7 @@ import {JBSplitGroup} from "./structs/JBSplitGroup.sol";
|
|
|
13
13
|
/// their share (as a fraction of 1,000,000,000). Splits can be locked until a timestamp — locked splits cannot be
|
|
14
14
|
/// removed or reduced until the lock expires, providing recipients with guaranteed revenue streams.
|
|
15
15
|
/// @dev Splits are organized by project, ruleset, and group. Ruleset 0 is the fallback used when no splits are set for
|
|
16
|
-
/// the active ruleset. The payout group ID is derived from the token address
|
|
16
|
+
/// the active ruleset. The payout group ID is derived from the token address to distribute.
|
|
17
17
|
contract JBSplits is JBControlled, IJBSplits {
|
|
18
18
|
//*********************************************************************//
|
|
19
19
|
// --------------------------- custom errors ------------------------- //
|
|
@@ -161,7 +161,7 @@ contract JBSplits is JBControlled, IJBSplits {
|
|
|
161
161
|
/// @notice Sets the splits for a group given a project, ruleset, and group ID.
|
|
162
162
|
/// @dev The new splits must include any currently set splits that are locked.
|
|
163
163
|
/// @dev The sum of the split `percent`s within one group must be less than 100%.
|
|
164
|
-
/// @param projectId The ID of the project
|
|
164
|
+
/// @param projectId The ID of the project to set splits for.
|
|
165
165
|
/// @param rulesetId The ID of the ruleset the splits should be considered active within.
|
|
166
166
|
/// @param groupId The ID of the group to set the splits within.
|
|
167
167
|
/// @param splits An array of splits to set.
|
package/src/JBTerminalStore.sol
CHANGED
|
@@ -227,9 +227,9 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
229
|
|
|
230
|
-
/// @notice Records funds
|
|
231
|
-
/// @param projectId The ID of the project which funds are
|
|
232
|
-
/// @param token The token
|
|
230
|
+
/// @notice Records funds added to a project's balance.
|
|
231
|
+
/// @param projectId The ID of the project which funds are added to the balance of.
|
|
232
|
+
/// @param token The token to add to the balance.
|
|
233
233
|
/// @param amount The amount of terminal tokens added, as a fixed point number with the same amount of decimals as
|
|
234
234
|
/// its relative terminal.
|
|
235
235
|
function recordAddedBalanceFor(uint256 projectId, address token, uint256 amount) external override {
|
|
@@ -241,10 +241,10 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
241
241
|
/// @dev Uses the data hook if configured, otherwise applies the bonding curve formula based on cash out tax rate,
|
|
242
242
|
/// surplus, and supply. The terminal calls this before actually burning tokens and transferring funds.
|
|
243
243
|
/// @param holder The account that is cashing out tokens.
|
|
244
|
-
/// @param projectId The ID of the project
|
|
244
|
+
/// @param projectId The ID of the project to cash out from.
|
|
245
245
|
/// @param cashOutCount The number of project tokens to cash out, as supplied by the caller and later burned by the
|
|
246
246
|
/// terminal, as a fixed point number with 18 decimals.
|
|
247
|
-
/// @param tokenToReclaim The token
|
|
247
|
+
/// @param tokenToReclaim The token to reclaim by the cash out.
|
|
248
248
|
/// @param beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address. Passed through to data
|
|
249
249
|
/// hooks so they can skip their own fees when value stays in the protocol (e.g. project-to-project routing).
|
|
250
250
|
/// @param metadata Bytes to send to the data hook, if the project's current ruleset specifies one.
|
|
@@ -318,9 +318,9 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
318
318
|
/// current ruleset's weight. Uses the data hook if configured, otherwise mints proportionally.
|
|
319
319
|
/// @dev Called by the terminal after accepting funds. Updates the project's recorded balance.
|
|
320
320
|
/// @param payer The address that made the payment to the terminal.
|
|
321
|
-
/// @param amount The amount of tokens
|
|
321
|
+
/// @param amount The amount of tokens to pay. Includes the token paid, their value, the number of
|
|
322
322
|
/// decimals included, and the currency of the amount.
|
|
323
|
-
/// @param projectId The ID of the project
|
|
323
|
+
/// @param projectId The ID of the project to pay.
|
|
324
324
|
/// @param beneficiary The address that should be the beneficiary of anything the payment yields (including project
|
|
325
325
|
/// tokens minted by the payment).
|
|
326
326
|
/// @param metadata Bytes to send to the data hook, if the project's current ruleset specifies one.
|
|
@@ -362,7 +362,7 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
362
362
|
/// @dev Reverts if the total payouts for this cycle would exceed the ruleset's payout limit. The balance is
|
|
363
363
|
/// decremented before validation (safe because the entire tx reverts atomically on failure).
|
|
364
364
|
/// @param projectId The ID of the project that is paying out funds.
|
|
365
|
-
/// @param token The token
|
|
365
|
+
/// @param token The token to pay out.
|
|
366
366
|
/// @param amount The amount to pay out (use from the payout limit), as a fixed point number.
|
|
367
367
|
/// @param currency The currency of the `amount`. This must match the project's current ruleset's currency.
|
|
368
368
|
/// @return ruleset The ruleset the payout was made during, as a `JBRuleset` struct.
|
|
@@ -432,12 +432,12 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
432
432
|
usedPayoutLimitOf[msg.sender][projectId][token][ruleset.cycleNumber][currency] = newUsedPayoutLimitOf;
|
|
433
433
|
}
|
|
434
434
|
|
|
435
|
-
/// @notice Records a terminal migration — zeros out the project's balance and returns the amount
|
|
435
|
+
/// @notice Records a terminal migration — zeros out the project's balance and returns the amount moved to
|
|
436
436
|
/// the new terminal. The current ruleset must allow terminal migration.
|
|
437
|
-
/// @param projectId The ID of the project
|
|
438
|
-
/// @param token The token
|
|
439
|
-
/// @return balance The project's current balance (
|
|
440
|
-
/// amount of decimals as its relative terminal.
|
|
437
|
+
/// @param projectId The ID of the project to migrate.
|
|
438
|
+
/// @param token The token to migrate.
|
|
439
|
+
/// @return balance The project's current balance (the amount that will migrate), as a fixed point number with the
|
|
440
|
+
/// same amount of decimals as its relative terminal.
|
|
441
441
|
function recordTerminalMigration(uint256 projectId, address token) external override returns (uint256 balance) {
|
|
442
442
|
// Get a reference to the project's current ruleset.
|
|
443
443
|
JBRuleset memory ruleset = RULESETS.currentOf(projectId);
|
|
@@ -459,10 +459,10 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
459
459
|
/// @dev Called by the terminal during `useAllowanceOf`. Unlike payouts, surplus withdrawals go directly to a
|
|
460
460
|
/// beneficiary rather than through splits.
|
|
461
461
|
/// @param projectId The ID of the project to use the surplus allowance of.
|
|
462
|
-
/// @param token The token whose balances should contribute to the surplus allowance
|
|
462
|
+
/// @param token The token whose balances should contribute to the surplus allowance to reclaim from.
|
|
463
463
|
/// @param amount The amount to use from the surplus allowance, as a fixed point number.
|
|
464
464
|
/// @param currency The currency of the `amount`. Must match the currency of the surplus allowance.
|
|
465
|
-
/// @return ruleset The ruleset
|
|
465
|
+
/// @return ruleset The ruleset the surplus allowance applies to, as a `JBRuleset` struct.
|
|
466
466
|
/// @return usedAmount The amount of terminal tokens used, as a fixed point number with the same amount of decimals
|
|
467
467
|
/// as its relative terminal.
|
|
468
468
|
function recordUsedAllowanceOf(
|
|
@@ -697,9 +697,9 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
697
697
|
/// preview and execution).
|
|
698
698
|
/// @param terminal The terminal to simulate the cash out from.
|
|
699
699
|
/// @param holder The address cashing out.
|
|
700
|
-
/// @param projectId The ID of the project
|
|
701
|
-
/// @param cashOutCount The number of project tokens
|
|
702
|
-
/// @param tokenToReclaim The token
|
|
700
|
+
/// @param projectId The ID of the project to cash out from.
|
|
701
|
+
/// @param cashOutCount The number of project tokens to cash out.
|
|
702
|
+
/// @param tokenToReclaim The token to reclaim.
|
|
703
703
|
/// @param beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address.
|
|
704
704
|
/// @param metadata Extra data to pass along to the data hook.
|
|
705
705
|
/// @return ruleset The project's current ruleset.
|
|
@@ -741,8 +741,8 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
741
741
|
/// `recordPaymentFrom` would produce.
|
|
742
742
|
/// @param terminal The terminal to simulate the payment from.
|
|
743
743
|
/// @param payer The address of the payer.
|
|
744
|
-
/// @param amount The amount
|
|
745
|
-
/// @param projectId The ID of the project
|
|
744
|
+
/// @param amount The amount to pay.
|
|
745
|
+
/// @param projectId The ID of the project to pay.
|
|
746
746
|
/// @param beneficiary The address to mint project tokens to.
|
|
747
747
|
/// @param metadata Extra data to pass along to the data hook.
|
|
748
748
|
/// @return ruleset The project's current ruleset.
|
|
@@ -841,9 +841,9 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
841
841
|
/// @dev When `useTotalSurplusForCashOuts` is enabled, surplus is aggregated from ALL registered terminals without
|
|
842
842
|
/// validation. Projects MUST only register trusted terminals — an untrusted terminal can over-report surplus and
|
|
843
843
|
/// cause the executing terminal to overpay cash-outs.
|
|
844
|
-
/// @param terminal The terminal the cash out
|
|
845
|
-
/// @param projectId The ID of the project
|
|
846
|
-
/// @param tokenToReclaim The token
|
|
844
|
+
/// @param terminal The terminal recording the cash out.
|
|
845
|
+
/// @param projectId The ID of the project to cash out from.
|
|
846
|
+
/// @param tokenToReclaim The token to reclaim.
|
|
847
847
|
/// @param ruleset The ruleset during the cash out.
|
|
848
848
|
/// @return The surplus amount in the token's native decimals and currency.
|
|
849
849
|
function _cashOutSurplusOf(
|
|
@@ -939,9 +939,9 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
939
939
|
/// @notice Computes cash out results without writing state.
|
|
940
940
|
/// @param terminal The terminal recording the cash out.
|
|
941
941
|
/// @param holder The account that is cashing out tokens.
|
|
942
|
-
/// @param projectId The ID of the project
|
|
942
|
+
/// @param projectId The ID of the project to cash out from.
|
|
943
943
|
/// @param cashOutCount The number of project tokens to cash out.
|
|
944
|
-
/// @param tokenToReclaim The token
|
|
944
|
+
/// @param tokenToReclaim The token to reclaim.
|
|
945
945
|
/// @param beneficiaryIsFeeless Whether the cash out's beneficiary is a feeless address.
|
|
946
946
|
/// @param metadata Bytes to send to the data hook.
|
|
947
947
|
/// @return ruleset The ruleset during the cash out.
|
|
@@ -1035,8 +1035,8 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
1035
1035
|
/// @notice Computes payment results without writing state.
|
|
1036
1036
|
/// @param terminal The terminal recording the payment.
|
|
1037
1037
|
/// @param payer The address that made the payment.
|
|
1038
|
-
/// @param amount The amount of tokens
|
|
1039
|
-
/// @param projectId The ID of the project
|
|
1038
|
+
/// @param amount The amount of tokens to pay.
|
|
1039
|
+
/// @param projectId The ID of the project to pay.
|
|
1040
1040
|
/// @param beneficiary The beneficiary of the payment.
|
|
1041
1041
|
/// @param metadata Bytes to send to the data hook.
|
|
1042
1042
|
/// @return ruleset The ruleset the payment would be made during.
|
|
@@ -1239,12 +1239,12 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
1239
1239
|
|
|
1240
1240
|
/// @notice Gets a project's surplus amount in a terminal as measured by a given ruleset, across multiple accounting
|
|
1241
1241
|
/// contexts.
|
|
1242
|
-
/// @dev This amount changes as the value of the balance changes in relation to the currency
|
|
1242
|
+
/// @dev This amount changes as the value of the balance changes in relation to the currency used to measure
|
|
1243
1243
|
/// various payout limits.
|
|
1244
|
-
/// @param terminal The terminal
|
|
1244
|
+
/// @param terminal The terminal to calculate surplus for.
|
|
1245
1245
|
/// @param projectId The ID of the project to get the surplus for.
|
|
1246
1246
|
/// @param accountingContexts The accounting contexts of tokens whose balances should contribute to the surplus
|
|
1247
|
-
///
|
|
1247
|
+
/// calculated.
|
|
1248
1248
|
/// @param ruleset The ruleset to base the surplus on.
|
|
1249
1249
|
/// @param targetDecimals The number of decimals to include in the resulting fixed point number.
|
|
1250
1250
|
/// @param targetCurrency The currency that the reported surplus is expected to be in terms of.
|
|
@@ -1285,12 +1285,12 @@ contract JBTerminalStore is IJBTerminalStore {
|
|
|
1285
1285
|
|
|
1286
1286
|
/// @notice Get a project's surplus amount of a specific token in a given terminal as measured by a given ruleset
|
|
1287
1287
|
/// (one specific accounting context).
|
|
1288
|
-
/// @dev This amount changes as the value of the balance changes in relation to the currency
|
|
1288
|
+
/// @dev This amount changes as the value of the balance changes in relation to the currency used to measure
|
|
1289
1289
|
/// the payout limits.
|
|
1290
|
-
/// @param terminal The terminal
|
|
1290
|
+
/// @param terminal The terminal to calculate surplus for.
|
|
1291
1291
|
/// @param projectId The ID of the project to get the surplus of.
|
|
1292
1292
|
/// @param accountingContext The accounting context of the token whose balance should contribute to the surplus
|
|
1293
|
-
///
|
|
1293
|
+
/// measured.
|
|
1294
1294
|
/// @param ruleset The ID of the ruleset to base the surplus calculation on.
|
|
1295
1295
|
/// @param targetDecimals The number of decimals to include in the resulting fixed point number.
|
|
1296
1296
|
/// @param targetCurrency The currency that the reported surplus is expected to be in terms of.
|
package/src/JBTokens.sol
CHANGED
|
@@ -47,7 +47,7 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
47
47
|
/// @custom:param projectId The ID of the project to which the credits belong.
|
|
48
48
|
mapping(address holder => mapping(uint256 projectId => uint256)) public override creditBalanceOf;
|
|
49
49
|
|
|
50
|
-
/// @notice
|
|
50
|
+
/// @notice The project ID that a given ERC-20 token is associated with.
|
|
51
51
|
/// @custom:param token The address of the token associated with the project.
|
|
52
52
|
// slither-disable-next-line unused-return
|
|
53
53
|
mapping(IJBToken token => uint256) public override projectIdOf;
|
|
@@ -77,7 +77,7 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
77
77
|
/// @notice Destroy a holder's tokens for a project. Credits (internal balance) are burned first; if more tokens
|
|
78
78
|
/// need burning, the remaining amount is burned from the holder's ERC-20 balance.
|
|
79
79
|
/// @dev Only a project's current controller can burn its tokens. Called during cash outs and manual burns.
|
|
80
|
-
/// @param holder The address
|
|
80
|
+
/// @param holder The address to burn tokens from.
|
|
81
81
|
/// @param projectId The ID of the project the burned tokens belong to.
|
|
82
82
|
/// @param count The number of tokens to burn.
|
|
83
83
|
function burnFrom(address holder, uint256 projectId, uint256 count) external override onlyControllerOf(projectId) {
|
|
@@ -135,8 +135,8 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
135
135
|
/// balance and the equivalent ERC-20 tokens are minted to the beneficiary. The project must have an ERC-20
|
|
136
136
|
/// deployed or attached.
|
|
137
137
|
/// @dev Only a project's controller can claim that project's tokens.
|
|
138
|
-
/// @param holder The owner of the credits
|
|
139
|
-
/// @param projectId The ID of the project
|
|
138
|
+
/// @param holder The owner of the credits to redeem.
|
|
139
|
+
/// @param projectId The ID of the project to claim tokens for.
|
|
140
140
|
/// @param count The number of tokens to claim.
|
|
141
141
|
/// @param beneficiary The account into which the claimed tokens will go.
|
|
142
142
|
function claimTokensFor(
|
|
@@ -317,7 +317,7 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
317
317
|
/// @notice Update the name and symbol of a project's ERC-20 token. The project must already have a token deployed
|
|
318
318
|
/// or attached.
|
|
319
319
|
/// @dev Only a project's controller can set the token's name and symbol.
|
|
320
|
-
/// @param projectId The ID of the project
|
|
320
|
+
/// @param projectId The ID of the project to update the token for.
|
|
321
321
|
/// @param name The new name.
|
|
322
322
|
/// @param symbol The new symbol.
|
|
323
323
|
function setTokenMetadataFor(
|
|
@@ -351,7 +351,7 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
351
351
|
/// just a balance in this contract), so this function enables transfers via the controller.
|
|
352
352
|
/// @dev Only a project's controller can transfer credits for that project.
|
|
353
353
|
/// @param holder The address to transfer credits from.
|
|
354
|
-
/// @param projectId The ID of the project
|
|
354
|
+
/// @param projectId The ID of the project to transfer credits for.
|
|
355
355
|
/// @param recipient The recipient of the credits.
|
|
356
356
|
/// @param count The number of token credits to transfer.
|
|
357
357
|
function transferCreditsFrom(
|
|
@@ -12,7 +12,7 @@ interface IJBCashOutTerminal is IJBTerminal {
|
|
|
12
12
|
/// @notice A cash out was processed for a project.
|
|
13
13
|
/// @param rulesetId The ID of the ruleset during the cash out.
|
|
14
14
|
/// @param rulesetCycleNumber The cycle number of the ruleset during the cash out.
|
|
15
|
-
/// @param projectId The ID of the project
|
|
15
|
+
/// @param projectId The ID of the project to cash out from.
|
|
16
16
|
/// @param holder The address whose tokens were cashed out.
|
|
17
17
|
/// @param beneficiary The address that received the reclaimed funds.
|
|
18
18
|
/// @param cashOutCount The number of tokens cashed out.
|
|
@@ -48,8 +48,8 @@ interface IJBCashOutTerminal is IJBTerminal {
|
|
|
48
48
|
);
|
|
49
49
|
|
|
50
50
|
/// @notice Simulates cashing out project tokens from this terminal without modifying state.
|
|
51
|
-
/// @param holder The address
|
|
52
|
-
/// @param projectId The ID of the project
|
|
51
|
+
/// @param holder The address cashing out tokens.
|
|
52
|
+
/// @param projectId The ID of the project cashing out tokens.
|
|
53
53
|
/// @param cashOutCount The number of project tokens to cash out.
|
|
54
54
|
/// @param tokenToReclaim The token to reclaim from the project's surplus.
|
|
55
55
|
/// @param beneficiary The address that would receive the reclaimed tokens.
|
|
@@ -77,8 +77,8 @@ interface IJBCashOutTerminal is IJBTerminal {
|
|
|
77
77
|
|
|
78
78
|
/// @notice Cashes out a holder's tokens for a project, reclaiming the token's proportional share of the project's
|
|
79
79
|
/// surplus.
|
|
80
|
-
/// @param holder The address
|
|
81
|
-
/// @param projectId The ID of the project
|
|
80
|
+
/// @param holder The address cashing out tokens.
|
|
81
|
+
/// @param projectId The ID of the project cashing out tokens.
|
|
82
82
|
/// @param cashOutCount The number of project tokens to cash out.
|
|
83
83
|
/// @param tokenToReclaim The token to reclaim from the project's surplus.
|
|
84
84
|
/// @param minTokensReclaimed The minimum number of terminal tokens expected to be reclaimed.
|
|
@@ -82,8 +82,8 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
82
82
|
);
|
|
83
83
|
|
|
84
84
|
/// @notice A project was prepared for migration from another controller.
|
|
85
|
-
/// @param projectId The ID of the project
|
|
86
|
-
/// @param from The controller
|
|
85
|
+
/// @param projectId The ID of the project to prepare for migration.
|
|
86
|
+
/// @param from The controller to migrate from.
|
|
87
87
|
/// @param caller The address that called the prep migration function.
|
|
88
88
|
event PrepMigration(uint256 indexed projectId, address from, address caller);
|
|
89
89
|
|
|
@@ -226,7 +226,7 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
226
226
|
function pendingReservedTokenBalanceOf(uint256 projectId) external view returns (uint256);
|
|
227
227
|
|
|
228
228
|
/// @notice Previews how many beneficiary and reserved tokens `mintTokensOf(...)` would produce.
|
|
229
|
-
/// @param projectId The ID of the project
|
|
229
|
+
/// @param projectId The ID of the project to mint tokens for.
|
|
230
230
|
/// @param tokenCount The number of tokens to mint, including any reserved tokens.
|
|
231
231
|
/// @param useReservedPercent Whether to apply the ruleset's reserved percent.
|
|
232
232
|
/// @return beneficiaryTokenCount The number of tokens that would be minted for the beneficiary.
|
|
@@ -257,7 +257,7 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
257
257
|
/// @notice Adds a price feed for a project.
|
|
258
258
|
/// @param projectId The ID of the project to add the feed for.
|
|
259
259
|
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
260
|
-
/// @param unitCurrency The currency
|
|
260
|
+
/// @param unitCurrency The currency the feed prices.
|
|
261
261
|
/// @param feed The price feed to add.
|
|
262
262
|
function addPriceFeedFor(
|
|
263
263
|
uint256 projectId,
|
|
@@ -268,15 +268,15 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
268
268
|
external;
|
|
269
269
|
|
|
270
270
|
/// @notice Burns a holder's project tokens or credits.
|
|
271
|
-
/// @param holder The address
|
|
272
|
-
/// @param projectId The ID of the project
|
|
271
|
+
/// @param holder The address to burn tokens for.
|
|
272
|
+
/// @param projectId The ID of the project to burn tokens for.
|
|
273
273
|
/// @param tokenCount The number of tokens to burn.
|
|
274
274
|
/// @param memo A memo to pass along to the emitted event.
|
|
275
275
|
function burnTokensOf(address holder, uint256 projectId, uint256 tokenCount, string calldata memo) external;
|
|
276
276
|
|
|
277
277
|
/// @notice Redeems credits to claim tokens into a beneficiary's account.
|
|
278
278
|
/// @param holder The address to redeem credits from.
|
|
279
|
-
/// @param projectId The ID of the project
|
|
279
|
+
/// @param projectId The ID of the project to claim tokens for.
|
|
280
280
|
/// @param tokenCount The number of tokens to claim.
|
|
281
281
|
/// @param beneficiary The account the claimed tokens will go to.
|
|
282
282
|
function claimTokensFor(address holder, uint256 projectId, uint256 tokenCount, address beneficiary) external;
|
|
@@ -331,7 +331,7 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
331
331
|
returns (uint256 rulesetId);
|
|
332
332
|
|
|
333
333
|
/// @notice Mints new project tokens or credits to a beneficiary, optionally reserving a portion.
|
|
334
|
-
/// @param projectId The ID of the project
|
|
334
|
+
/// @param projectId The ID of the project to mint tokens for.
|
|
335
335
|
/// @param tokenCount The number of tokens to mint, including any reserved tokens.
|
|
336
336
|
/// @param beneficiary The address which will receive the non-reserved tokens.
|
|
337
337
|
/// @param memo A memo to pass along to the emitted event.
|
|
@@ -377,14 +377,14 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
377
377
|
function setTokenFor(uint256 projectId, IJBToken token) external;
|
|
378
378
|
|
|
379
379
|
/// @notice Sets the name and symbol of a project's token.
|
|
380
|
-
/// @param projectId The ID of the project
|
|
380
|
+
/// @param projectId The ID of the project to update the token for.
|
|
381
381
|
/// @param name The new name.
|
|
382
382
|
/// @param symbol The new symbol.
|
|
383
383
|
function setTokenMetadataOf(uint256 projectId, string calldata name, string calldata symbol) external;
|
|
384
384
|
|
|
385
385
|
/// @notice Transfers credits from one address to another.
|
|
386
386
|
/// @param holder The address to transfer credits from.
|
|
387
|
-
/// @param projectId The ID of the project
|
|
387
|
+
/// @param projectId The ID of the project to transfer credits for.
|
|
388
388
|
/// @param recipient The address to transfer credits to.
|
|
389
389
|
/// @param creditCount The number of credits to transfer.
|
|
390
390
|
function transferCreditsFrom(address holder, uint256 projectId, address recipient, uint256 creditCount) external;
|
|
@@ -12,17 +12,17 @@ interface IJBMigratable is IERC165 {
|
|
|
12
12
|
event Migrate(uint256 indexed projectId, IERC165 to, address caller);
|
|
13
13
|
|
|
14
14
|
/// @notice Called after this controller has been set as the project's controller in the directory.
|
|
15
|
-
/// @param from The controller
|
|
15
|
+
/// @param from The controller to migrate from.
|
|
16
16
|
/// @param projectId The ID of the project that was migrated.
|
|
17
17
|
function afterReceiveMigrationFrom(IERC165 from, uint256 projectId) external;
|
|
18
18
|
|
|
19
|
-
/// @notice Prepares this controller to receive a project
|
|
20
|
-
/// @param from The controller
|
|
21
|
-
/// @param projectId The ID of the project
|
|
19
|
+
/// @notice Prepares this controller to receive a project to migrate from another controller.
|
|
20
|
+
/// @param from The controller to migrate from.
|
|
21
|
+
/// @param projectId The ID of the project to migrate.
|
|
22
22
|
function beforeReceiveMigrationFrom(IERC165 from, uint256 projectId) external;
|
|
23
23
|
|
|
24
24
|
/// @notice Migrates a project from this controller to another.
|
|
25
|
-
/// @param projectId The ID of the project
|
|
25
|
+
/// @param projectId The ID of the project to migrate.
|
|
26
26
|
/// @param to The controller to migrate the project to.
|
|
27
27
|
function migrate(uint256 projectId, IERC165 to) external;
|
|
28
28
|
}
|
|
@@ -17,7 +17,7 @@ interface IJBPayoutTerminal is IJBTerminal {
|
|
|
17
17
|
/// @notice A direct payout transfer reverted.
|
|
18
18
|
/// @param projectId The ID of the project the payout was for.
|
|
19
19
|
/// @param addr The address the payout was sent to.
|
|
20
|
-
/// @param token The token
|
|
20
|
+
/// @param token The token to pay out.
|
|
21
21
|
/// @param amount The amount of the payout.
|
|
22
22
|
/// @param fee The fee taken from the payout.
|
|
23
23
|
/// @param reason The revert reason.
|
|
@@ -98,7 +98,7 @@ interface IJBPayoutTerminal is IJBTerminal {
|
|
|
98
98
|
|
|
99
99
|
/// @notice Sends a project's payouts to its payout split group according to its ruleset's payout limits.
|
|
100
100
|
/// @param projectId The ID of the project to send payouts for.
|
|
101
|
-
/// @param token The token
|
|
101
|
+
/// @param token The token to pay out.
|
|
102
102
|
/// @param amount The total amount of tokens to pay out.
|
|
103
103
|
/// @param currency The currency the amount is denominated in.
|
|
104
104
|
/// @param minTokensPaidOut The minimum number of terminal tokens expected to be paid out.
|
|
@@ -115,7 +115,7 @@ interface IJBPayoutTerminal is IJBTerminal {
|
|
|
115
115
|
|
|
116
116
|
/// @notice Uses a project's surplus allowance to send funds to a beneficiary.
|
|
117
117
|
/// @param projectId The ID of the project to use the surplus allowance of.
|
|
118
|
-
/// @param token The token
|
|
118
|
+
/// @param token The token to pay out.
|
|
119
119
|
/// @param amount The amount of the surplus allowance to use.
|
|
120
120
|
/// @param currency The currency the amount is denominated in.
|
|
121
121
|
/// @param minTokensPaidOut The minimum number of terminal tokens expected to be paid out.
|
|
@@ -27,7 +27,7 @@ interface IJBPermissions {
|
|
|
27
27
|
|
|
28
28
|
/// @notice Checks if an operator has a specific permission for an account and project.
|
|
29
29
|
/// @param operator The operator to check.
|
|
30
|
-
/// @param account The account
|
|
30
|
+
/// @param account The account the operator acts on behalf of.
|
|
31
31
|
/// @param projectId The project ID the permission is scoped to. 0 represents all projects.
|
|
32
32
|
/// @param permissionId The permission ID to check for.
|
|
33
33
|
/// @param includeRoot Whether to return true if the operator has the ROOT permission.
|
|
@@ -47,7 +47,7 @@ interface IJBPermissions {
|
|
|
47
47
|
|
|
48
48
|
/// @notice Checks if an operator has all of the specified permissions for an account and project.
|
|
49
49
|
/// @param operator The operator to check.
|
|
50
|
-
/// @param account The account
|
|
50
|
+
/// @param account The account the operator acts on behalf of.
|
|
51
51
|
/// @param projectId The project ID the permissions are scoped to. 0 represents all projects.
|
|
52
52
|
/// @param permissionIds An array of permission IDs to check for.
|
|
53
53
|
/// @param includeRoot Whether to return true if the operator has the ROOT permission.
|
|
@@ -67,13 +67,13 @@ interface IJBPermissions {
|
|
|
67
67
|
|
|
68
68
|
/// @notice Returns the packed permissions that an operator has for an account and project.
|
|
69
69
|
/// @param operator The address of the operator.
|
|
70
|
-
/// @param account The address of the account
|
|
70
|
+
/// @param account The address of the account operated on behalf of.
|
|
71
71
|
/// @param projectId The project ID the permissions are scoped to. 0 is a wildcard for all projects.
|
|
72
72
|
/// @return The packed permissions as a uint256 bitmap.
|
|
73
73
|
function permissionsOf(address operator, address account, uint256 projectId) external view returns (uint256);
|
|
74
74
|
|
|
75
75
|
/// @notice Sets permissions for an operator on behalf of an account.
|
|
76
76
|
/// @param account The account setting its operator's permissions.
|
|
77
|
-
/// @param permissionsData The data specifying the permissions
|
|
77
|
+
/// @param permissionsData The data specifying the permissions to grant to the operator.
|
|
78
78
|
function setPermissionsFor(address account, JBPermissionsData calldata permissionsData) external;
|
|
79
79
|
}
|
|
@@ -13,7 +13,7 @@ interface IJBPermitTerminal is IJBTerminal {
|
|
|
13
13
|
/// @param reason The failure reason.
|
|
14
14
|
event Permit2AllowanceFailed(address indexed token, address indexed owner, bytes reason);
|
|
15
15
|
|
|
16
|
-
/// @notice The Permit2 contract used for token approvals.
|
|
16
|
+
/// @notice The Permit2 contract used for gasless ERC-20 token approvals during payments.
|
|
17
17
|
// forge-lint: disable-next-line(mixed-case-function)
|
|
18
18
|
function PERMIT2() external returns (IPermit2);
|
|
19
19
|
}
|
|
@@ -11,7 +11,7 @@ interface IJBPrices {
|
|
|
11
11
|
/// @notice A price feed was added for a project's currency pair.
|
|
12
12
|
/// @param projectId The ID of the project the price feed was added for.
|
|
13
13
|
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
14
|
-
/// @param unitCurrency The currency
|
|
14
|
+
/// @param unitCurrency The currency the feed prices.
|
|
15
15
|
/// @param feed The price feed that was added.
|
|
16
16
|
/// @param caller The address that added the price feed.
|
|
17
17
|
event AddPriceFeed(
|
|
@@ -31,7 +31,7 @@ interface IJBPrices {
|
|
|
31
31
|
/// @notice Returns the price feed for a project's currency pair.
|
|
32
32
|
/// @param projectId The ID of the project to get the price feed of.
|
|
33
33
|
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
34
|
-
/// @param unitCurrency The currency
|
|
34
|
+
/// @param unitCurrency The currency the feed prices.
|
|
35
35
|
/// @return The price feed for the currency pair.
|
|
36
36
|
function priceFeedFor(
|
|
37
37
|
uint256 projectId,
|
|
@@ -45,7 +45,7 @@ interface IJBPrices {
|
|
|
45
45
|
/// @notice Returns the unit price for a currency pair.
|
|
46
46
|
/// @param projectId The ID of the project to get the price for.
|
|
47
47
|
/// @param pricingCurrency The currency the returned price is in terms of.
|
|
48
|
-
/// @param unitCurrency The currency
|
|
48
|
+
/// @param unitCurrency The currency to price.
|
|
49
49
|
/// @param decimals The number of decimals the returned price should use.
|
|
50
50
|
/// @return The unit price.
|
|
51
51
|
function pricePerUnitOf(
|
|
@@ -61,7 +61,7 @@ interface IJBPrices {
|
|
|
61
61
|
/// @notice Adds a price feed for a project's currency pair.
|
|
62
62
|
/// @param projectId The ID of the project to add the price feed for.
|
|
63
63
|
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
64
|
-
/// @param unitCurrency The currency
|
|
64
|
+
/// @param unitCurrency The currency the feed prices.
|
|
65
65
|
/// @param feed The price feed to add.
|
|
66
66
|
function addPriceFeedFor(
|
|
67
67
|
uint256 projectId,
|
|
@@ -107,9 +107,9 @@ interface IJBTerminal is IERC165 {
|
|
|
107
107
|
returns (uint256);
|
|
108
108
|
|
|
109
109
|
/// @notice Simulates paying a project through this terminal without modifying state.
|
|
110
|
-
/// @param projectId The ID of the project
|
|
111
|
-
/// @param token The token
|
|
112
|
-
/// @param amount The amount of tokens
|
|
110
|
+
/// @param projectId The ID of the project to pay.
|
|
111
|
+
/// @param token The token to pay with.
|
|
112
|
+
/// @param amount The amount of tokens to pay.
|
|
113
113
|
/// @param beneficiary The address to mint project tokens to.
|
|
114
114
|
/// @param metadata Extra data to pass along to the data hook and pay hooks.
|
|
115
115
|
/// @return ruleset The project's current ruleset.
|
|
@@ -139,8 +139,8 @@ interface IJBTerminal is IERC165 {
|
|
|
139
139
|
|
|
140
140
|
/// @notice Adds funds to a project's balance.
|
|
141
141
|
/// @param projectId The ID of the project to add funds to.
|
|
142
|
-
/// @param token The token
|
|
143
|
-
/// @param amount The amount of tokens
|
|
142
|
+
/// @param token The token added.
|
|
143
|
+
/// @param amount The amount of tokens added.
|
|
144
144
|
/// @param shouldReturnHeldFees Whether held fees should be returned based on the amount added.
|
|
145
145
|
/// @param memo A memo to pass along to the emitted event.
|
|
146
146
|
/// @param metadata Extra data to pass along to the emitted event.
|
|
@@ -156,16 +156,16 @@ interface IJBTerminal is IERC165 {
|
|
|
156
156
|
payable;
|
|
157
157
|
|
|
158
158
|
/// @notice Migrates a project's funds from this terminal to another.
|
|
159
|
-
/// @param projectId The ID of the project
|
|
160
|
-
/// @param token The address of the token
|
|
159
|
+
/// @param projectId The ID of the project to migrate.
|
|
160
|
+
/// @param token The address of the token to migrate.
|
|
161
161
|
/// @param to The terminal to migrate to.
|
|
162
162
|
/// @return balance The amount of funds that were migrated.
|
|
163
163
|
function migrateBalanceOf(uint256 projectId, address token, IJBTerminal to) external returns (uint256 balance);
|
|
164
164
|
|
|
165
165
|
/// @notice Pays a project in a specified token.
|
|
166
|
-
/// @param projectId The ID of the project
|
|
167
|
-
/// @param token The token
|
|
168
|
-
/// @param amount The amount of tokens
|
|
166
|
+
/// @param projectId The ID of the project to pay.
|
|
167
|
+
/// @param token The token to pay with.
|
|
168
|
+
/// @param amount The amount of tokens to pay.
|
|
169
169
|
/// @param beneficiary The address to mint project tokens to.
|
|
170
170
|
/// @param minReturnedTokens The minimum number of project tokens expected in return.
|
|
171
171
|
/// @param memo A memo to pass along to the emitted event.
|