@bananapus/core-v6 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/foundry.toml +0 -1
- package/package.json +2 -2
- package/src/JBChainlinkV3PriceFeed.sol +1 -5
- package/src/JBChainlinkV3SequencerPriceFeed.sol +1 -1
- package/src/JBController.sol +277 -277
- package/src/JBDeadline.sol +1 -1
- package/src/JBDirectory.sol +93 -93
- package/src/JBERC20.sol +43 -39
- package/src/JBFeelessAddresses.sol +12 -12
- package/src/JBFundAccessLimits.sol +82 -82
- package/src/JBMultiTerminal.sol +313 -313
- package/src/JBPermissions.sol +104 -100
- package/src/JBPrices.sol +68 -68
- package/src/JBProjects.sol +31 -31
- package/src/JBRulesets.sol +422 -422
- package/src/JBSplits.sol +116 -116
- package/src/JBTerminalStore.sol +651 -651
- package/src/JBTokens.sol +41 -41
- package/src/interfaces/IJBCashOutTerminal.sol +25 -7
- package/src/interfaces/IJBController.sol +78 -3
- package/src/interfaces/IJBDirectory.sol +25 -0
- package/src/interfaces/IJBFeeTerminal.sol +31 -0
- package/src/interfaces/IJBFeelessAddresses.sol +4 -0
- package/src/interfaces/IJBFundAccessLimits.sol +5 -0
- package/src/interfaces/IJBMigratable.sol +12 -8
- package/src/interfaces/IJBPayoutTerminal.sol +56 -9
- package/src/interfaces/IJBPermissions.sol +14 -7
- package/src/interfaces/IJBPermitTerminal.sol +4 -0
- package/src/interfaces/IJBPrices.sol +6 -0
- package/src/interfaces/IJBProjects.sol +8 -0
- package/src/interfaces/IJBRulesetApprovalHook.sol +1 -1
- package/src/interfaces/IJBRulesetDataHook.sol +23 -23
- package/src/interfaces/IJBRulesets.sol +54 -33
- package/src/interfaces/IJBSplits.sol +6 -0
- package/src/interfaces/IJBTerminal.sol +36 -0
- package/src/interfaces/IJBTerminalStore.sol +63 -63
- package/src/interfaces/IJBToken.sol +5 -5
- package/src/interfaces/IJBTokens.sol +50 -8
- package/test/TestDurationUnderflow.sol +3 -2
package/src/JBTokens.sol
CHANGED
|
@@ -70,47 +70,6 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
70
70
|
TOKEN = token;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
//*********************************************************************//
|
|
74
|
-
// ------------------------- external views -------------------------- //
|
|
75
|
-
//*********************************************************************//
|
|
76
|
-
|
|
77
|
-
/// @notice The total balance a holder has for a specified project, including both tokens and token credits.
|
|
78
|
-
/// @param holder The holder to get a balance for.
|
|
79
|
-
/// @param projectId The project to get the `holder`'s balance for.
|
|
80
|
-
/// @return balance The combined token and token credit balance of the `holder`.
|
|
81
|
-
function totalBalanceOf(address holder, uint256 projectId) external view override returns (uint256 balance) {
|
|
82
|
-
// Get a reference to the holder's credits for the project.
|
|
83
|
-
balance = creditBalanceOf[holder][projectId];
|
|
84
|
-
|
|
85
|
-
// Get a reference to the project's current token.
|
|
86
|
-
IJBToken token = tokenOf[projectId];
|
|
87
|
-
|
|
88
|
-
// If the project has a current token, add the holder's balance to the total.
|
|
89
|
-
if (token != IJBToken(address(0))) {
|
|
90
|
-
balance += token.balanceOf(holder);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
//*********************************************************************//
|
|
95
|
-
// --------------------------- public views -------------------------- //
|
|
96
|
-
//*********************************************************************//
|
|
97
|
-
|
|
98
|
-
/// @notice The total supply for a specific project, including both tokens and token credits.
|
|
99
|
-
/// @param projectId The ID of the project to get the total supply of.
|
|
100
|
-
/// @return totalSupply The total supply of the project's tokens and token credits.
|
|
101
|
-
function totalSupplyOf(uint256 projectId) public view override returns (uint256 totalSupply) {
|
|
102
|
-
// Get a reference to the total supply of the project's credits
|
|
103
|
-
totalSupply = totalCreditSupplyOf[projectId];
|
|
104
|
-
|
|
105
|
-
// Get a reference to the project's current token.
|
|
106
|
-
IJBToken token = tokenOf[projectId];
|
|
107
|
-
|
|
108
|
-
// If the project has a current token, add its total supply to the total.
|
|
109
|
-
if (token != IJBToken(address(0))) {
|
|
110
|
-
totalSupply += token.totalSupply();
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
|
|
114
73
|
//*********************************************************************//
|
|
115
74
|
// ---------------------- external transactions ---------------------- //
|
|
116
75
|
//*********************************************************************//
|
|
@@ -373,4 +332,45 @@ contract JBTokens is JBControlled, IJBTokens {
|
|
|
373
332
|
holder: holder, projectId: projectId, recipient: recipient, count: count, caller: msg.sender
|
|
374
333
|
});
|
|
375
334
|
}
|
|
335
|
+
|
|
336
|
+
//*********************************************************************//
|
|
337
|
+
// ------------------------- external views -------------------------- //
|
|
338
|
+
//*********************************************************************//
|
|
339
|
+
|
|
340
|
+
/// @notice The total balance a holder has for a specified project, including both tokens and token credits.
|
|
341
|
+
/// @param holder The holder to get a balance for.
|
|
342
|
+
/// @param projectId The project to get the `holder`'s balance for.
|
|
343
|
+
/// @return balance The combined token and token credit balance of the `holder`.
|
|
344
|
+
function totalBalanceOf(address holder, uint256 projectId) external view override returns (uint256 balance) {
|
|
345
|
+
// Get a reference to the holder's credits for the project.
|
|
346
|
+
balance = creditBalanceOf[holder][projectId];
|
|
347
|
+
|
|
348
|
+
// Get a reference to the project's current token.
|
|
349
|
+
IJBToken token = tokenOf[projectId];
|
|
350
|
+
|
|
351
|
+
// If the project has a current token, add the holder's balance to the total.
|
|
352
|
+
if (token != IJBToken(address(0))) {
|
|
353
|
+
balance += token.balanceOf(holder);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
//*********************************************************************//
|
|
358
|
+
// --------------------------- public views -------------------------- //
|
|
359
|
+
//*********************************************************************//
|
|
360
|
+
|
|
361
|
+
/// @notice The total supply for a specific project, including both tokens and token credits.
|
|
362
|
+
/// @param projectId The ID of the project to get the total supply of.
|
|
363
|
+
/// @return totalSupply The total supply of the project's tokens and token credits.
|
|
364
|
+
function totalSupplyOf(uint256 projectId) public view override returns (uint256 totalSupply) {
|
|
365
|
+
// Get a reference to the total supply of the project's credits
|
|
366
|
+
totalSupply = totalCreditSupplyOf[projectId];
|
|
367
|
+
|
|
368
|
+
// Get a reference to the project's current token.
|
|
369
|
+
IJBToken token = tokenOf[projectId];
|
|
370
|
+
|
|
371
|
+
// If the project has a current token, add its total supply to the total.
|
|
372
|
+
if (token != IJBToken(address(0))) {
|
|
373
|
+
totalSupply += token.totalSupply();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
376
|
}
|
|
@@ -7,13 +7,17 @@ import {JBAfterCashOutRecordedContext} from "../structs/JBAfterCashOutRecordedCo
|
|
|
7
7
|
|
|
8
8
|
/// @notice A terminal that can be cashed out from.
|
|
9
9
|
interface IJBCashOutTerminal is IJBTerminal {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
/// @notice A cash out was processed for a project.
|
|
11
|
+
/// @param rulesetId The ID of the ruleset during the cash out.
|
|
12
|
+
/// @param rulesetCycleNumber The cycle number of the ruleset during the cash out.
|
|
13
|
+
/// @param projectId The ID of the project being cashed out from.
|
|
14
|
+
/// @param holder The address whose tokens were cashed out.
|
|
15
|
+
/// @param beneficiary The address that received the reclaimed funds.
|
|
16
|
+
/// @param cashOutCount The number of tokens cashed out.
|
|
17
|
+
/// @param cashOutTaxRate The cash out tax rate applied.
|
|
18
|
+
/// @param reclaimAmount The amount of funds reclaimed.
|
|
19
|
+
/// @param metadata Extra metadata associated with the cash out.
|
|
20
|
+
/// @param caller The address that called the cash out function.
|
|
17
21
|
event CashOutTokens(
|
|
18
22
|
uint256 indexed rulesetId,
|
|
19
23
|
uint256 indexed rulesetCycleNumber,
|
|
@@ -27,6 +31,20 @@ interface IJBCashOutTerminal is IJBTerminal {
|
|
|
27
31
|
address caller
|
|
28
32
|
);
|
|
29
33
|
|
|
34
|
+
/// @notice A cash out hook was called after a cash out was recorded.
|
|
35
|
+
/// @param hook The cash out hook that was called.
|
|
36
|
+
/// @param context The context passed to the hook.
|
|
37
|
+
/// @param specificationAmount The amount specified for the hook.
|
|
38
|
+
/// @param fee The fee taken from the hook's amount.
|
|
39
|
+
/// @param caller The address that called the cash out function.
|
|
40
|
+
event HookAfterRecordCashOut(
|
|
41
|
+
IJBCashOutHook indexed hook,
|
|
42
|
+
JBAfterCashOutRecordedContext context,
|
|
43
|
+
uint256 specificationAmount,
|
|
44
|
+
uint256 fee,
|
|
45
|
+
address caller
|
|
46
|
+
);
|
|
47
|
+
|
|
30
48
|
/// @notice Cashes out a holder's tokens for a project, reclaiming the token's proportional share of the project's
|
|
31
49
|
/// surplus.
|
|
32
50
|
/// @param holder The address whose tokens are being cashed out.
|
|
@@ -27,14 +27,49 @@ import {JBTerminalConfig} from "./../structs/JBTerminalConfig.sol";
|
|
|
27
27
|
/// @notice Coordinates rulesets and project tokens, and is the entry point for most operations related to rulesets and
|
|
28
28
|
/// project tokens.
|
|
29
29
|
interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessControl {
|
|
30
|
+
/// @notice Tokens were burned from a holder's balance.
|
|
31
|
+
/// @param holder The address whose tokens were burned.
|
|
32
|
+
/// @param projectId The ID of the project whose tokens were burned.
|
|
33
|
+
/// @param tokenCount The number of tokens burned.
|
|
34
|
+
/// @param memo A memo associated with the burn.
|
|
35
|
+
/// @param caller The address that called the burn function.
|
|
30
36
|
event BurnTokens(
|
|
31
37
|
address indexed holder, uint256 indexed projectId, uint256 tokenCount, string memo, address caller
|
|
32
38
|
);
|
|
39
|
+
|
|
40
|
+
/// @notice An ERC-20 token was deployed for a project.
|
|
41
|
+
/// @param projectId The ID of the project the token was deployed for.
|
|
42
|
+
/// @param deployer The address that deployed the token.
|
|
43
|
+
/// @param salt The salt used for deterministic deployment.
|
|
44
|
+
/// @param saltHash The hash of the salt.
|
|
45
|
+
/// @param caller The address that called the deploy function.
|
|
33
46
|
event DeployERC20(
|
|
34
47
|
uint256 indexed projectId, address indexed deployer, bytes32 salt, bytes32 saltHash, address caller
|
|
35
48
|
);
|
|
49
|
+
|
|
50
|
+
/// @notice A project was launched with its initial rulesets and terminals.
|
|
51
|
+
/// @param rulesetId The ID of the first queued ruleset.
|
|
52
|
+
/// @param projectId The ID of the newly created project.
|
|
53
|
+
/// @param projectUri The metadata URI of the project.
|
|
54
|
+
/// @param memo A memo associated with the launch.
|
|
55
|
+
/// @param caller The address that called the launch function.
|
|
36
56
|
event LaunchProject(uint256 rulesetId, uint256 projectId, string projectUri, string memo, address caller);
|
|
57
|
+
|
|
58
|
+
/// @notice Rulesets were launched for an existing project.
|
|
59
|
+
/// @param rulesetId The ID of the first queued ruleset.
|
|
60
|
+
/// @param projectId The ID of the project.
|
|
61
|
+
/// @param memo A memo associated with the launch.
|
|
62
|
+
/// @param caller The address that called the launch function.
|
|
37
63
|
event LaunchRulesets(uint256 rulesetId, uint256 projectId, string memo, address caller);
|
|
64
|
+
|
|
65
|
+
/// @notice Tokens were minted for a beneficiary.
|
|
66
|
+
/// @param beneficiary The address that received the minted tokens.
|
|
67
|
+
/// @param projectId The ID of the project whose tokens were minted.
|
|
68
|
+
/// @param tokenCount The total number of tokens minted, including reserved tokens.
|
|
69
|
+
/// @param beneficiaryTokenCount The number of tokens minted for the beneficiary.
|
|
70
|
+
/// @param memo A memo associated with the mint.
|
|
71
|
+
/// @param reservedPercent The reserved percent applied to the mint.
|
|
72
|
+
/// @param caller The address that called the mint function.
|
|
38
73
|
event MintTokens(
|
|
39
74
|
address indexed beneficiary,
|
|
40
75
|
uint256 indexed projectId,
|
|
@@ -44,11 +79,37 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
44
79
|
uint256 reservedPercent,
|
|
45
80
|
address caller
|
|
46
81
|
);
|
|
82
|
+
|
|
83
|
+
/// @notice A project was prepared for migration from another controller.
|
|
84
|
+
/// @param projectId The ID of the project being prepared for migration.
|
|
85
|
+
/// @param from The controller the project is being migrated from.
|
|
86
|
+
/// @param caller The address that called the prep migration function.
|
|
47
87
|
event PrepMigration(uint256 indexed projectId, address from, address caller);
|
|
88
|
+
|
|
89
|
+
/// @notice Rulesets were queued for a project.
|
|
90
|
+
/// @param rulesetId The ID of the first queued ruleset.
|
|
91
|
+
/// @param projectId The ID of the project.
|
|
92
|
+
/// @param memo A memo associated with the queue operation.
|
|
93
|
+
/// @param caller The address that called the queue function.
|
|
48
94
|
event QueueRulesets(uint256 rulesetId, uint256 projectId, string memo, address caller);
|
|
95
|
+
|
|
96
|
+
/// @notice A reserved token distribution to a split reverted.
|
|
97
|
+
/// @param projectId The ID of the project.
|
|
98
|
+
/// @param split The split that the distribution reverted for.
|
|
99
|
+
/// @param tokenCount The number of tokens that failed to distribute.
|
|
100
|
+
/// @param reason The revert reason.
|
|
101
|
+
/// @param caller The address that called the distribution function.
|
|
49
102
|
event ReservedDistributionReverted(
|
|
50
103
|
uint256 indexed projectId, JBSplit split, uint256 tokenCount, bytes reason, address caller
|
|
51
104
|
);
|
|
105
|
+
|
|
106
|
+
/// @notice Reserved tokens were sent to a specific split.
|
|
107
|
+
/// @param projectId The ID of the project.
|
|
108
|
+
/// @param rulesetId The ID of the ruleset during the distribution.
|
|
109
|
+
/// @param groupId The ID of the split group.
|
|
110
|
+
/// @param split The split that received the tokens.
|
|
111
|
+
/// @param tokenCount The number of tokens sent to the split.
|
|
112
|
+
/// @param caller The address that called the distribution function.
|
|
52
113
|
event SendReservedTokensToSplit(
|
|
53
114
|
uint256 indexed projectId,
|
|
54
115
|
uint256 indexed rulesetId,
|
|
@@ -57,6 +118,15 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
57
118
|
uint256 tokenCount,
|
|
58
119
|
address caller
|
|
59
120
|
);
|
|
121
|
+
|
|
122
|
+
/// @notice Reserved tokens were distributed to a project's splits.
|
|
123
|
+
/// @param rulesetId The ID of the ruleset during the distribution.
|
|
124
|
+
/// @param rulesetCycleNumber The cycle number of the ruleset.
|
|
125
|
+
/// @param projectId The ID of the project.
|
|
126
|
+
/// @param owner The project's owner.
|
|
127
|
+
/// @param tokenCount The total number of reserved tokens distributed.
|
|
128
|
+
/// @param leftoverAmount The number of tokens left over after distribution.
|
|
129
|
+
/// @param caller The address that called the distribution function.
|
|
60
130
|
event SendReservedTokensToSplits(
|
|
61
131
|
uint256 indexed rulesetId,
|
|
62
132
|
uint256 indexed rulesetCycleNumber,
|
|
@@ -66,6 +136,11 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
66
136
|
uint256 leftoverAmount,
|
|
67
137
|
address caller
|
|
68
138
|
);
|
|
139
|
+
|
|
140
|
+
/// @notice A project's metadata URI was set.
|
|
141
|
+
/// @param projectId The ID of the project.
|
|
142
|
+
/// @param uri The metadata URI that was set.
|
|
143
|
+
/// @param caller The address that called the set URI function.
|
|
69
144
|
event SetUri(uint256 indexed projectId, string uri, address caller);
|
|
70
145
|
|
|
71
146
|
/// @notice The directory of terminals and controllers for projects.
|
|
@@ -74,6 +149,9 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
74
149
|
/// @notice The contract that stores fund access limits for each project.
|
|
75
150
|
function FUND_ACCESS_LIMITS() external view returns (IJBFundAccessLimits);
|
|
76
151
|
|
|
152
|
+
/// @notice The address of the contract that manages omnichain ruleset ops.
|
|
153
|
+
function OMNICHAIN_RULESET_OPERATOR() external view returns (address);
|
|
154
|
+
|
|
77
155
|
/// @notice The contract that stores prices for each project.
|
|
78
156
|
function PRICES() external view returns (IJBPrices);
|
|
79
157
|
|
|
@@ -89,9 +167,6 @@ interface IJBController is IERC165, IJBProjectUriRegistry, IJBDirectoryAccessCon
|
|
|
89
167
|
/// @notice The contract that manages token minting and burning.
|
|
90
168
|
function TOKENS() external view returns (IJBTokens);
|
|
91
169
|
|
|
92
|
-
/// @notice The address of the contract that manages omnichain ruleset ops.
|
|
93
|
-
function OMNICHAIN_RULESET_OPERATOR() external view returns (address);
|
|
94
|
-
|
|
95
170
|
/// @notice Returns an array of a project's rulesets with metadata, sorted from latest to earliest.
|
|
96
171
|
/// @param projectId The ID of the project to get the rulesets of.
|
|
97
172
|
/// @param startingId The ID of the ruleset to begin with. If 0, the project's latest ruleset is used.
|
|
@@ -8,12 +8,37 @@ import {IJBTerminal} from "./IJBTerminal.sol";
|
|
|
8
8
|
|
|
9
9
|
/// @notice Tracks the terminals and the controller used by each project.
|
|
10
10
|
interface IJBDirectory {
|
|
11
|
+
/// @notice A terminal was added to a project.
|
|
12
|
+
/// @param projectId The ID of the project the terminal was added to.
|
|
13
|
+
/// @param terminal The terminal that was added.
|
|
14
|
+
/// @param caller The address that added the terminal.
|
|
11
15
|
event AddTerminal(uint256 indexed projectId, IJBTerminal indexed terminal, address caller);
|
|
16
|
+
|
|
17
|
+
/// @notice A project's controller was set.
|
|
18
|
+
/// @param projectId The ID of the project whose controller was set.
|
|
19
|
+
/// @param controller The controller that was set.
|
|
20
|
+
/// @param caller The address that set the controller.
|
|
12
21
|
event SetController(uint256 indexed projectId, IERC165 indexed controller, address caller);
|
|
22
|
+
|
|
23
|
+
/// @notice An address's permission to set a project's first controller was updated.
|
|
24
|
+
/// @param addr The address whose permission was updated.
|
|
25
|
+
/// @param isAllowed Whether the address is allowed to set a project's first controller.
|
|
26
|
+
/// @param caller The address that updated the permission.
|
|
13
27
|
event SetIsAllowedToSetFirstController(address indexed addr, bool indexed isAllowed, address caller);
|
|
28
|
+
|
|
29
|
+
/// @notice A project's primary terminal for a token was set.
|
|
30
|
+
/// @param projectId The ID of the project whose primary terminal was set.
|
|
31
|
+
/// @param token The token the primary terminal was set for.
|
|
32
|
+
/// @param terminal The terminal that was set as primary.
|
|
33
|
+
/// @param caller The address that set the primary terminal.
|
|
14
34
|
event SetPrimaryTerminal(
|
|
15
35
|
uint256 indexed projectId, address indexed token, IJBTerminal indexed terminal, address caller
|
|
16
36
|
);
|
|
37
|
+
|
|
38
|
+
/// @notice A project's terminals were set.
|
|
39
|
+
/// @param projectId The ID of the project whose terminals were set.
|
|
40
|
+
/// @param terminals The terminals that were set.
|
|
41
|
+
/// @param caller The address that set the terminals.
|
|
17
42
|
event SetTerminals(uint256 indexed projectId, IJBTerminal[] terminals, address caller);
|
|
18
43
|
|
|
19
44
|
/// @notice Mints ERC-721s that represent project ownership and transfers.
|
|
@@ -7,6 +7,13 @@ import {JBFee} from "../structs/JBFee.sol";
|
|
|
7
7
|
|
|
8
8
|
/// @notice A terminal that can process and hold fees.
|
|
9
9
|
interface IJBFeeTerminal is IJBTerminal {
|
|
10
|
+
/// @notice A fee payment to the fee project reverted and was returned to the project's balance.
|
|
11
|
+
/// @param projectId The ID of the project the fee was for.
|
|
12
|
+
/// @param token The token the fee was denominated in.
|
|
13
|
+
/// @param feeProjectId The ID of the fee project.
|
|
14
|
+
/// @param amount The amount of the fee that reverted.
|
|
15
|
+
/// @param reason The revert reason.
|
|
16
|
+
/// @param caller The address that triggered the fee processing.
|
|
10
17
|
event FeeReverted(
|
|
11
18
|
uint256 indexed projectId,
|
|
12
19
|
address indexed token,
|
|
@@ -15,6 +22,14 @@ interface IJBFeeTerminal is IJBTerminal {
|
|
|
15
22
|
bytes reason,
|
|
16
23
|
address caller
|
|
17
24
|
);
|
|
25
|
+
|
|
26
|
+
/// @notice A fee was held for later processing.
|
|
27
|
+
/// @param projectId The ID of the project the fee was held for.
|
|
28
|
+
/// @param token The token the fee is denominated in.
|
|
29
|
+
/// @param amount The amount from which the fee was calculated.
|
|
30
|
+
/// @param fee The fee amount held.
|
|
31
|
+
/// @param beneficiary The address that will receive project tokens when the fee is processed.
|
|
32
|
+
/// @param caller The address that triggered the fee hold.
|
|
18
33
|
event HoldFee(
|
|
19
34
|
uint256 indexed projectId,
|
|
20
35
|
address indexed token,
|
|
@@ -23,6 +38,14 @@ interface IJBFeeTerminal is IJBTerminal {
|
|
|
23
38
|
address beneficiary,
|
|
24
39
|
address caller
|
|
25
40
|
);
|
|
41
|
+
|
|
42
|
+
/// @notice A fee was processed and paid to the fee project.
|
|
43
|
+
/// @param projectId The ID of the project the fee was for.
|
|
44
|
+
/// @param token The token the fee was denominated in.
|
|
45
|
+
/// @param amount The fee amount processed.
|
|
46
|
+
/// @param wasHeld Whether the fee was previously held.
|
|
47
|
+
/// @param beneficiary The address that received project tokens from the fee payment.
|
|
48
|
+
/// @param caller The address that triggered the fee processing.
|
|
26
49
|
event ProcessFee(
|
|
27
50
|
uint256 indexed projectId,
|
|
28
51
|
address indexed token,
|
|
@@ -31,6 +54,14 @@ interface IJBFeeTerminal is IJBTerminal {
|
|
|
31
54
|
address beneficiary,
|
|
32
55
|
address caller
|
|
33
56
|
);
|
|
57
|
+
|
|
58
|
+
/// @notice Held fees were returned to a project's balance.
|
|
59
|
+
/// @param projectId The ID of the project the held fees were returned to.
|
|
60
|
+
/// @param token The token the fees are denominated in.
|
|
61
|
+
/// @param amount The amount that triggered the fee return.
|
|
62
|
+
/// @param returnedFees The total amount of fees returned.
|
|
63
|
+
/// @param leftoverAmount The leftover amount after returning fees.
|
|
64
|
+
/// @param caller The address that triggered the fee return.
|
|
34
65
|
event ReturnHeldFees(
|
|
35
66
|
uint256 indexed projectId,
|
|
36
67
|
address indexed token,
|
|
@@ -3,6 +3,10 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
/// @notice Tracks addresses that are exempt from fees.
|
|
5
5
|
interface IJBFeelessAddresses {
|
|
6
|
+
/// @notice An address's feeless status was set.
|
|
7
|
+
/// @param addr The address whose feeless status was set.
|
|
8
|
+
/// @param isFeeless Whether the address is feeless.
|
|
9
|
+
/// @param caller The address that set the feeless status.
|
|
6
10
|
event SetFeelessAddress(address indexed addr, bool indexed isFeeless, address caller);
|
|
7
11
|
|
|
8
12
|
/// @notice Returns whether the specified address is feeless.
|
|
@@ -6,6 +6,11 @@ import {JBFundAccessLimitGroup} from "./../structs/JBFundAccessLimitGroup.sol";
|
|
|
6
6
|
|
|
7
7
|
/// @notice Stores fund access limits (payout limits and surplus allowances) for each project.
|
|
8
8
|
interface IJBFundAccessLimits {
|
|
9
|
+
/// @notice Fund access limits were set for a project's ruleset.
|
|
10
|
+
/// @param rulesetId The ID of the ruleset the limits apply within.
|
|
11
|
+
/// @param projectId The ID of the project the limits were set for.
|
|
12
|
+
/// @param fundAccessLimitGroup The fund access limit group that was set.
|
|
13
|
+
/// @param caller The address that set the fund access limits.
|
|
9
14
|
event SetFundAccessLimits(
|
|
10
15
|
uint256 indexed rulesetId,
|
|
11
16
|
uint256 indexed projectId,
|
|
@@ -5,20 +5,24 @@ import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
|
5
5
|
|
|
6
6
|
/// @notice A controller that supports project migration to and from other controllers.
|
|
7
7
|
interface IJBMigratable is IERC165 {
|
|
8
|
+
/// @notice A project was migrated from this controller to another.
|
|
9
|
+
/// @param projectId The ID of the project that was migrated.
|
|
10
|
+
/// @param to The controller the project was migrated to.
|
|
11
|
+
/// @param caller The address that called the migrate function.
|
|
8
12
|
event Migrate(uint256 indexed projectId, IERC165 to, address caller);
|
|
9
13
|
|
|
10
|
-
/// @notice
|
|
11
|
-
/// @param
|
|
12
|
-
/// @param
|
|
13
|
-
function
|
|
14
|
+
/// @notice Called after this controller has been set as the project's controller in the directory.
|
|
15
|
+
/// @param from The controller being migrated from.
|
|
16
|
+
/// @param projectId The ID of the project that was migrated.
|
|
17
|
+
function afterReceiveMigrationFrom(IERC165 from, uint256 projectId) external;
|
|
14
18
|
|
|
15
19
|
/// @notice Prepares this controller to receive a project being migrated from another controller.
|
|
16
20
|
/// @param from The controller being migrated from.
|
|
17
21
|
/// @param projectId The ID of the project being migrated.
|
|
18
22
|
function beforeReceiveMigrationFrom(IERC165 from, uint256 projectId) external;
|
|
19
23
|
|
|
20
|
-
/// @notice
|
|
21
|
-
/// @param
|
|
22
|
-
/// @param
|
|
23
|
-
function
|
|
24
|
+
/// @notice Migrates a project from this controller to another.
|
|
25
|
+
/// @param projectId The ID of the project being migrated.
|
|
26
|
+
/// @param to The controller to migrate the project to.
|
|
27
|
+
function migrate(uint256 projectId, IERC165 to) external;
|
|
24
28
|
}
|
|
@@ -7,7 +7,22 @@ import {JBSplit} from "../structs/JBSplit.sol";
|
|
|
7
7
|
|
|
8
8
|
/// @notice A terminal that can send payouts.
|
|
9
9
|
interface IJBPayoutTerminal is IJBTerminal {
|
|
10
|
+
/// @notice A payout to a split hook reverted.
|
|
11
|
+
/// @param projectId The ID of the project the payout was for.
|
|
12
|
+
/// @param split The split that the payout reverted for.
|
|
13
|
+
/// @param amount The amount of the payout.
|
|
14
|
+
/// @param reason The revert reason.
|
|
15
|
+
/// @param caller The address that called the payout function.
|
|
10
16
|
event PayoutReverted(uint256 indexed projectId, JBSplit split, uint256 amount, bytes reason, address caller);
|
|
17
|
+
|
|
18
|
+
/// @notice A direct payout transfer reverted.
|
|
19
|
+
/// @param projectId The ID of the project the payout was for.
|
|
20
|
+
/// @param addr The address the payout was sent to.
|
|
21
|
+
/// @param token The token being paid out.
|
|
22
|
+
/// @param amount The amount of the payout.
|
|
23
|
+
/// @param fee The fee taken from the payout.
|
|
24
|
+
/// @param reason The revert reason.
|
|
25
|
+
/// @param caller The address that called the payout function.
|
|
11
26
|
event PayoutTransferReverted(
|
|
12
27
|
uint256 indexed projectId,
|
|
13
28
|
address addr,
|
|
@@ -17,6 +32,35 @@ interface IJBPayoutTerminal is IJBTerminal {
|
|
|
17
32
|
bytes reason,
|
|
18
33
|
address caller
|
|
19
34
|
);
|
|
35
|
+
|
|
36
|
+
/// @notice A payout was sent to a specific split.
|
|
37
|
+
/// @param projectId The ID of the project the payout was for.
|
|
38
|
+
/// @param rulesetId The ID of the ruleset during the payout.
|
|
39
|
+
/// @param group The split group the payout was part of.
|
|
40
|
+
/// @param split The split that received the payout.
|
|
41
|
+
/// @param amount The gross amount of the payout.
|
|
42
|
+
/// @param netAmount The net amount of the payout after fees.
|
|
43
|
+
/// @param caller The address that called the payout function.
|
|
44
|
+
event SendPayoutToSplit(
|
|
45
|
+
uint256 indexed projectId,
|
|
46
|
+
uint256 indexed rulesetId,
|
|
47
|
+
uint256 indexed group,
|
|
48
|
+
JBSplit split,
|
|
49
|
+
uint256 amount,
|
|
50
|
+
uint256 netAmount,
|
|
51
|
+
address caller
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
/// @notice Payouts were sent from a project.
|
|
55
|
+
/// @param rulesetId The ID of the ruleset during the payouts.
|
|
56
|
+
/// @param rulesetCycleNumber The cycle number of the ruleset during the payouts.
|
|
57
|
+
/// @param projectId The ID of the project that sent the payouts.
|
|
58
|
+
/// @param projectOwner The owner of the project.
|
|
59
|
+
/// @param amount The total amount of tokens paid out.
|
|
60
|
+
/// @param amountPaidOut The amount paid out to splits.
|
|
61
|
+
/// @param fee The total fee taken.
|
|
62
|
+
/// @param netLeftoverPayoutAmount The net leftover amount sent to the project owner.
|
|
63
|
+
/// @param caller The address that called the payout function.
|
|
20
64
|
event SendPayouts(
|
|
21
65
|
uint256 indexed rulesetId,
|
|
22
66
|
uint256 indexed rulesetCycleNumber,
|
|
@@ -28,15 +72,18 @@ interface IJBPayoutTerminal is IJBTerminal {
|
|
|
28
72
|
uint256 netLeftoverPayoutAmount,
|
|
29
73
|
address caller
|
|
30
74
|
);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
75
|
+
|
|
76
|
+
/// @notice Surplus allowance was used to send funds to a beneficiary.
|
|
77
|
+
/// @param rulesetId The ID of the ruleset during the allowance usage.
|
|
78
|
+
/// @param rulesetCycleNumber The cycle number of the ruleset.
|
|
79
|
+
/// @param projectId The ID of the project using the allowance.
|
|
80
|
+
/// @param beneficiary The address that received the funds.
|
|
81
|
+
/// @param feeBeneficiary The address that received project tokens from fees.
|
|
82
|
+
/// @param amount The gross amount of the allowance used.
|
|
83
|
+
/// @param amountPaidOut The amount paid out before fees.
|
|
84
|
+
/// @param netAmountPaidOut The net amount paid out to the beneficiary after fees.
|
|
85
|
+
/// @param memo A memo associated with the allowance usage.
|
|
86
|
+
/// @param caller The address that called the use allowance function.
|
|
40
87
|
event UseAllowance(
|
|
41
88
|
uint256 indexed rulesetId,
|
|
42
89
|
uint256 indexed rulesetCycleNumber,
|
|
@@ -5,6 +5,13 @@ import {JBPermissionsData} from "./../structs/JBPermissionsData.sol";
|
|
|
5
5
|
|
|
6
6
|
/// @notice Stores permissions for all addresses and operators.
|
|
7
7
|
interface IJBPermissions {
|
|
8
|
+
/// @notice Permissions were set for an operator on behalf of an account.
|
|
9
|
+
/// @param operator The operator whose permissions were set.
|
|
10
|
+
/// @param account The account the permissions are for.
|
|
11
|
+
/// @param projectId The project ID the permissions are scoped to.
|
|
12
|
+
/// @param permissionIds The permission IDs that were set.
|
|
13
|
+
/// @param packed The packed permissions bitmap.
|
|
14
|
+
/// @param caller The address that set the permissions.
|
|
8
15
|
event OperatorPermissionsSet(
|
|
9
16
|
address indexed operator,
|
|
10
17
|
address indexed account,
|
|
@@ -17,13 +24,6 @@ interface IJBPermissions {
|
|
|
17
24
|
/// @notice The project ID considered a wildcard, granting permissions to all projects.
|
|
18
25
|
function WILDCARD_PROJECT_ID() external view returns (uint256);
|
|
19
26
|
|
|
20
|
-
/// @notice Returns the packed permissions that an operator has for an account and project.
|
|
21
|
-
/// @param operator The address of the operator.
|
|
22
|
-
/// @param account The address of the account being operated on behalf of.
|
|
23
|
-
/// @param projectId The project ID the permissions are scoped to. 0 is a wildcard for all projects.
|
|
24
|
-
/// @return The packed permissions as a uint256 bitmap.
|
|
25
|
-
function permissionsOf(address operator, address account, uint256 projectId) external view returns (uint256);
|
|
26
|
-
|
|
27
27
|
/// @notice Checks if an operator has a specific permission for an account and project.
|
|
28
28
|
/// @param operator The operator to check.
|
|
29
29
|
/// @param account The account being operated on behalf of.
|
|
@@ -64,6 +64,13 @@ interface IJBPermissions {
|
|
|
64
64
|
view
|
|
65
65
|
returns (bool);
|
|
66
66
|
|
|
67
|
+
/// @notice Returns the packed permissions that an operator has for an account and project.
|
|
68
|
+
/// @param operator The address of the operator.
|
|
69
|
+
/// @param account The address of the account being operated on behalf of.
|
|
70
|
+
/// @param projectId The project ID the permissions are scoped to. 0 is a wildcard for all projects.
|
|
71
|
+
/// @return The packed permissions as a uint256 bitmap.
|
|
72
|
+
function permissionsOf(address operator, address account, uint256 projectId) external view returns (uint256);
|
|
73
|
+
|
|
67
74
|
/// @notice Sets permissions for an operator on behalf of an account.
|
|
68
75
|
/// @param account The account setting its operator's permissions.
|
|
69
76
|
/// @param permissionsData The data specifying the permissions the operator is being given.
|
|
@@ -7,6 +7,10 @@ import {IJBTerminal} from "./IJBTerminal.sol";
|
|
|
7
7
|
|
|
8
8
|
/// @notice A terminal that supports Permit2 token approvals.
|
|
9
9
|
interface IJBPermitTerminal is IJBTerminal {
|
|
10
|
+
/// @notice A Permit2 allowance approval failed.
|
|
11
|
+
/// @param token The token the approval was attempted for.
|
|
12
|
+
/// @param owner The owner of the tokens.
|
|
13
|
+
/// @param reason The failure reason.
|
|
10
14
|
event Permit2AllowanceFailed(address indexed token, address indexed owner, bytes reason);
|
|
11
15
|
|
|
12
16
|
/// @notice The Permit2 contract used for token approvals.
|
|
@@ -6,6 +6,12 @@ import {IJBProjects} from "./IJBProjects.sol";
|
|
|
6
6
|
|
|
7
7
|
/// @notice Manages price feeds and provides unit prices for currency conversions.
|
|
8
8
|
interface IJBPrices {
|
|
9
|
+
/// @notice A price feed was added for a project's currency pair.
|
|
10
|
+
/// @param projectId The ID of the project the price feed was added for.
|
|
11
|
+
/// @param pricingCurrency The currency the feed's output price is in terms of.
|
|
12
|
+
/// @param unitCurrency The currency being priced by the feed.
|
|
13
|
+
/// @param feed The price feed that was added.
|
|
14
|
+
/// @param caller The address that added the price feed.
|
|
9
15
|
event AddPriceFeed(
|
|
10
16
|
uint256 indexed projectId,
|
|
11
17
|
uint256 indexed pricingCurrency,
|
|
@@ -7,7 +7,15 @@ import {IJBTokenUriResolver} from "./IJBTokenUriResolver.sol";
|
|
|
7
7
|
|
|
8
8
|
/// @notice Mints ERC-721s that represent project ownership and transfers.
|
|
9
9
|
interface IJBProjects is IERC721 {
|
|
10
|
+
/// @notice A new project was created.
|
|
11
|
+
/// @param projectId The ID of the newly created project.
|
|
12
|
+
/// @param owner The address that owns the project.
|
|
13
|
+
/// @param caller The address that created the project.
|
|
10
14
|
event Create(uint256 indexed projectId, address indexed owner, address caller);
|
|
15
|
+
|
|
16
|
+
/// @notice The token URI resolver was set.
|
|
17
|
+
/// @param resolver The new token URI resolver.
|
|
18
|
+
/// @param caller The address that set the resolver.
|
|
11
19
|
event SetTokenUriResolver(IJBTokenUriResolver indexed resolver, address caller);
|
|
12
20
|
|
|
13
21
|
/// @notice Returns the total number of projects that have been created.
|
|
@@ -3,8 +3,8 @@ pragma solidity ^0.8.0;
|
|
|
3
3
|
|
|
4
4
|
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
|
|
5
5
|
|
|
6
|
-
import {JBRuleset} from "./../structs/JBRuleset.sol";
|
|
7
6
|
import {JBApprovalStatus} from "./../enums/JBApprovalStatus.sol";
|
|
7
|
+
import {JBRuleset} from "./../structs/JBRuleset.sol";
|
|
8
8
|
|
|
9
9
|
/// @notice Determines whether the next ruleset in a project's queue is approved or rejected.
|
|
10
10
|
/// @dev Project rulesets are stored in a queue. Rulesets take effect after the previous ruleset in the queue ends, and
|