@bananapus/address-registry-v6 0.0.18 → 0.0.19
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 +19 -19
- package/ARCHITECTURE.md +17 -17
- package/AUDIT_INSTRUCTIONS.md +11 -10
- package/README.md +10 -10
- package/RISKS.md +25 -25
- package/SKILLS.md +2 -2
- package/USER_JOURNEYS.md +3 -5
- package/package.json +1 -1
package/ADMINISTRATION.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
| Item | Details |
|
|
6
6
|
| --- | --- |
|
|
7
|
-
| Scope | Permissionless provenance registration for CREATE and CREATE2 addresses |
|
|
7
|
+
| Scope | Permissionless provenance registration for `CREATE` and `CREATE2` addresses |
|
|
8
8
|
| Control posture | Fully permissionless and adminless |
|
|
9
9
|
| Highest-risk actions | Incorrect first registration or bad derivation assumptions in offchain tooling |
|
|
10
10
|
| Recovery posture | No in-place recovery; replacement contract is the only fix for logic mistakes |
|
|
@@ -15,47 +15,47 @@
|
|
|
15
15
|
|
|
16
16
|
## Control Model
|
|
17
17
|
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
18
|
+
- no owner
|
|
19
|
+
- no governance
|
|
20
|
+
- no pause
|
|
21
|
+
- no upgrade
|
|
22
|
+
- registration is permissionless and correctness comes from deterministic address derivation
|
|
23
23
|
|
|
24
24
|
## Roles
|
|
25
25
|
|
|
26
26
|
| Role | How Assigned | Scope | Notes |
|
|
27
27
|
| --- | --- | --- | --- |
|
|
28
|
-
| Anyone | No assignment | Global | Can register an address if they provide correct CREATE or CREATE2 inputs |
|
|
28
|
+
| Anyone | No assignment | Global | Can register an address if they provide correct `CREATE` or `CREATE2` inputs |
|
|
29
29
|
|
|
30
30
|
## Privileged Surfaces
|
|
31
31
|
|
|
32
|
-
There are no privileged functions. `registerAddress(...)` is permissionless for both
|
|
32
|
+
There are no privileged functions. `registerAddress(...)` is permissionless for both registration paths.
|
|
33
33
|
|
|
34
34
|
## Immutable And One-Way
|
|
35
35
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
36
|
+
- registration is first-write only
|
|
37
|
+
- there is no overwrite or delete path for `deployerOf[address]`
|
|
38
38
|
|
|
39
39
|
## Operational Notes
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
-
|
|
41
|
+
- treat registration as provenance, not endorsement
|
|
42
|
+
- register addresses from trustworthy operational pipelines because bad first registration is sticky even though anyone can submit the correct derivation inputs
|
|
43
43
|
|
|
44
44
|
## Machine Notes
|
|
45
45
|
|
|
46
|
-
-
|
|
47
|
-
- `src/JBAddressRegistry.sol` is the only control-relevant runtime file; there is no hidden owner path
|
|
48
|
-
-
|
|
46
|
+
- do not treat registration as a safety certification or allowlist signal
|
|
47
|
+
- `src/JBAddressRegistry.sol` is the only control-relevant runtime file; there is no hidden owner path
|
|
48
|
+
- if offchain derivation and onchain registration disagree, resolve the derivation logic rather than assuming overwrite is possible
|
|
49
49
|
|
|
50
50
|
## Recovery
|
|
51
51
|
|
|
52
|
-
-
|
|
53
|
-
-
|
|
52
|
+
- there is no admin recovery surface
|
|
53
|
+
- if derivation logic were ever wrong, the contract would need replacement rather than intervention
|
|
54
54
|
|
|
55
55
|
## Admin Boundaries
|
|
56
56
|
|
|
57
|
-
-
|
|
58
|
-
-
|
|
57
|
+
- nobody can curate allowlists, edit entries, or block registration
|
|
58
|
+
- nobody can use this registry to certify code safety
|
|
59
59
|
|
|
60
60
|
## Source Map
|
|
61
61
|
|
package/ARCHITECTURE.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Purpose
|
|
4
4
|
|
|
5
|
-
`nana-address-registry-v6` is a
|
|
5
|
+
`nana-address-registry-v6` is a small provenance primitive. It records which deployer could have created a contract address by recomputing `CREATE` or `CREATE2` inputs and storing the verified result on-chain.
|
|
6
6
|
|
|
7
7
|
## System Overview
|
|
8
8
|
|
|
@@ -10,10 +10,10 @@ The repo is intentionally small. `JBAddressRegistry` accepts deterministic deplo
|
|
|
10
10
|
|
|
11
11
|
## Core Invariants
|
|
12
12
|
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- CREATE and CREATE2 derivation must match EVM rules exactly
|
|
13
|
+
- registration is permissionless because correctness comes from deterministic derivation, not caller authority
|
|
14
|
+
- a contract address can only be registered once
|
|
15
|
+
- registration must fail until runtime code actually exists at the derived address
|
|
16
|
+
- `CREATE` and `CREATE2` derivation must match EVM rules exactly
|
|
17
17
|
|
|
18
18
|
## Modules
|
|
19
19
|
|
|
@@ -24,9 +24,9 @@ The repo is intentionally small. `JBAddressRegistry` accepts deterministic deplo
|
|
|
24
24
|
|
|
25
25
|
## Trust Boundaries
|
|
26
26
|
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
27
|
+
- the registry attests to deterministic provenance, not code quality
|
|
28
|
+
- it does not manage ownership, upgrades, or allowlists
|
|
29
|
+
- external systems may trust its recorded provenance, so derivation correctness is the whole product
|
|
30
30
|
|
|
31
31
|
## Critical Flows
|
|
32
32
|
|
|
@@ -41,24 +41,24 @@ caller
|
|
|
41
41
|
|
|
42
42
|
## Accounting Model
|
|
43
43
|
|
|
44
|
-
No economic accounting lives here. The only
|
|
44
|
+
No economic accounting lives here. The only important state is `deployerOf[address]`.
|
|
45
45
|
|
|
46
46
|
## Security Model
|
|
47
47
|
|
|
48
|
-
-
|
|
49
|
-
-
|
|
50
|
-
-
|
|
48
|
+
- the risk is concentrated in a small amount of address-derivation logic
|
|
49
|
+
- the registry records the derived deployer, not the transaction caller
|
|
50
|
+
- overengineering is more dangerous than minimal, auditable derivation code
|
|
51
51
|
|
|
52
52
|
## Safe Change Guide
|
|
53
53
|
|
|
54
|
-
-
|
|
55
|
-
-
|
|
56
|
-
-
|
|
57
|
-
-
|
|
54
|
+
- treat derivation code like cryptographic plumbing
|
|
55
|
+
- keep the undeployed-address check and first-write-only rule intact
|
|
56
|
+
- if nonce handling or bytecode hashing changes, keep `CREATE` and `CREATE2` tests aligned
|
|
57
|
+
- do not expand the repo into an allowlist or trust-oracle system
|
|
58
58
|
|
|
59
59
|
## Canonical Checks
|
|
60
60
|
|
|
61
|
-
- CREATE and CREATE2 derivation correctness:
|
|
61
|
+
- `CREATE` and `CREATE2` derivation correctness:
|
|
62
62
|
`test/JBAddressRegistry.t.sol`
|
|
63
63
|
- edge-path validation and first-write behavior:
|
|
64
64
|
`test/JBAddressRegistryEdge.t.sol`
|
package/AUDIT_INSTRUCTIONS.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# Audit Instructions
|
|
2
2
|
|
|
3
|
-
This repo is a small registry, but it
|
|
3
|
+
This repo is a small registry, but it sits on a deployer-verification boundary across the ecosystem. Treat incorrect registration as a security failure.
|
|
4
4
|
|
|
5
5
|
## Audit Objective
|
|
6
6
|
|
|
7
7
|
Find issues that:
|
|
8
|
+
|
|
8
9
|
- let callers register contracts under the wrong deployer
|
|
9
10
|
- break determinism or uniqueness assumptions around registration
|
|
10
11
|
- let a malicious deployer spoof provenance for contracts it did not create
|
|
11
|
-
- create
|
|
12
|
+
- create truncation-related collisions or stale mapping assumptions
|
|
12
13
|
|
|
13
14
|
## Scope
|
|
14
15
|
|
|
15
16
|
In scope:
|
|
17
|
+
|
|
16
18
|
- `src/JBAddressRegistry.sol`
|
|
17
19
|
- `src/interfaces/IJBAddressRegistry.sol`
|
|
18
20
|
- all deployment helpers in `script/`
|
|
@@ -25,6 +27,7 @@ In scope:
|
|
|
25
27
|
## Security Model
|
|
26
28
|
|
|
27
29
|
The registry maps deployed addresses to the deployer that created them. Downstream repos use it to:
|
|
30
|
+
|
|
28
31
|
- validate provenance for clones or deterministically deployed instances
|
|
29
32
|
- discover whether a contract came from an approved deployer path
|
|
30
33
|
|
|
@@ -43,14 +46,12 @@ The registry maps deployed addresses to the deployer that created them. Downstre
|
|
|
43
46
|
|
|
44
47
|
## Critical Invariants
|
|
45
48
|
|
|
46
|
-
1. Provenance cannot be forged
|
|
47
|
-
Only the actual deployer path the registry intends to trust may create a successful registration for a contract.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
3. Registration metadata is stable
|
|
53
|
-
Nonce, salt, or address truncation must not allow collisions or stale reads.
|
|
49
|
+
1. Provenance cannot be forged.
|
|
50
|
+
Only the actual deployer path the registry intends to trust may create a successful registration for a contract.
|
|
51
|
+
2. One contract maps to one authoritative deployer record.
|
|
52
|
+
No aliasing or overwrite path should let a later caller replace provenance unexpectedly.
|
|
53
|
+
3. Registration metadata is stable.
|
|
54
|
+
Nonce, salt, or address truncation must not allow collisions or stale reads.
|
|
54
55
|
|
|
55
56
|
## Attack Surfaces
|
|
56
57
|
|
package/README.md
CHANGED
|
@@ -11,12 +11,12 @@ Audit instructions: [AUDIT_INSTRUCTIONS.md](./AUDIT_INSTRUCTIONS.md)
|
|
|
11
11
|
|
|
12
12
|
## Overview
|
|
13
13
|
|
|
14
|
-
The registry supports both `create` and `create2`
|
|
14
|
+
The registry supports both `create` and `create2` deployments:
|
|
15
15
|
|
|
16
16
|
- for `create`, it reconstructs the deployed address from the deployer and nonce
|
|
17
17
|
- for `create2`, it reconstructs the deployed address from the deployer, salt, and deployment bytecode
|
|
18
18
|
|
|
19
|
-
Because the address is computed deterministically, registrations do not
|
|
19
|
+
Because the address is computed deterministically, registrations do not need access control. Anyone can submit the correct deployment inputs, and the registry records the deployer for the computed address after confirming code already exists there.
|
|
20
20
|
|
|
21
21
|
Use this repo when deployer provenance matters. Do not confuse it with an allowlist, audit registry, or trust oracle.
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ The registry is intentionally narrow:
|
|
|
36
36
|
2. bind that address to a deployer once
|
|
37
37
|
3. expose the result for other systems and clients
|
|
38
38
|
|
|
39
|
-
Anything beyond that is out of scope
|
|
39
|
+
Anything beyond that is out of scope.
|
|
40
40
|
|
|
41
41
|
## Read These Files First
|
|
42
42
|
|
|
@@ -47,14 +47,14 @@ Anything beyond that is out of scope by design.
|
|
|
47
47
|
|
|
48
48
|
## Integration Traps
|
|
49
49
|
|
|
50
|
-
- provenance is only
|
|
51
|
-
- permissionless registration is intentional, so integrations should verify the computed inputs rather than
|
|
50
|
+
- provenance is only useful if callers also know what the deployer is trusted for
|
|
51
|
+
- permissionless registration is intentional, so integrations should verify the computed inputs rather than assume caller authority
|
|
52
52
|
- `create` nonce reconstruction and `create2` salt-bytecode reconstruction are different trust paths and should be reasoned about separately
|
|
53
53
|
|
|
54
54
|
## Where State Lives
|
|
55
55
|
|
|
56
|
-
- deployer provenance
|
|
57
|
-
- deployment truth
|
|
56
|
+
- deployer provenance: `JBAddressRegistry`
|
|
57
|
+
- deployment truth: the target chain history and bytecode inputs outside this repo
|
|
58
58
|
|
|
59
59
|
## High-Signal Tests
|
|
60
60
|
|
|
@@ -101,9 +101,9 @@ script/
|
|
|
101
101
|
|
|
102
102
|
## Risks And Notes
|
|
103
103
|
|
|
104
|
-
- provenance is not the same
|
|
105
|
-
- registrations are first-write only, so bad
|
|
106
|
-
- the `create`
|
|
104
|
+
- provenance is not the same as safety; a known deployer can still deploy unsafe code
|
|
105
|
+
- registrations are first-write only, so bad initial registration is sticky
|
|
106
|
+
- the `create` path relies on nonce reconstruction and intentionally rejects unrealistic nonce ranges
|
|
107
107
|
|
|
108
108
|
## For AI Agents
|
|
109
109
|
|
package/RISKS.md
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
# Juicebox Address Registry Risk Register
|
|
2
2
|
|
|
3
|
-
This file
|
|
3
|
+
This file covers what `JBAddressRegistry` actually proves: deterministic address provenance claims. The main risk is not funds loss inside the registry. It is consumers reading too much into a registration entry.
|
|
4
4
|
|
|
5
|
-
## How
|
|
5
|
+
## How To Use This File
|
|
6
6
|
|
|
7
|
-
- Read `Priority risks` first
|
|
8
|
-
- Distinguish "address can be derived from these
|
|
9
|
-
- Treat `Invariants to
|
|
7
|
+
- Read `Priority risks` first. Most failures here are interpretation and integration failures.
|
|
8
|
+
- Distinguish "address can be derived from these inputs" from "this deployment is trusted."
|
|
9
|
+
- Treat `Invariants to verify` as the narrow correctness envelope of the registry itself.
|
|
10
10
|
|
|
11
|
-
## Priority
|
|
11
|
+
## Priority Risks
|
|
12
12
|
|
|
13
13
|
| Priority | Risk | Why it matters | Primary controls |
|
|
14
14
|
|----------|------|----------------|------------------|
|
|
15
|
-
| P1 | Over-trusting registration as safety approval | A registered deployer mapping does not mean the contract is audited, canonical, or safe. | UIs
|
|
15
|
+
| P1 | Over-trusting registration as safety approval | A registered deployer mapping does not mean the contract is audited, canonical, or safe. | UIs should label registration as provenance evidence only. |
|
|
16
16
|
| P1 | First-writer capture of a valid provenance claim | The registry records the first valid claim for an address and never updates it. | Operational discipline for trusted deployers and curated allowlists for consumers. |
|
|
17
|
-
| P2 | Completeness assumptions | Unregistered contracts can still be legitimate; absence from the registry is not
|
|
17
|
+
| P2 | Completeness assumptions | Unregistered contracts can still be legitimate; absence from the registry is not proof of malice. | Treat registry data as additive metadata, not an allowlist. |
|
|
18
18
|
|
|
19
19
|
## 1. Trust Assumptions
|
|
20
20
|
|
|
21
|
-
- **Deterministic address formulas.** The contract trusts its CREATE and CREATE2
|
|
22
|
-
- **
|
|
21
|
+
- **Deterministic address formulas are correct.** The contract trusts its `CREATE` and `CREATE2` derivation logic to match EVM semantics.
|
|
22
|
+
- **Consumers define trust externally.** The registry does not decide which deployers are trusted.
|
|
23
23
|
|
|
24
24
|
## 2. Known Risks
|
|
25
25
|
|
|
26
|
-
- **Caller identity is irrelevant.** Anyone may call `registerAddress(...)`. The registry proves that an address
|
|
27
|
-
- **First registration wins.** Once `deployerOf[addr]` is set, later registrations revert
|
|
28
|
-
- **No pre-registration of future deployments.** `registerAddress(...)` requires
|
|
29
|
-
- **No removal or correction path.** The registry is intentionally append-only per address.
|
|
30
|
-
- **Registration is provenance, not endorsement.**
|
|
26
|
+
- **Caller identity is irrelevant.** Anyone may call `registerAddress(...)`. The registry proves that an address matches supplied deployment parameters, not that the caller was the deployer.
|
|
27
|
+
- **First registration wins.** Once `deployerOf[addr]` is set, later registrations revert.
|
|
28
|
+
- **No pre-registration of future deployments.** `registerAddress(...)` requires code to already exist at the computed address.
|
|
29
|
+
- **No removal or correction path.** The registry is intentionally append-only per address.
|
|
30
|
+
- **Registration is provenance, not endorsement.** `deployerOf[hook] = someFactory` says nothing about code safety, upgradeability, audit status, or whether the deployer itself is trustworthy.
|
|
31
31
|
- **Operational lag matters.** If a trusted deployer forgets to register immediately, someone else can publish the first valid claim for that address.
|
|
32
32
|
|
|
33
33
|
## 3. Integration Risks
|
|
34
34
|
|
|
35
|
-
- **Frontends
|
|
36
|
-
-
|
|
37
|
-
- **Off-chain explorers should preserve uncertainty.**
|
|
35
|
+
- **Frontends should pair registry data with a trusted-deployer set.** Displaying `deployerOf` alone can mislead users into treating any registered provenance as official.
|
|
36
|
+
- **`CREATE` and `CREATE2` claims are parameter-based.** In either mode, the right mental model is "the address is compatible with these inputs," not "the registry witnessed deployment."
|
|
37
|
+
- **Off-chain explorers should preserve uncertainty.** "Registered deployer claim" is a safer label than "deployed by" unless the explorer also verified chain history.
|
|
38
38
|
|
|
39
|
-
## 4. Invariants
|
|
39
|
+
## 4. Invariants To Verify
|
|
40
40
|
|
|
41
|
-
- `deployerOf[addr]` is set at most once
|
|
42
|
-
- CREATE registrations only succeed for addresses derivable from the provided `(deployer, nonce)
|
|
43
|
-
- CREATE2 registrations only succeed for addresses derivable from the provided `(deployer, salt, bytecode)
|
|
44
|
-
- `_addressFrom` remains correct for the supported nonce range and reverts outside that range
|
|
41
|
+
- `deployerOf[addr]` is set at most once
|
|
42
|
+
- `CREATE` registrations only succeed for addresses derivable from the provided `(deployer, nonce)`
|
|
43
|
+
- `CREATE2` registrations only succeed for addresses derivable from the provided `(deployer, salt, bytecode)`
|
|
44
|
+
- `_addressFrom` remains correct for the supported nonce range and reverts outside that range
|
|
45
45
|
|
|
46
46
|
## 5. Accepted Behaviors
|
|
47
47
|
|
|
@@ -51,8 +51,8 @@ This is intentional. `JBAddressRegistry` is a deterministic provenance registry,
|
|
|
51
51
|
|
|
52
52
|
### 5.2 Unregistered does not mean unsafe
|
|
53
53
|
|
|
54
|
-
The registry is useful metadata, but it
|
|
54
|
+
The registry is useful metadata, but it does not cover every legitimate deployment. Consumers should not infer that an unregistered address is malicious just because no entry exists.
|
|
55
55
|
|
|
56
56
|
### 5.3 The registry is retrospective, not a reservation layer
|
|
57
57
|
|
|
58
|
-
This is intentional. A deterministic address can only be registered after code already exists there. Consumers should not expect `JBAddressRegistry` to signal future deployment intent or
|
|
58
|
+
This is intentional. A deterministic address can only be registered after code already exists there. Consumers should not expect `JBAddressRegistry` to signal future deployment intent or protect an undeployed `CREATE2` address from later first-writer capture.
|
package/SKILLS.md
CHANGED
|
@@ -31,11 +31,11 @@ Permissionless on-chain provenance registry that records which deployer created
|
|
|
31
31
|
## Reference Files
|
|
32
32
|
|
|
33
33
|
- Open [`references/runtime.md`](./references/runtime.md) when you need the core guarantees, first-write semantics, or the difference between provenance and trust.
|
|
34
|
-
- Open [`references/operations.md`](./references/operations.md) when you need deployment breadcrumbs, test pointers, or
|
|
34
|
+
- Open [`references/operations.md`](./references/operations.md) when you need deployment breadcrumbs, test pointers, or common stale assumptions about what the registry can verify.
|
|
35
35
|
|
|
36
36
|
## Working Rules
|
|
37
37
|
|
|
38
38
|
- Start in [`src/JBAddressRegistry.sol`](./src/JBAddressRegistry.sol). This repo is intentionally small, so most questions should collapse quickly to the core contract.
|
|
39
39
|
- Treat provenance and safety as separate questions. The registry only proves who deployed something.
|
|
40
|
-
- Registration is first-write only and requires code to already exist at the computed address.
|
|
40
|
+
- Registration is first-write only and requires code to already exist at the computed address.
|
|
41
41
|
- When a task involves wrong or missing registry data, verify the registration inputs before assuming a contract bug.
|
package/USER_JOURNEYS.md
CHANGED
|
@@ -2,15 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
## Repo Purpose
|
|
4
4
|
|
|
5
|
-
This repo records deployer provenance for contracts whose address can be reconstructed from `create` or `create2` inputs.
|
|
6
|
-
It does not say whether a deployment is safe, canonical, or approved. It only says who deployed it when the inputs are
|
|
7
|
-
correct and someone registered them.
|
|
5
|
+
This repo records deployer provenance for contracts whose address can be reconstructed from `create` or `create2` inputs. It does not say whether a deployment is safe, canonical, or approved. It only says who deployed it when the inputs are correct and someone registered them.
|
|
8
6
|
|
|
9
7
|
## Primary Actors
|
|
10
8
|
|
|
11
9
|
- deployers who want onchain provenance for hooks, clones, and helper contracts
|
|
12
10
|
- integrators who need to verify who deployed an address before trusting it
|
|
13
|
-
- auditors who want a deterministic provenance check
|
|
11
|
+
- auditors who want a deterministic provenance check instead of offchain screenshots
|
|
14
12
|
|
|
15
13
|
## Key Surfaces
|
|
16
14
|
|
|
@@ -43,7 +41,7 @@ correct and someone registered them.
|
|
|
43
41
|
|
|
44
42
|
**Actor:** deployer, operator, or auditor with the original deterministic deployment inputs.
|
|
45
43
|
|
|
46
|
-
**Intent:** bind a `create2` deployment to its deployer without
|
|
44
|
+
**Intent:** bind a `create2` deployment to its deployer without privileged access.
|
|
47
45
|
|
|
48
46
|
**Preconditions**
|
|
49
47
|
- the contract was deployed with `create2`
|