@bananapus/permission-ids-v6 0.0.21 → 0.0.22
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/JBPermissionIds.sol +184 -71
package/package.json
CHANGED
package/src/JBPermissionIds.sol
CHANGED
|
@@ -1,84 +1,197 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
pragma solidity 0.8.28;
|
|
3
3
|
|
|
4
|
-
/// @notice Permission IDs
|
|
5
|
-
///
|
|
6
|
-
///
|
|
7
|
-
///
|
|
4
|
+
/// @notice Permission IDs used across the Juicebox ecosystem.
|
|
5
|
+
/// @dev Projects can grant permissions to other addresses (called "operators") through `JBPermissions`. Each permission
|
|
6
|
+
/// ID here authorizes the operator to call specific functions on behalf of the project owner or token holder. See
|
|
7
|
+
/// https://github.com/Bananapus/nana-core-v6/blob/main/src/JBPermissions.sol
|
|
8
8
|
library JBPermissionIds {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
uint8 internal constant
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
uint8 internal constant
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
uint8 internal constant
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
uint8 internal constant
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
uint8 internal constant
|
|
36
|
-
|
|
37
|
-
/// @notice
|
|
9
|
+
/// @notice Grants all permissions across every Juicebox contract. An operator with ROOT can do anything the
|
|
10
|
+
/// project owner can do. Use with extreme caution.
|
|
11
|
+
uint8 internal constant ROOT = 1;
|
|
12
|
+
|
|
13
|
+
/* ── nana-core-v6
|
|
14
|
+
───────────────────────────────────────────────────
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/// @notice Queue new rulesets for a project, scheduling future changes to its funding cycles, payouts, and rules
|
|
18
|
+
/// (`JBController.queueRulesetsOf`).
|
|
19
|
+
uint8 internal constant QUEUE_RULESETS = 2;
|
|
20
|
+
|
|
21
|
+
/// @notice Launch a project's first rulesets, initializing its funding cycles and configuration
|
|
22
|
+
/// (`JBController.launchRulesetsFor`).
|
|
23
|
+
uint8 internal constant LAUNCH_RULESETS = 3;
|
|
24
|
+
|
|
25
|
+
/// @notice Cash out (redeem) project tokens from the treasury on behalf of a token holder
|
|
26
|
+
/// (`JBMultiTerminal.cashOutTokensOf`).
|
|
27
|
+
uint8 internal constant CASH_OUT_TOKENS = 4;
|
|
28
|
+
|
|
29
|
+
/// @notice Send a project's payouts to its split recipients, distributing funds from the treasury
|
|
30
|
+
/// (`JBMultiTerminal.sendPayoutsOf`).
|
|
31
|
+
uint8 internal constant SEND_PAYOUTS = 5;
|
|
32
|
+
|
|
33
|
+
/// @notice Migrate a project's terminal balance to a different terminal
|
|
34
|
+
/// (`JBMultiTerminal.migrateBalanceOf`).
|
|
35
|
+
uint8 internal constant MIGRATE_TERMINAL = 6;
|
|
36
|
+
|
|
37
|
+
/// @notice Set or update a project's metadata URI, e.g. its name, description, and logo
|
|
38
|
+
/// (`JBController.setUriOf`).
|
|
39
|
+
uint8 internal constant SET_PROJECT_URI = 7;
|
|
40
|
+
|
|
41
|
+
/// @notice Deploy a new ERC-20 token for a project, allowing token holders to claim transferable tokens
|
|
42
|
+
/// (`JBController.deployERC20For`).
|
|
43
|
+
uint8 internal constant DEPLOY_ERC20 = 8;
|
|
44
|
+
|
|
45
|
+
/// @notice Set a project's token to an existing ERC-20 contract (`JBController.setTokenFor`).
|
|
46
|
+
uint8 internal constant SET_TOKEN = 9;
|
|
47
|
+
|
|
48
|
+
/// @notice Mint new project tokens and allocate them to a beneficiary (`JBController.mintTokensOf`).
|
|
49
|
+
/// @dev Only works if the project's ruleset allows owner minting.
|
|
50
|
+
uint8 internal constant MINT_TOKENS = 10;
|
|
51
|
+
|
|
52
|
+
/// @notice Burn project tokens on behalf of a token holder, reducing the total supply
|
|
53
|
+
/// (`JBController.burnTokensOf`).
|
|
54
|
+
uint8 internal constant BURN_TOKENS = 11;
|
|
55
|
+
|
|
56
|
+
/// @notice Claim internal token credits as ERC-20 tokens on behalf of a holder
|
|
57
|
+
/// (`JBController.claimTokensFor`).
|
|
58
|
+
uint8 internal constant CLAIM_TOKENS = 12;
|
|
59
|
+
|
|
60
|
+
/// @notice Transfer internal token credits (unclaimed tokens) to another address
|
|
61
|
+
/// (`JBController.transferCreditsFrom`).
|
|
62
|
+
uint8 internal constant TRANSFER_CREDITS = 13;
|
|
63
|
+
|
|
64
|
+
/// @notice Set a project's controller — the contract that manages its rulesets and token issuance
|
|
65
|
+
/// (`JBDirectory.setControllerOf`).
|
|
66
|
+
/// @dev Changing the controller is a significant governance action.
|
|
67
|
+
uint8 internal constant SET_CONTROLLER = 14;
|
|
68
|
+
|
|
69
|
+
/// @notice Replace a project's full list of payment terminals, which can add or remove terminals
|
|
70
|
+
/// (`JBDirectory.setTerminalsOf`).
|
|
71
|
+
/// @dev This can remove the primary terminal — use with caution.
|
|
72
|
+
uint8 internal constant SET_TERMINALS = 15;
|
|
73
|
+
|
|
74
|
+
/// @notice Add a new terminal to a project when setting a primary terminal for a token
|
|
75
|
+
/// (`JBDirectory.setPrimaryTerminalOf`, when it implicitly adds a new terminal).
|
|
76
|
+
uint8 internal constant ADD_TERMINALS = 16;
|
|
77
|
+
|
|
78
|
+
/// @notice Set which terminal is the primary one for receiving a specific token
|
|
79
|
+
/// (`JBDirectory.setPrimaryTerminalOf`).
|
|
80
|
+
uint8 internal constant SET_PRIMARY_TERMINAL = 17;
|
|
81
|
+
|
|
82
|
+
/// @notice Spend funds from a project's surplus allowance — discretionary funds beyond payout limits
|
|
83
|
+
/// (`JBMultiTerminal.useAllowanceOf`).
|
|
84
|
+
uint8 internal constant USE_ALLOWANCE = 18;
|
|
85
|
+
|
|
86
|
+
/// @notice Configure how a project's payouts and reserved tokens are split among recipients
|
|
87
|
+
/// (`JBController.setSplitGroupsOf`).
|
|
88
|
+
uint8 internal constant SET_SPLIT_GROUPS = 19;
|
|
89
|
+
|
|
90
|
+
/// @notice Add a price feed that converts between two currencies for a project's accounting
|
|
91
|
+
/// (`JBController.addPriceFeedFor`).
|
|
92
|
+
uint8 internal constant ADD_PRICE_FEED = 20;
|
|
93
|
+
|
|
94
|
+
/// @notice Register new token types that a project's terminal can accept as payment
|
|
95
|
+
/// (`JBMultiTerminal.addAccountingContextsFor`).
|
|
96
|
+
uint8 internal constant ADD_ACCOUNTING_CONTEXTS = 21;
|
|
97
|
+
|
|
98
|
+
/// @notice Update the on-chain metadata (name, symbol, etc.) of a project's ERC-20 token
|
|
99
|
+
/// (`JBController.setTokenMetadataOf`).
|
|
100
|
+
uint8 internal constant SET_TOKEN_METADATA = 22;
|
|
101
|
+
|
|
102
|
+
/// @notice Sign messages on behalf of a project's ERC-20 token via ERC-1271
|
|
103
|
+
/// (`JBERC20.isValidSignature`).
|
|
38
104
|
/// @dev Used for Etherscan contract verification and other off-chain signature validation.
|
|
39
105
|
uint8 internal constant SIGN_FOR_ERC20 = 23;
|
|
40
106
|
|
|
41
|
-
/*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
///
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
///
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
///
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
uint8 internal constant
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
/// @notice
|
|
107
|
+
/* ── nana-721-hook-v6
|
|
108
|
+
───────────────────────────────────────────────
|
|
109
|
+
*/
|
|
110
|
+
|
|
111
|
+
/// @notice Add, remove, or modify NFT tiers for a project's 721 hook
|
|
112
|
+
/// (`JB721TiersHook.adjustTiers`).
|
|
113
|
+
uint8 internal constant ADJUST_721_TIERS = 24;
|
|
114
|
+
|
|
115
|
+
/// @notice Update the metadata (base URI, contract URI, token URI resolver) of a project's NFT collection
|
|
116
|
+
/// (`JB721TiersHook.setMetadata`).
|
|
117
|
+
uint8 internal constant SET_721_METADATA = 25;
|
|
118
|
+
|
|
119
|
+
/// @notice Mint NFTs directly to a beneficiary without requiring payment, typically for reserved or promotional
|
|
120
|
+
/// NFTs (`JB721TiersHook.mintFor`).
|
|
121
|
+
uint8 internal constant MINT_721 = 26;
|
|
122
|
+
|
|
123
|
+
/// @notice Set a discount percentage for a specific NFT tier, reducing the payment required to mint
|
|
124
|
+
/// (`JB721TiersHook.setDiscountPercentOf`).
|
|
125
|
+
uint8 internal constant SET_721_DISCOUNT_PERCENT = 27;
|
|
126
|
+
|
|
127
|
+
/* ── nana-buyback-hook-v6
|
|
128
|
+
───────────────────────────────────────────
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
/// @notice Set the TWAP (time-weighted average price) window used by a project's buyback hook to determine when
|
|
132
|
+
/// buying tokens on a DEX is cheaper than minting (`JBBuybackHook.setTwapWindowOf`).
|
|
133
|
+
uint8 internal constant SET_BUYBACK_TWAP = 28;
|
|
134
|
+
|
|
135
|
+
/// @notice Set which Uniswap V4 pool a project's buyback hook uses for token buybacks
|
|
136
|
+
/// (`JBBuybackHook.setPoolFor`).
|
|
137
|
+
uint8 internal constant SET_BUYBACK_POOL = 29;
|
|
138
|
+
|
|
139
|
+
/// @notice Configure or permanently lock a project's buyback hook
|
|
140
|
+
/// (`JBBuybackHookRegistry.setHookFor` and `JBBuybackHookRegistry.lockHookFor`).
|
|
141
|
+
/// @dev An operator with this permission can lock the hook, preventing future changes.
|
|
142
|
+
uint8 internal constant SET_BUYBACK_HOOK = 30;
|
|
143
|
+
|
|
144
|
+
/* ── nana-router-terminal-v6
|
|
145
|
+
────────────────────────────────────────
|
|
146
|
+
*/
|
|
147
|
+
|
|
148
|
+
/// @notice Configure or permanently lock a project's router terminal, which routes payments through a DEX
|
|
149
|
+
/// (`JBRouterTerminalRegistry.setTerminalFor` and `JBRouterTerminalRegistry.lockTerminalFor`).
|
|
150
|
+
/// @dev An operator with this permission can lock the terminal, preventing future changes.
|
|
151
|
+
uint8 internal constant SET_ROUTER_TERMINAL = 31;
|
|
152
|
+
|
|
153
|
+
/* ── nana-suckers-v6
|
|
154
|
+
────────────────────────────────────────────────
|
|
155
|
+
*/
|
|
156
|
+
|
|
157
|
+
/// @notice Map a token on one chain to its counterpart on another chain within a cross-chain sucker bridge
|
|
158
|
+
/// (`JBSucker.mapToken`).
|
|
159
|
+
uint8 internal constant MAP_SUCKER_TOKEN = 32;
|
|
160
|
+
|
|
161
|
+
/// @notice Deploy cross-chain sucker bridges for a project, enabling token bridging between chains
|
|
162
|
+
/// (`JBSuckerRegistry.deploySuckersFor`).
|
|
163
|
+
uint8 internal constant DEPLOY_SUCKERS = 33;
|
|
164
|
+
|
|
165
|
+
/// @notice Enable the emergency hatch on a cross-chain sucker, allowing stuck tokens to be recovered
|
|
166
|
+
/// (`JBSucker.enableEmergencyHatchFor`).
|
|
167
|
+
uint8 internal constant SUCKER_SAFETY = 34;
|
|
168
|
+
|
|
169
|
+
/// @notice Set the deprecation status of a cross-chain sucker, progressing it through its shutdown lifecycle
|
|
170
|
+
/// (`JBSucker.setDeprecation`).
|
|
171
|
+
uint8 internal constant SET_SUCKER_DEPRECATION = 35;
|
|
172
|
+
|
|
173
|
+
/* ── revnet-core-v6
|
|
174
|
+
─────────────────────────────────────────────────
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
/// @notice Hide tokens on behalf of a holder, removing them from public visibility
|
|
178
|
+
/// (`REVHiddenTokens.hideTokensFor`).
|
|
179
|
+
/// @dev Hidden tokens are still owned by the holder and can be revealed later.
|
|
74
180
|
uint8 internal constant HIDE_TOKENS = 36;
|
|
75
|
-
|
|
181
|
+
|
|
182
|
+
/// @notice Open a loan against project tokens as collateral on behalf of a token holder
|
|
183
|
+
/// (`REVLoans.borrowFrom`).
|
|
76
184
|
uint8 internal constant OPEN_LOAN = 37;
|
|
77
|
-
|
|
78
|
-
///
|
|
185
|
+
|
|
186
|
+
/// @notice Move loan collateral between projects on behalf of a loan owner
|
|
187
|
+
/// (`REVLoans.reallocateCollateralFromLoan`).
|
|
79
188
|
uint8 internal constant REALLOCATE_LOAN = 38;
|
|
80
|
-
|
|
189
|
+
|
|
190
|
+
/// @notice Repay a loan on behalf of the loan owner, returning collateral tokens
|
|
191
|
+
/// (`REVLoans.repayLoan`).
|
|
81
192
|
uint8 internal constant REPAY_LOAN = 39;
|
|
82
|
-
|
|
193
|
+
|
|
194
|
+
/// @notice Reveal previously hidden tokens on behalf of a holder, making them publicly visible again
|
|
195
|
+
/// (`REVHiddenTokens.revealTokensFor`).
|
|
83
196
|
uint8 internal constant REVEAL_TOKENS = 40;
|
|
84
197
|
}
|