@bananapus/permission-ids-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/ADMINISTRATION.md +2 -2
- package/ARCHITECTURE.md +2 -2
- package/AUDIT_INSTRUCTIONS.md +149 -0
- package/CHANGE_LOG.md +142 -0
- package/README.md +1 -1
- package/RISKS.md +13 -16
- package/SKILLS.md +2 -2
- package/USER_JOURNEYS.md +187 -0
- package/package.json +1 -1
- package/src/JBPermissionIds.sol +2 -2
package/ADMINISTRATION.md
CHANGED
|
@@ -32,9 +32,9 @@ All 33 defined permission IDs and what they control:
|
|
|
32
32
|
| 16 | `SET_PRIMARY_TERMINAL` | nana-core | `JBDirectory.setPrimaryTerminalOf` -- set the primary terminal for a token. |
|
|
33
33
|
| 17 | `USE_ALLOWANCE` | nana-core | `JBMultiTerminal.useAllowanceOf` -- spend surplus allowance to an arbitrary address. |
|
|
34
34
|
| 18 | `SET_SPLIT_GROUPS` | nana-core | `JBController.setSplitGroupsOf` -- configure payout and reserved token splits. |
|
|
35
|
-
| 19 | `ADD_PRICE_FEED` | nana-core | `
|
|
35
|
+
| 19 | `ADD_PRICE_FEED` | nana-core | `JBController.addPriceFeed` (which internally calls `JBPrices.addPriceFeedFor`) -- add a price feed for a project. |
|
|
36
36
|
| 20 | `ADD_ACCOUNTING_CONTEXTS` | nana-core | `JBMultiTerminal.addAccountingContextsFor` -- add accepted tokens to a terminal. |
|
|
37
|
-
| 21 | `SET_TOKEN_METADATA` | nana-core | `JBController.
|
|
37
|
+
| 21 | `SET_TOKEN_METADATA` | nana-core | `JBController.setTokenMetadataOf` -- set a project token's name and symbol. |
|
|
38
38
|
| 22 | `ADJUST_721_TIERS` | nana-721-hook | `JB721TiersHook.adjustTiers` -- add or remove NFT tiers. |
|
|
39
39
|
| 23 | `SET_721_METADATA` | nana-721-hook | `JB721TiersHook.setMetadata` -- set NFT metadata URIs. |
|
|
40
40
|
| 24 | `MINT_721` | nana-721-hook | `JB721TiersHook.mintFor` -- manually mint NFTs to a beneficiary. |
|
package/ARCHITECTURE.md
CHANGED
|
@@ -33,9 +33,9 @@ src/
|
|
|
33
33
|
| 16 | `SET_PRIMARY_TERMINAL` | nana-core | `JBDirectory.setPrimaryTerminalOf` |
|
|
34
34
|
| 17 | `USE_ALLOWANCE` | nana-core | `JBMultiTerminal.useAllowanceOf` |
|
|
35
35
|
| 18 | `SET_SPLIT_GROUPS` | nana-core | `JBController.setSplitGroupsOf` |
|
|
36
|
-
| 19 | `ADD_PRICE_FEED` | nana-core | `
|
|
36
|
+
| 19 | `ADD_PRICE_FEED` | nana-core | `JBController.addPriceFeed` |
|
|
37
37
|
| 20 | `ADD_ACCOUNTING_CONTEXTS` | nana-core | `JBMultiTerminal.addAccountingContextsFor` |
|
|
38
|
-
| 21 | `SET_TOKEN_METADATA` | nana-core | `JBController.
|
|
38
|
+
| 21 | `SET_TOKEN_METADATA` | nana-core | `JBController.setTokenMetadataOf` |
|
|
39
39
|
| 22 | `ADJUST_721_TIERS` | nana-721-hook | `JB721TiersHook.adjustTiers` |
|
|
40
40
|
| 23 | `SET_721_METADATA` | nana-721-hook | `JB721TiersHook.setMetadata` |
|
|
41
41
|
| 24 | `MINT_721` | nana-721-hook | `JB721TiersHook.mintFor` |
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# Audit Instructions -- nana-permission-ids-v6
|
|
2
|
+
|
|
3
|
+
You are auditing a constants-only library that defines all permission IDs used across the Juicebox V6 ecosystem. The library has no state, no functions, no constructors, and no dependencies. The entire audit surface is the correctness and consistency of 33 `uint8` constants. Read [RISKS.md](./RISKS.md) first -- it documents all known risks and trust assumptions. Then come back here.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
**In scope:**
|
|
8
|
+
```
|
|
9
|
+
src/JBPermissionIds.sol # Constants library (~67 lines, 33 permission IDs)
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**Out of scope:** All consuming contracts (nana-core, nana-721-hook, nana-buyback-hook, nana-router-terminal, nana-suckers, revnet-core, croptop-core). The constants library has no dependencies.
|
|
13
|
+
|
|
14
|
+
## Architecture
|
|
15
|
+
|
|
16
|
+
`JBPermissionIds` is a Solidity library containing 33 `uint8 internal constant` values numbered 1 through 33. These IDs are used with `JBPermissions.setPermissionsFor()` to grant scoped access to protocol functions. The permission system stores permissions as a 256-bit packed integer (`uint256`), with each bit corresponding to a permission ID.
|
|
17
|
+
|
|
18
|
+
### Permission System Overview
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
permissionsOf[operator][account][projectId] => uint256 (one bit per permission ID)
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
- **Bit 0 (ID 0):** Reserved, cannot be set. `JBPermissions` reverts if bit 0 is included.
|
|
25
|
+
- **Bit 1 (ID 1, ROOT):** Grants all permissions across all contracts. Cannot be granted for wildcard `projectId = 0`.
|
|
26
|
+
- **Bits 2-33:** Individual permissions, each gating a specific function (or set of functions) in the ecosystem.
|
|
27
|
+
- **Bits 34-255:** Unassigned, available for future extensions.
|
|
28
|
+
|
|
29
|
+
### All Permission IDs
|
|
30
|
+
|
|
31
|
+
| ID | Constant | Gated Function(s) | Checked Against |
|
|
32
|
+
|----|----------|-------------------|-----------------|
|
|
33
|
+
| 1 | `ROOT` | All permissions (implicit) | Project owner |
|
|
34
|
+
| 2 | `QUEUE_RULESETS` | `JBController.queueRulesetsOf` | Project owner |
|
|
35
|
+
| 3 | `LAUNCH_RULESETS` | `JBController.launchRulesetsFor` (also needs SET_TERMINALS) | Project owner |
|
|
36
|
+
| 4 | `CASH_OUT_TOKENS` | `JBMultiTerminal.cashOutTokensOf` | **Token holder** |
|
|
37
|
+
| 5 | `SEND_PAYOUTS` | `JBMultiTerminal.sendPayoutsOf` | Project owner |
|
|
38
|
+
| 6 | `MIGRATE_TERMINAL` | `JBMultiTerminal.migrateBalanceOf` | Project owner |
|
|
39
|
+
| 7 | `SET_PROJECT_URI` | `JBController.setUriOf` | Project owner |
|
|
40
|
+
| 8 | `DEPLOY_ERC20` | `JBController.deployERC20For` | Project owner |
|
|
41
|
+
| 9 | `SET_TOKEN` | `JBController.setTokenFor` | Project owner |
|
|
42
|
+
| 10 | `MINT_TOKENS` | `JBController.mintTokensOf` | Project owner |
|
|
43
|
+
| 11 | `BURN_TOKENS` | `JBController.burnTokensOf` | **Token holder** |
|
|
44
|
+
| 12 | `CLAIM_TOKENS` | `JBController.claimTokensFor` | **Token holder** |
|
|
45
|
+
| 13 | `TRANSFER_CREDITS` | `JBController.transferCreditsFrom` | **Token holder** |
|
|
46
|
+
| 14 | `SET_CONTROLLER` | `JBDirectory.setControllerOf` | Project owner |
|
|
47
|
+
| 15 | `SET_TERMINALS` | `JBDirectory.setTerminalsOf` (WARNING: can remove primary terminal) | Project owner |
|
|
48
|
+
| 16 | `SET_PRIMARY_TERMINAL` | `JBDirectory.setPrimaryTerminalOf` | Project owner |
|
|
49
|
+
| 17 | `USE_ALLOWANCE` | `JBMultiTerminal.useAllowanceOf` | Project owner |
|
|
50
|
+
| 18 | `SET_SPLIT_GROUPS` | `JBController.setSplitGroupsOf` | Project owner |
|
|
51
|
+
| 19 | `ADD_PRICE_FEED` | `JBController.addPriceFeed` (not `JBPrices` directly) | Project owner |
|
|
52
|
+
| 20 | `ADD_ACCOUNTING_CONTEXTS` | `JBMultiTerminal.addAccountingContextsFor` | Project owner |
|
|
53
|
+
| 21 | `SET_TOKEN_METADATA` | `JBController.setTokenMetadataOf` | Project owner |
|
|
54
|
+
| 22 | `ADJUST_721_TIERS` | `JB721TiersHook.adjustTiers` | Hook owner |
|
|
55
|
+
| 23 | `SET_721_METADATA` | `JB721TiersHook.setMetadata` | Hook owner |
|
|
56
|
+
| 24 | `MINT_721` | `JB721TiersHook.mintFor` | Hook owner |
|
|
57
|
+
| 25 | `SET_721_DISCOUNT_PERCENT` | `JB721TiersHook.setDiscountPercentOf` | Hook owner |
|
|
58
|
+
| 26 | `SET_BUYBACK_TWAP` | `JBBuybackHook.setTwapWindowOf` | Project owner |
|
|
59
|
+
| 27 | `SET_BUYBACK_POOL` | `JBBuybackHook.setPoolFor` | Project owner |
|
|
60
|
+
| 28 | `SET_BUYBACK_HOOK` | `JBBuybackHookRegistry.setHookFor` + `lockHookFor` | Project owner |
|
|
61
|
+
| 29 | `SET_ROUTER_TERMINAL` | `JBRouterTerminalRegistry.setTerminalFor` + `lockTerminalFor` | Project owner |
|
|
62
|
+
| 30 | `MAP_SUCKER_TOKEN` | `JBSucker.mapToken` | Project owner |
|
|
63
|
+
| 31 | `DEPLOY_SUCKERS` | `JBSuckerRegistry.deploySuckersFor` | Project owner |
|
|
64
|
+
| 32 | `SUCKER_SAFETY` | `JBSucker.enableEmergencyHatchFor` | Project owner |
|
|
65
|
+
| 33 | `SET_SUCKER_DEPRECATION` | `JBSucker.setDeprecation` | Project owner |
|
|
66
|
+
|
|
67
|
+
## Priority Audit Areas
|
|
68
|
+
|
|
69
|
+
### 1. ID Uniqueness (Highest Priority)
|
|
70
|
+
|
|
71
|
+
Every permission ID must be unique. Two different constants with the same numeric value would cause one permission grant to silently authorize a different action. Verify:
|
|
72
|
+
|
|
73
|
+
- All 33 constants have distinct values.
|
|
74
|
+
- Values are sequential from 1 to 33 with no gaps and no duplicates.
|
|
75
|
+
- No other file in the ecosystem defines additional permission ID constants that could collide with these.
|
|
76
|
+
|
|
77
|
+
### 2. ID-to-Function Mapping Correctness
|
|
78
|
+
|
|
79
|
+
Each constant's doc comment claims it gates a specific function. Verify against the actual source code of each consuming contract:
|
|
80
|
+
|
|
81
|
+
- **nana-core-v6**: IDs 2-21 should match the `_requirePermissionFrom` calls in `JBController`, `JBMultiTerminal`, and `JBDirectory`.
|
|
82
|
+
- **nana-721-hook-v6**: IDs 22-25 should match permission checks in `JB721TiersHook`.
|
|
83
|
+
- **nana-buyback-hook-v6**: IDs 26-28 should match permission checks in `JBBuybackHook` and `JBBuybackHookRegistry`.
|
|
84
|
+
- **nana-router-terminal-v6**: ID 29 should match permission checks in `JBRouterTerminalRegistry`.
|
|
85
|
+
- **nana-suckers-v6**: IDs 30-33 should match permission checks in `JBSucker` and `JBSuckerRegistry`.
|
|
86
|
+
|
|
87
|
+
Known discrepancy to investigate: **SET_BUYBACK_HOOK (ID 28)** -- the source comment says it gates `JBBuybackHookRegistry.setHookFor` and `lockHookFor`, but those functions may actually check `SET_BUYBACK_POOL` (ID 27) instead. Verify which ID is actually checked in the registry code and whether this mismatch causes any practical issue.
|
|
88
|
+
|
|
89
|
+
### 3. Holder-Scoped vs Owner-Scoped Permissions
|
|
90
|
+
|
|
91
|
+
Four permissions are checked against the **token holder**, not the project owner:
|
|
92
|
+
|
|
93
|
+
- `CASH_OUT_TOKENS` (4) -- holder authorizes cashout of their tokens
|
|
94
|
+
- `BURN_TOKENS` (11) -- holder authorizes burning their tokens
|
|
95
|
+
- `CLAIM_TOKENS` (12) -- holder authorizes claiming their credits as ERC-20
|
|
96
|
+
- `TRANSFER_CREDITS` (13) -- holder authorizes transferring their credit balance
|
|
97
|
+
|
|
98
|
+
Verify that no consuming contract incorrectly checks these against the project owner. A confused check would mean the project owner could burn or cash out any holder's tokens (massive vulnerability).
|
|
99
|
+
|
|
100
|
+
### 4. Dual-Purpose Permission IDs
|
|
101
|
+
|
|
102
|
+
Two IDs intentionally gate both a "set" and a "lock" operation:
|
|
103
|
+
|
|
104
|
+
- **SET_BUYBACK_HOOK (28)**: Gates both `setHookFor` (configurable) and `lockHookFor` (permanent). An operator with this permission can permanently lock the hook configuration.
|
|
105
|
+
- **SET_ROUTER_TERMINAL (29)**: Gates both `setTerminalFor` (configurable) and `lockTerminalFor` (permanent). An operator with this permission can permanently lock the terminal configuration.
|
|
106
|
+
|
|
107
|
+
Verify that project owners are aware of the locking implication when granting these permissions. The source code includes `@dev` documentation, but this is a significant trust escalation.
|
|
108
|
+
|
|
109
|
+
### 5. ROOT Permission Safety
|
|
110
|
+
|
|
111
|
+
ROOT (ID 1) is the superadmin permission. The `JBPermissions` contract implements critical safety rails:
|
|
112
|
+
|
|
113
|
+
- ROOT cannot be granted for wildcard `projectId = 0` (would grant root across all projects)
|
|
114
|
+
- A ROOT operator can call `setPermissionsFor` on behalf of the account but cannot grant ROOT to others
|
|
115
|
+
- ROOT cannot be included when setting wildcard project permissions
|
|
116
|
+
|
|
117
|
+
Verify these constraints are enforced in `JBPermissions`, not in this library (this library only defines the constant).
|
|
118
|
+
|
|
119
|
+
### 6. SET_TERMINALS (ID 15) Risk
|
|
120
|
+
|
|
121
|
+
The source comment warns: "Be careful - `SET_TERMINALS` can be used to remove the primary terminal." Additionally, `LAUNCH_RULESETS` (ID 3) requires both ID 3 AND ID 15 because the launch function configures terminals. Verify:
|
|
122
|
+
|
|
123
|
+
- Granting `SET_TERMINALS` alone is sufficient to replace the entire terminal list, potentially breaking a project.
|
|
124
|
+
- Granting `LAUNCH_RULESETS` without also granting `SET_TERMINALS` will cause `launchRulesetsFor` to revert (dual permission check).
|
|
125
|
+
|
|
126
|
+
## Invariants to Verify
|
|
127
|
+
|
|
128
|
+
1. **Uniqueness**: All 33 constants have unique values in the range [1, 33].
|
|
129
|
+
2. **Completeness**: Every `_requirePermissionFrom` call in the ecosystem uses one of these constants (no magic numbers).
|
|
130
|
+
3. **Type consistency**: All constants are `uint8`, matching the parameter type of `JBPermissions.hasPermission`.
|
|
131
|
+
4. **No ID 0**: No constant has value 0 (reserved and forbidden by `JBPermissions`).
|
|
132
|
+
5. **Sequential assignment**: IDs are assigned 1 through 33 with no gaps.
|
|
133
|
+
|
|
134
|
+
## Testing Setup
|
|
135
|
+
|
|
136
|
+
This is a constants-only library with no runtime behavior. There are no test files. Verification is done by cross-referencing the constants against consuming contracts.
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
cd nana-permission-ids-v6
|
|
140
|
+
forge build # Ensures the library compiles
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
To verify ID usage across the ecosystem:
|
|
144
|
+
```bash
|
|
145
|
+
# Search for permission ID usage in consuming repos
|
|
146
|
+
grep -r "JBPermissionIds\." ../nana-core-v6/src/ ../nana-721-hook-v6/src/ ../nana-buyback-hook-v6/src/ ../nana-router-terminal-v6/src/ ../nana-suckers-v6/src/
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Go break it.
|
package/CHANGE_LOG.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# nana-permission-ids-v6 Changelog (v5 → v6)
|
|
2
|
+
|
|
3
|
+
This document describes all changes between `nana-permission-ids` (v5) and `nana-permission-ids-v6` (v6).
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Breaking Changes
|
|
8
|
+
|
|
9
|
+
### All numeric IDs shifted
|
|
10
|
+
|
|
11
|
+
The insertion of `LAUNCH_RULESETS` at ID 3 pushed every subsequent permission ID up by one. Additional new permissions at the end of each section caused further shifts. **Any code that hardcodes numeric permission values will break.**
|
|
12
|
+
|
|
13
|
+
| Permission | v5 ID | v6 ID |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| `ROOT` | 1 | 1 |
|
|
16
|
+
| `QUEUE_RULESETS` | 2 | 2 |
|
|
17
|
+
| `CASH_OUT_TOKENS` | 3 | 4 |
|
|
18
|
+
| `SEND_PAYOUTS` | 4 | 5 |
|
|
19
|
+
| `MIGRATE_TERMINAL` | 5 | 6 |
|
|
20
|
+
| `SET_PROJECT_URI` | 6 | 7 |
|
|
21
|
+
| `DEPLOY_ERC20` | 7 | 8 |
|
|
22
|
+
| `SET_TOKEN` | 8 | 9 |
|
|
23
|
+
| `MINT_TOKENS` | 9 | 10 |
|
|
24
|
+
| `BURN_TOKENS` | 10 | 11 |
|
|
25
|
+
| `CLAIM_TOKENS` | 11 | 12 |
|
|
26
|
+
| `TRANSFER_CREDITS` | 12 | 13 |
|
|
27
|
+
| `SET_CONTROLLER` | 13 | 14 |
|
|
28
|
+
| `SET_TERMINALS` | 14 | 15 |
|
|
29
|
+
| `SET_PRIMARY_TERMINAL` | 15 | 16 |
|
|
30
|
+
| `USE_ALLOWANCE` | 16 | 17 |
|
|
31
|
+
| `SET_SPLIT_GROUPS` | 17 | 18 |
|
|
32
|
+
| `ADD_PRICE_FEED` | 18 | 19 |
|
|
33
|
+
| `ADD_ACCOUNTING_CONTEXTS` | 19 | 20 |
|
|
34
|
+
| `ADJUST_721_TIERS` | 20 | 22 |
|
|
35
|
+
| `SET_721_METADATA` | 21 | 23 |
|
|
36
|
+
| `MINT_721` | 22 | 24 |
|
|
37
|
+
| `SET_721_DISCOUNT_PERCENT` | 23 | 25 |
|
|
38
|
+
| `SET_BUYBACK_TWAP` | 24 | 26 |
|
|
39
|
+
| `SET_BUYBACK_POOL` | 25 | 27 |
|
|
40
|
+
| `MAP_SUCKER_TOKEN` | 28 | 30 |
|
|
41
|
+
| `DEPLOY_SUCKERS` | 29 | 31 |
|
|
42
|
+
| `SUCKER_SAFETY` | 30 | 32 |
|
|
43
|
+
|
|
44
|
+
### `QUEUE_RULESETS` split into two permissions
|
|
45
|
+
|
|
46
|
+
In v5, `QUEUE_RULESETS` (2) granted permission to call both `JBController.queueRulesetsOf` and `JBController.launchRulesetsFor`. In v6, these are separate:
|
|
47
|
+
|
|
48
|
+
- `QUEUE_RULESETS` (2) -- only `JBController.queueRulesetsOf`
|
|
49
|
+
- `LAUNCH_RULESETS` (3) -- only `JBController.launchRulesetsFor`
|
|
50
|
+
|
|
51
|
+
### `SUCKER_SAFETY` split into two permissions
|
|
52
|
+
|
|
53
|
+
In v5, `SUCKER_SAFETY` (30) granted permission to call both `BPSucker.enableEmergencyHatchFor` and `BPSucker.setDeprecation`. In v6, these are separate:
|
|
54
|
+
|
|
55
|
+
- `SUCKER_SAFETY` (32) -- only `JBSucker.enableEmergencyHatchFor`
|
|
56
|
+
- `SET_SUCKER_DEPRECATION` (33) -- only `JBSucker.setDeprecation`
|
|
57
|
+
|
|
58
|
+
### Swap terminal permissions removed
|
|
59
|
+
|
|
60
|
+
The following permissions from `nana-swap-terminal` no longer exist in v6:
|
|
61
|
+
|
|
62
|
+
| Removed | v5 ID | Notes |
|
|
63
|
+
|---|---|---|
|
|
64
|
+
| `ADD_SWAP_TERMINAL_POOL` | 26 | Was for `JBSwapTerminal.addDefaultPool` |
|
|
65
|
+
| `ADD_SWAP_TERMINAL_TWAP_PARAMS` | 27 | Was for `JBSwapTerminal.addTwapParamsFor` |
|
|
66
|
+
|
|
67
|
+
### Contract prefix rename (suckers)
|
|
68
|
+
|
|
69
|
+
Sucker contract references changed from `BP*` to `JB*`:
|
|
70
|
+
|
|
71
|
+
- `BPSucker` → `JBSucker`
|
|
72
|
+
- `BPSuckerRegistry` → `JBSuckerRegistry`
|
|
73
|
+
|
|
74
|
+
### `SET_BUYBACK_TWAP` comment narrowed
|
|
75
|
+
|
|
76
|
+
In v5, the comment stated this gates both `JBBuybackHook.setTwapWindowOf` and `JBBuybackHook.setTwapSlippageToleranceOf`. In v6, the comment only mentions `JBBuybackHook.setTwapWindowOf`.
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## 2. New Features
|
|
81
|
+
|
|
82
|
+
### `LAUNCH_RULESETS` (3)
|
|
83
|
+
|
|
84
|
+
New permission split from `QUEUE_RULESETS`. Gates `JBController.launchRulesetsFor` independently.
|
|
85
|
+
|
|
86
|
+
### `SET_TOKEN_METADATA` (21)
|
|
87
|
+
|
|
88
|
+
New core permission. Gates `JBController.setMetadataOf` for setting project token metadata.
|
|
89
|
+
|
|
90
|
+
### `SET_BUYBACK_HOOK` (28)
|
|
91
|
+
|
|
92
|
+
New buyback hook permission. Gates both `JBBuybackHookRegistry.setHookFor` and `JBBuybackHookRegistry.lockHookFor`. Note: granting this permission allows the operator to permanently lock the hook configuration.
|
|
93
|
+
|
|
94
|
+
### `SET_ROUTER_TERMINAL` (29)
|
|
95
|
+
|
|
96
|
+
New router terminal permission. Gates both `JBRouterTerminalRegistry.setTerminalFor` and `JBRouterTerminalRegistry.lockTerminalFor`. Note: granting this permission allows the operator to permanently lock the terminal configuration.
|
|
97
|
+
|
|
98
|
+
### `SET_SUCKER_DEPRECATION` (33)
|
|
99
|
+
|
|
100
|
+
New permission split from `SUCKER_SAFETY`. Gates `JBSucker.setDeprecation` independently.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 3. Migration Table
|
|
105
|
+
|
|
106
|
+
| v5 Name | v5 ID | v6 Name | v6 ID | Change |
|
|
107
|
+
|---|---|---|---|---|
|
|
108
|
+
| `ROOT` | 1 | `ROOT` | 1 | Unchanged |
|
|
109
|
+
| `QUEUE_RULESETS` | 2 | `QUEUE_RULESETS` | 2 | Narrowed (no longer includes launch) |
|
|
110
|
+
| -- | -- | `LAUNCH_RULESETS` | 3 | **New** (split from `QUEUE_RULESETS`) |
|
|
111
|
+
| `CASH_OUT_TOKENS` | 3 | `CASH_OUT_TOKENS` | 4 | ID changed |
|
|
112
|
+
| `SEND_PAYOUTS` | 4 | `SEND_PAYOUTS` | 5 | ID changed |
|
|
113
|
+
| `MIGRATE_TERMINAL` | 5 | `MIGRATE_TERMINAL` | 6 | ID changed |
|
|
114
|
+
| `SET_PROJECT_URI` | 6 | `SET_PROJECT_URI` | 7 | ID changed |
|
|
115
|
+
| `DEPLOY_ERC20` | 7 | `DEPLOY_ERC20` | 8 | ID changed |
|
|
116
|
+
| `SET_TOKEN` | 8 | `SET_TOKEN` | 9 | ID changed |
|
|
117
|
+
| `MINT_TOKENS` | 9 | `MINT_TOKENS` | 10 | ID changed |
|
|
118
|
+
| `BURN_TOKENS` | 10 | `BURN_TOKENS` | 11 | ID changed |
|
|
119
|
+
| `CLAIM_TOKENS` | 11 | `CLAIM_TOKENS` | 12 | ID changed |
|
|
120
|
+
| `TRANSFER_CREDITS` | 12 | `TRANSFER_CREDITS` | 13 | ID changed |
|
|
121
|
+
| `SET_CONTROLLER` | 13 | `SET_CONTROLLER` | 14 | ID changed |
|
|
122
|
+
| `SET_TERMINALS` | 14 | `SET_TERMINALS` | 15 | ID changed |
|
|
123
|
+
| `SET_PRIMARY_TERMINAL` | 15 | `SET_PRIMARY_TERMINAL` | 16 | ID changed |
|
|
124
|
+
| `USE_ALLOWANCE` | 16 | `USE_ALLOWANCE` | 17 | ID changed |
|
|
125
|
+
| `SET_SPLIT_GROUPS` | 17 | `SET_SPLIT_GROUPS` | 18 | ID changed |
|
|
126
|
+
| `ADD_PRICE_FEED` | 18 | `ADD_PRICE_FEED` | 19 | ID changed |
|
|
127
|
+
| `ADD_ACCOUNTING_CONTEXTS` | 19 | `ADD_ACCOUNTING_CONTEXTS` | 20 | ID changed |
|
|
128
|
+
| -- | -- | `SET_TOKEN_METADATA` | 21 | **New** |
|
|
129
|
+
| `ADJUST_721_TIERS` | 20 | `ADJUST_721_TIERS` | 22 | ID changed |
|
|
130
|
+
| `SET_721_METADATA` | 21 | `SET_721_METADATA` | 23 | ID changed |
|
|
131
|
+
| `MINT_721` | 22 | `MINT_721` | 24 | ID changed |
|
|
132
|
+
| `SET_721_DISCOUNT_PERCENT` | 23 | `SET_721_DISCOUNT_PERCENT` | 25 | ID changed |
|
|
133
|
+
| `SET_BUYBACK_TWAP` | 24 | `SET_BUYBACK_TWAP` | 26 | ID changed, comment narrowed |
|
|
134
|
+
| `SET_BUYBACK_POOL` | 25 | `SET_BUYBACK_POOL` | 27 | ID changed |
|
|
135
|
+
| `ADD_SWAP_TERMINAL_POOL` | 26 | -- | -- | **Removed** |
|
|
136
|
+
| `ADD_SWAP_TERMINAL_TWAP_PARAMS` | 27 | -- | -- | **Removed** |
|
|
137
|
+
| -- | -- | `SET_BUYBACK_HOOK` | 28 | **New** |
|
|
138
|
+
| -- | -- | `SET_ROUTER_TERMINAL` | 29 | **New** |
|
|
139
|
+
| `MAP_SUCKER_TOKEN` | 28 | `MAP_SUCKER_TOKEN` | 30 | ID changed, `BPSucker` → `JBSucker` |
|
|
140
|
+
| `DEPLOY_SUCKERS` | 29 | `DEPLOY_SUCKERS` | 31 | ID changed, `BPSuckerRegistry` → `JBSuckerRegistry` |
|
|
141
|
+
| `SUCKER_SAFETY` | 30 | `SUCKER_SAFETY` | 32 | ID changed, narrowed (no longer includes deprecation) |
|
|
142
|
+
| -- | -- | `SET_SUCKER_DEPRECATION` | 33 | **New** (split from `SUCKER_SAFETY`) |
|
package/README.md
CHANGED
|
@@ -49,7 +49,7 @@ permissionsOf[operator][account][projectId] => uint256 (packed bits)
|
|
|
49
49
|
| 18 | `SET_SPLIT_GROUPS` | `JBController.setSplitGroupsOf` | Set a project's split groups (how payouts and reserved tokens are distributed). |
|
|
50
50
|
| 19 | `ADD_PRICE_FEED` | `JBController.addPriceFeed` | Add a price feed for a project. The controller checks this permission before calling `JBPrices.addPriceFeedFor`. |
|
|
51
51
|
| 20 | `ADD_ACCOUNTING_CONTEXTS` | `JBMultiTerminal.addAccountingContextsFor` | Add accounting contexts (accepted tokens) to a terminal for a project. |
|
|
52
|
-
| 21 | `SET_TOKEN_METADATA` | `JBController.
|
|
52
|
+
| 21 | `SET_TOKEN_METADATA` | `JBController.setTokenMetadataOf` | Set a project token's name and symbol. Checked against the project owner. |
|
|
53
53
|
|
|
54
54
|
### 721 Hook (IDs 22--25) -- [nana-721-hook-v6](https://github.com/Bananapus/nana-721-hook-v6)
|
|
55
55
|
|
package/RISKS.md
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
|
-
# nana-permission-ids-v6
|
|
1
|
+
# RISKS.md -- nana-permission-ids-v6
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Constants-only library defining permission ID values used throughout the Bananapus ecosystem. Contains no logic, no state, and no external calls.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## 1. Known Risks
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- **ROOT permission (ID 1).** ROOT grants all permissions across every contract. Any address granted ROOT can perform any permissioned operation on any project. Should never be granted to untrusted addresses.
|
|
8
|
+
- **SET_BUYBACK_HOOK includes lock (ID 28).** Gates both `setHookFor` and `lockHookFor`. An operator with this permission can permanently lock the buyback hook configuration.
|
|
9
|
+
- **SET_ROUTER_TERMINAL includes lock (ID 29).** Gates both `setTerminalFor` and `lockTerminalFor`. An operator can permanently lock the router terminal.
|
|
10
|
+
- **ID collision risk.** Permission IDs are manually assigned sequential uint8 values. Adding new IDs requires coordination to avoid collision. Library is append-only.
|
|
11
|
+
- **No runtime enforcement.** This library only defines constants. Enforcement happens in consuming contracts. A mismatch between the ID used here and the ID checked in a consumer would silently fail.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
|------|-------------|------------|
|
|
11
|
-
| ID collision | If two repos use the same ID for different permissions, access control breaks | IDs are centrally managed in this single file |
|
|
12
|
-
| ROOT scope | ROOT (ID 1) grants ALL permissions across all contracts | Cannot be set for wildcard projectId=0; ROOT operators cannot grant ROOT |
|
|
13
|
-
| SET_TERMINALS scope | Includes ability to remove the primary terminal | Documented warning in source |
|
|
14
|
-
| SET_BUYBACK_HOOK / SET_ROUTER_TERMINAL scope | Each gates both setting AND locking (permanent) | Documented in source; granting means operator can lock |
|
|
13
|
+
## 2. Design Notes
|
|
15
14
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
- IDs 34-255 are available for future ecosystem extensions
|
|
21
|
-
- This library has zero dependencies — it is the leaf of the dependency graph
|
|
15
|
+
- Permission 0 is reserved and cannot be set.
|
|
16
|
+
- IDs are `uint8` (0-255), with 1-33 currently assigned.
|
|
17
|
+
- IDs 34-255 are available for future ecosystem extensions.
|
|
18
|
+
- This library has zero dependencies -- it is the leaf of the dependency graph.
|
package/SKILLS.md
CHANGED
|
@@ -58,7 +58,7 @@ When a permissioned function is called, the contract checks whether the caller e
|
|
|
58
58
|
| 18 | `SET_SPLIT_GROUPS` | `JBController.setSplitGroupsOf` | Set how payouts and reserved tokens are distributed. Checked against project owner. |
|
|
59
59
|
| 19 | `ADD_PRICE_FEED` | `JBController.addPriceFeed` | Add a price feed for a project. The controller checks this permission, then calls `JBPrices.addPriceFeedFor` internally. Checked against project owner. |
|
|
60
60
|
| 20 | `ADD_ACCOUNTING_CONTEXTS` | `JBMultiTerminal.addAccountingContextsFor` | Add accepted token accounting contexts to a terminal. Checked against project owner. |
|
|
61
|
-
| 21 | `SET_TOKEN_METADATA` | `JBController.
|
|
61
|
+
| 21 | `SET_TOKEN_METADATA` | `JBController.setTokenMetadataOf` | Set a project token's name and symbol. Checked against project owner. |
|
|
62
62
|
|
|
63
63
|
### nana-721-hook-v6
|
|
64
64
|
|
|
@@ -125,7 +125,7 @@ N/A -- no structs or enums. All values are `uint8 internal constant`.
|
|
|
125
125
|
- **SET_TERMINALS (ID 15) can break a project.** Replacing the terminal list without including the current primary terminal will remove it, breaking payments and cashouts until a new primary is set.
|
|
126
126
|
- **LAUNCH_RULESETS (ID 3) requires both IDs 3 and 15.** The function enforces two separate permission checks because it configures terminals in addition to launching rulesets.
|
|
127
127
|
- **Holder-scoped permissions.** IDs 4 (`CASH_OUT_TOKENS`), 11 (`BURN_TOKENS`), 12 (`CLAIM_TOKENS`), and 13 (`TRANSFER_CREDITS`) are checked against the **token holder**, not the project owner. This means a holder grants an operator permission to act on the holder's own tokens.
|
|
128
|
-
- **SET_BUYBACK_HOOK (ID
|
|
128
|
+
- **SET_BUYBACK_HOOK (ID 28) mismatch.** The source comment says it guards `JBBuybackHookRegistry.setHookFor` and `lockHookFor`, but those functions actually check `SET_BUYBACK_POOL` (ID 27). The ID is still granted by `REVDeployer` as an operator permission.
|
|
129
129
|
- **ADD_PRICE_FEED (ID 19) is checked on JBController, not JBPrices.** The permission gate is on `JBController.addPriceFeed`, which then calls `JBPrices.addPriceFeedFor` internally.
|
|
130
130
|
- **uint8 range.** IDs are `uint8` (0--255) but the packed storage is `uint256`, so the system supports up to 256 permission bits. Currently 33 are defined (1--33).
|
|
131
131
|
|
package/USER_JOURNEYS.md
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# User Journeys -- nana-permission-ids-v6
|
|
2
|
+
|
|
3
|
+
Since this is a constants-only library with no runtime behavior, these journeys describe how the permission IDs are used by actors across the ecosystem. Each journey shows the constant's role in a concrete access control scenario.
|
|
4
|
+
|
|
5
|
+
## Journey 1: Grant an Operator Permission to Queue Rulesets
|
|
6
|
+
|
|
7
|
+
**Actor:** Project owner granting delegated access to a trusted operator.
|
|
8
|
+
**Goal:** Allow an operator to queue new rulesets for a project without transferring project ownership.
|
|
9
|
+
|
|
10
|
+
### Steps
|
|
11
|
+
|
|
12
|
+
1. **Project owner calls `JBPermissions.setPermissionsFor`**
|
|
13
|
+
|
|
14
|
+
```solidity
|
|
15
|
+
uint8[] memory ids = new uint8[](1);
|
|
16
|
+
ids[0] = JBPermissionIds.QUEUE_RULESETS; // ID 2
|
|
17
|
+
permissions.setPermissionsFor(
|
|
18
|
+
projectOwner,
|
|
19
|
+
JBPermissionsData({operator: operatorAddress, projectId: 5, permissionIds: ids})
|
|
20
|
+
);
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
- Sets bit 2 in `permissionsOf[operatorAddress][projectOwner][5]`
|
|
24
|
+
|
|
25
|
+
2. **Operator calls `JBController.queueRulesetsOf(5, ...)`**
|
|
26
|
+
|
|
27
|
+
- Controller calls `_requirePermissionFrom(projectOwner, 5, JBPermissionIds.QUEUE_RULESETS)`
|
|
28
|
+
- `JBPermissions.hasPermission` checks: does `operatorAddress` have bit 2 set for `(projectOwner, projectId=5)`? Yes.
|
|
29
|
+
- Operation proceeds.
|
|
30
|
+
|
|
31
|
+
### What to verify
|
|
32
|
+
|
|
33
|
+
- The operator can ONLY queue rulesets. They cannot send payouts, set terminals, or perform any other operation unless additional IDs are granted.
|
|
34
|
+
- Granting `QUEUE_RULESETS` with `projectId = 0` (wildcard) would allow the operator to queue rulesets for ALL projects the owner controls.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## Journey 2: ROOT Permission Grants Universal Access
|
|
39
|
+
|
|
40
|
+
**Actor:** Project owner granting ROOT to a highly trusted multisig.
|
|
41
|
+
**Goal:** Give a single operator full control over all project operations.
|
|
42
|
+
|
|
43
|
+
### Steps
|
|
44
|
+
|
|
45
|
+
1. **Project owner calls `JBPermissions.setPermissionsFor`**
|
|
46
|
+
|
|
47
|
+
```solidity
|
|
48
|
+
uint8[] memory ids = new uint8[](1);
|
|
49
|
+
ids[0] = JBPermissionIds.ROOT; // ID 1
|
|
50
|
+
permissions.setPermissionsFor(
|
|
51
|
+
projectOwner,
|
|
52
|
+
JBPermissionsData({operator: multisigAddress, projectId: 5, permissionIds: ids})
|
|
53
|
+
);
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
- Sets bit 1 in `permissionsOf[multisigAddress][projectOwner][5]`
|
|
57
|
+
|
|
58
|
+
2. **Multisig calls any permissioned function for project 5**
|
|
59
|
+
|
|
60
|
+
- Every `_requirePermissionFrom` check includes `includeRoot: true`
|
|
61
|
+
- ROOT (bit 1) satisfies any permission check for `(projectOwner, projectId=5)`
|
|
62
|
+
- The multisig can queue rulesets, send payouts, set terminals, mint tokens, etc.
|
|
63
|
+
|
|
64
|
+
### What to verify
|
|
65
|
+
|
|
66
|
+
- ROOT cannot be granted with `projectId = 0`. `JBPermissions` reverts with `JBPermissions_CantSetRootPermissionForWildcardProject()`.
|
|
67
|
+
- A ROOT operator can call `setPermissionsFor` on behalf of the account, but cannot grant ROOT to other operators or set wildcard permissions. This prevents permission escalation.
|
|
68
|
+
- ROOT is per-project. Having ROOT for project 5 does not grant access to project 6.
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## Journey 3: Token Holder Delegates Cashout Authority
|
|
73
|
+
|
|
74
|
+
**Actor:** Token holder (not project owner) granting a bot permission to cash out tokens on their behalf.
|
|
75
|
+
**Goal:** Allow automated cashout execution without exposing the holder's private key.
|
|
76
|
+
|
|
77
|
+
### Steps
|
|
78
|
+
|
|
79
|
+
1. **Token holder calls `JBPermissions.setPermissionsFor`**
|
|
80
|
+
|
|
81
|
+
```solidity
|
|
82
|
+
uint8[] memory ids = new uint8[](1);
|
|
83
|
+
ids[0] = JBPermissionIds.CASH_OUT_TOKENS; // ID 4
|
|
84
|
+
permissions.setPermissionsFor(
|
|
85
|
+
tokenHolder,
|
|
86
|
+
JBPermissionsData({operator: botAddress, projectId: 5, permissionIds: ids})
|
|
87
|
+
);
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
- Note: the `account` is the **token holder**, not the project owner
|
|
91
|
+
|
|
92
|
+
2. **Bot calls `JBMultiTerminal.cashOutTokensOf(tokenHolder, 5, ...)`**
|
|
93
|
+
|
|
94
|
+
- Terminal calls `_requirePermissionFrom(tokenHolder, 5, JBPermissionIds.CASH_OUT_TOKENS)`
|
|
95
|
+
- Permission check passes for `botAddress` because it has `CASH_OUT_TOKENS` for `(tokenHolder, 5)`
|
|
96
|
+
|
|
97
|
+
### What to verify
|
|
98
|
+
|
|
99
|
+
- `CASH_OUT_TOKENS` (ID 4) is checked against the token holder, not the project owner. This is by design -- only the holder (or their delegates) can cash out the holder's tokens.
|
|
100
|
+
- The project owner CANNOT cash out another holder's tokens (unless the holder explicitly grants them `CASH_OUT_TOKENS`).
|
|
101
|
+
- The same holder-scoped pattern applies to `BURN_TOKENS` (11), `CLAIM_TOKENS` (12), and `TRANSFER_CREDITS` (13).
|
|
102
|
+
|
|
103
|
+
---
|
|
104
|
+
|
|
105
|
+
## Journey 4: SET_TERMINALS Can Break a Project
|
|
106
|
+
|
|
107
|
+
**Actor:** Project owner (or delegate with SET_TERMINALS permission).
|
|
108
|
+
**Goal:** Update the list of terminals for a project -- illustrating the risk documented in the source.
|
|
109
|
+
|
|
110
|
+
### Steps
|
|
111
|
+
|
|
112
|
+
1. **Operator calls `JBDirectory.setTerminalsOf(5, newTerminals)`**
|
|
113
|
+
|
|
114
|
+
- Permission check: `_requirePermissionFrom(projectOwner, 5, JBPermissionIds.SET_TERMINALS)` (ID 15)
|
|
115
|
+
- The `newTerminals` array replaces the ENTIRE terminal list
|
|
116
|
+
|
|
117
|
+
2. **If the new list omits the current primary terminal:**
|
|
118
|
+
|
|
119
|
+
- The primary terminal is removed from the project
|
|
120
|
+
- All payments to the project via `pay()` will fail (no terminal to receive them)
|
|
121
|
+
- All cashouts via `cashOutTokensOf()` will fail
|
|
122
|
+
- All payouts via `sendPayoutsOf()` will fail
|
|
123
|
+
- The project is effectively frozen until a new primary terminal is set
|
|
124
|
+
|
|
125
|
+
### What to verify
|
|
126
|
+
|
|
127
|
+
- Granting `SET_TERMINALS` to an untrusted operator is dangerous. The operator can remove all terminals, bricking the project.
|
|
128
|
+
- `LAUNCH_RULESETS` (ID 3) also requires `SET_TERMINALS` (ID 15) because the launch function configures terminals. Granting only ID 3 without ID 15 will cause the launch to revert.
|
|
129
|
+
- There is no undo mechanism. Once terminals are set, another `setTerminalsOf` call is needed to restore them.
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Journey 5: Locking a Buyback Hook or Router Terminal (Permanent Action)
|
|
134
|
+
|
|
135
|
+
**Actor:** Project owner or delegate with SET_BUYBACK_HOOK or SET_ROUTER_TERMINAL permission.
|
|
136
|
+
**Goal:** Illustrate the irreversible locking behavior gated by dual-purpose permission IDs.
|
|
137
|
+
|
|
138
|
+
### Steps (SET_BUYBACK_HOOK example)
|
|
139
|
+
|
|
140
|
+
1. **Operator with SET_BUYBACK_HOOK (ID 28) calls `JBBuybackHookRegistry.setHookFor(5, hookAddress)`**
|
|
141
|
+
|
|
142
|
+
- Configures the buyback hook for project 5
|
|
143
|
+
- This is a reversible operation (can be called again with a different hook)
|
|
144
|
+
|
|
145
|
+
2. **Same operator calls `JBBuybackHookRegistry.lockHookFor(5)`**
|
|
146
|
+
|
|
147
|
+
- Permanently locks the hook configuration for project 5
|
|
148
|
+
- No one can change the hook after locking -- not even the project owner
|
|
149
|
+
|
|
150
|
+
### What to verify
|
|
151
|
+
|
|
152
|
+
- A single permission ID (28 or 29) gates BOTH the "set" and "lock" operations. Granting the permission implicitly trusts the operator to potentially lock the configuration.
|
|
153
|
+
- The locking is permanent (no unlock mechanism in the registry).
|
|
154
|
+
- Project owners should only grant SET_BUYBACK_HOOK (28) or SET_ROUTER_TERMINAL (29) to operators they trust not to lock prematurely.
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Journey 6: Cross-Repo Permission Usage (nana-suckers)
|
|
159
|
+
|
|
160
|
+
**Actor:** Project owner managing cross-chain infrastructure.
|
|
161
|
+
**Goal:** Deploy suckers and manage their lifecycle using permission IDs 30-33.
|
|
162
|
+
|
|
163
|
+
### Steps
|
|
164
|
+
|
|
165
|
+
1. **Deploy suckers: `JBSuckerRegistry.deploySuckersFor(5, configs)`**
|
|
166
|
+
- Permission: `DEPLOY_SUCKERS` (ID 31)
|
|
167
|
+
- Creates sucker contracts for cross-chain bridging
|
|
168
|
+
|
|
169
|
+
2. **Map tokens: `JBSucker.mapToken(localToken, remoteToken)`**
|
|
170
|
+
- Permission: `MAP_SUCKER_TOKEN` (ID 30)
|
|
171
|
+
- Maps a local ERC-20 to its remote chain counterpart
|
|
172
|
+
- CAUTION: once the outbox merkle tree has entries, the mapping is immutable (can only be disabled, not remapped)
|
|
173
|
+
|
|
174
|
+
3. **Enable emergency hatch: `JBSucker.enableEmergencyHatchFor(token)`**
|
|
175
|
+
- Permission: `SUCKER_SAFETY` (ID 32)
|
|
176
|
+
- Allows recovery of stuck tokens via the emergency hatch
|
|
177
|
+
|
|
178
|
+
4. **Deprecate sucker: `JBSucker.setDeprecation(newState)`**
|
|
179
|
+
- Permission: `SET_SUCKER_DEPRECATION` (ID 33)
|
|
180
|
+
- Moves the sucker through its lifecycle: ENABLED -> DEPRECATION_PENDING -> SENDING_DISABLED -> DEPRECATED
|
|
181
|
+
|
|
182
|
+
### What to verify
|
|
183
|
+
|
|
184
|
+
- Each sucker permission is independent. Having `DEPLOY_SUCKERS` does not grant `MAP_SUCKER_TOKEN` or `SUCKER_SAFETY`.
|
|
185
|
+
- `MAP_SUCKER_TOKEN` is especially sensitive because token mappings become immutable once the outbox tree has entries.
|
|
186
|
+
- `SUCKER_SAFETY` should be granted sparingly -- the emergency hatch is a last-resort recovery mechanism.
|
|
187
|
+
- All four sucker permissions are checked against the project owner, not a token holder.
|
package/package.json
CHANGED
package/src/JBPermissionIds.sol
CHANGED
|
@@ -28,11 +28,11 @@ library JBPermissionIds {
|
|
|
28
28
|
uint8 internal constant SET_PRIMARY_TERMINAL = 16; // Permission to call `JBDirectory.setPrimaryTerminalOf`.
|
|
29
29
|
uint8 internal constant USE_ALLOWANCE = 17; // Permission to call `JBMultiTerminal.useAllowanceOf`.
|
|
30
30
|
uint8 internal constant SET_SPLIT_GROUPS = 18; // Permission to call `JBController.setSplitGroupsOf`.
|
|
31
|
-
uint8 internal constant ADD_PRICE_FEED = 19; // Permission to call `
|
|
31
|
+
uint8 internal constant ADD_PRICE_FEED = 19; // Permission to call `JBController.addPriceFeed`.
|
|
32
32
|
uint8 internal constant ADD_ACCOUNTING_CONTEXTS = 20; // Permission to call
|
|
33
33
|
// `JBMultiTerminal.addAccountingContextsFor`.
|
|
34
34
|
uint8 internal constant SET_TOKEN_METADATA = 21; // Permission to call
|
|
35
|
-
// `JBController.
|
|
35
|
+
// `JBController.setTokenMetadataOf`.
|
|
36
36
|
|
|
37
37
|
/* Used by `nana-721-hook`: https://github.com/Bananapus/nana-721-hook */
|
|
38
38
|
uint8 internal constant ADJUST_721_TIERS = 22; // Permission to call `JB721TiersHook.adjustTiers`.
|