@rev-net/core-v6 0.0.33 → 0.0.35

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 CHANGED
@@ -4,83 +4,70 @@
4
4
 
5
5
  | Item | Details |
6
6
  | --- | --- |
7
- | Scope | Revnet deployment shape, split-operator runtime authority, and cosmetic `REVLoans` ownership |
8
- | Control posture | Mostly immutable economics with a narrow runtime operator |
9
- | Highest-risk actions | Deploying the wrong stage design, assigning the wrong split operator, and overestimating `REVLoans` owner power |
10
- | Recovery posture | Core economic mistakes require new revnets; some optional integrations can be corrected by the split operator |
7
+ | Scope | Revnet deployment shape, bounded runtime operators, loan-owner cosmetics, and optional integration control surfaces |
8
+ | Control posture | Intentionally narrow and mostly deployment-defined |
9
+ | Highest-risk actions | Bad stage design, wrong split-operator assignment, and misunderstanding which runtime surfaces stay live after launch |
10
+ | Recovery posture | Usually replacement, not patching; the design intentionally avoids easy admin escape hatches |
11
11
 
12
12
  ## Purpose
13
13
 
14
- `revnet-core-v6` is designed to minimize ongoing human control. The core split is between deployment-time shape, the limited split-operator role, the globally owned-but-cosmetic `REVLoans` metadata surface, and the intentionally ownerless project pattern enforced through `REVDeployer` and `REVOwner`.
14
+ `revnet-core-v6` is designed to collapse ordinary post-launch governance into deployment-time decisions plus a small set of bounded runtime roles. The main administration task is understanding which power still exists and which power was intentionally removed.
15
15
 
16
16
  ## Control Model
17
17
 
18
- - Deployment-time configuration is the real place where revnet economics are chosen.
19
- - The split operator is the only intended human-controlled runtime role for a revnet.
20
- - `REVLoans` owner only controls loan NFT metadata rendering.
21
- - `REVDeployer` holds the project NFT structurally, not as a discretionary human admin.
22
- - Many economically sensitive behaviors are intentionally not mutable after deployment.
18
+ - `REVDeployer` holds the project NFT and therefore remains part of the ownership model.
19
+ - Revnet economics are mainly fixed at deployment through staged rulesets.
20
+ - `REVOwner` provides live runtime policy, but not broad human governance.
21
+ - Split operators can hold narrow powers depending on stage and deployment config.
22
+ - `REVLoans` has a cosmetic global owner surface, but loan economics are still bounded by revnet logic.
23
23
 
24
24
  ## Roles
25
25
 
26
26
  | Role | How Assigned | Scope | Notes |
27
27
  | --- | --- | --- | --- |
28
- | Split operator | `REVConfig.splitOperator` at deployment | Per revnet | Narrow runtime operator surface |
29
- | `REVLoans` owner | `Ownable(owner)` on `REVLoans` | Global | Cosmetic metadata role, not economic admin |
30
- | Loan NFT owner | ERC-721 loan ownership | Per loan | Can repay or reallocate subject to checks |
31
- | Hidden-token caller or delegate | Holder or delegated permission | Per holder | Manages hide and reveal flows |
32
- | Anyone | No assignment | Global or per revnet | Some lifecycle functions are permissionless |
28
+ | `REVDeployer` | Deployed singleton | Global launcher and project-NFT holder | Part of the ownership model |
29
+ | Split operator | Deployment config | Per revnet | Holds only the allowed operator envelope |
30
+ | Auto-issuance beneficiary | Deployment config | Per stage | Can receive preconfigured stage issuance |
31
+ | Borrower or delegated loan operator | Token holder plus permission | Per holder or loan | Can open or manage loans within loan rules |
32
+ | `REVLoans` owner | Constructor owner | Global cosmetic/admin surface | Does not turn Revnets back into ordinary governed projects |
33
33
 
34
34
  ## Privileged Surfaces
35
35
 
36
- | Contract | Function | Who Can Call | Effect |
37
- | --- | --- | --- | --- |
38
- | `REVDeployer` | `deployFor(...)` | Anyone for new deployments, or current owner for conversion path | Creates or converts a project into a revnet |
39
- | `REVDeployer` | `deploySuckersFor(...)` | Split operator | Adds sucker infra where the revnet config allows it |
40
- | `REVDeployer` | `setSplitOperatorOf(...)` | Current split operator | Replaces or burns the split-operator role |
41
- | `REVLoans` | `setTokenUriResolver(...)` | `REVLoans` owner | Cosmetic loan-NFT metadata control |
42
- | `REVLoans` | `borrowFrom(...)`, `repayLoan(...)`, `reallocateCollateralFromLoan(...)` | Holder or delegated loan operator | Position-level administration, not protocol-level governance |
36
+ - `deployFor(...)` defines the revnet's long-lived shape
37
+ - split-operator paths can manage only the permissions left open by deployment
38
+ - `autoIssueFor(...)` consumes preconfigured stage issuance
39
+ - loan operators can redirect borrowed value if a holder delegates loan permissions
40
+ - hidden-token flows require the holder's permission grant and mint permission wiring through `REVOwner`
43
41
 
44
42
  ## Immutable And One-Way
45
43
 
46
- - Stage schedule and core economics are chosen at deployment and then fixed.
47
- - Converting an existing project into a revnet is effectively irreversible.
48
- - Burning the split-operator role to `address(0)` is final.
49
- - `REVDeployer` structurally retains project-NFT ownership in the design.
50
- - Expired loans can eventually liquidate into permanently lost collateral if they are not repaid within the long liquidation window.
44
+ - Stage configuration is effectively permanent after deployment.
45
+ - The deployer-held project NFT is not a normal owner-recovery tool.
46
+ - Loan collateral is burned at borrow time and only reminted through repayment or documented flows.
47
+ - Hidden-token balances change visible supply until reveal.
51
48
 
52
49
  ## Operational Notes
53
50
 
54
- - Use the split operator only for the intentionally narrow surfaces left mutable.
55
- - Treat buyback, router, sucker, and optional 721 adjustments as operational extensions around a fixed economic core.
56
- - Keep `REVLoans` owner power limited to URI resolver maintenance.
57
- - Treat loan operations as position management with real long-tail irreversibility; after the liquidation duration expires, collateral recovery is no longer available.
51
+ - Treat revnet launch as the real governance decision.
52
+ - Validate stage timing, split-operator scope, and optional integrations before deployment.
53
+ - Review cash-out delay, hidden-token semantics, and loan permissions together.
54
+ - Do not assume there is a broad admin override for bad economics after launch.
58
55
 
59
56
  ## Machine Notes
60
57
 
61
- - Do not infer broad control from `REVDeployer` holding the project NFT; the design is intentionally constrained.
62
- - Treat `src/REVDeployer.sol`, `src/REVOwner.sol`, and `src/REVLoans.sol` together when crawling authority.
63
- - If stage config or split-operator assumptions differ from deployed state, stop; those are foundational revnet assumptions, not cosmetic metadata.
58
+ - Do not describe Revnets as fully adminless if the deployer-held NFT still matters for the trust model.
59
+ - Also do not describe them as ordinary owner-controlled projects. The point is that the available control surface is intentionally narrow.
60
+ - If a question is about runtime cash-outs, buybacks, or mint permissions, inspect `REVOwner` before inferring behavior from deployment prose.
64
61
 
65
62
  ## Recovery
66
63
 
67
- - Wrong stage design is not realistically recoverable in place; deploy a new revnet.
68
- - Wrong optional integration can sometimes be corrected if the split operator still has the required scoped power.
69
- - There is no broad admin escape hatch that can rewrite revnet economics after launch.
70
- - Liquidated loan collateral is not an admin-recoverable asset; recovery must happen before liquidation through borrower action.
64
+ - If launch-time economics are wrong, recovery usually means replacement, not in-place repair.
65
+ - If optional integrations are misconfigured, fix only where the code still exposes a valid path.
66
+ - If the design intentionally omitted a recovery path, do not invent one in documentation or ops guidance.
71
67
 
72
68
  ## Admin Boundaries
73
69
 
74
- - The split operator cannot rewrite issuance schedule, cash-out tax, or stage timing.
75
- - `REVLoans` owner cannot redirect collateral or treasury funds.
76
- - `REVDeployer` cannot act like a normal human owner despite holding the project NFT.
77
- - Nobody can change the revnet's fundamental staged design after deployment.
78
- - Nobody can administratively restore collateral after an expired loan has been liquidated.
79
-
80
- ## Source Map
81
-
82
- - `src/REVDeployer.sol`
83
- - `src/REVOwner.sol`
84
- - `src/REVLoans.sol`
85
- - `src/REVHiddenTokens.sol`
86
- - `test/`
70
+ - No ordinary owner can casually rewrite staged economics after launch.
71
+ - Split operators are not general-purpose governors.
72
+ - Loan mechanics, hidden-token mechanics, and cash-out policy remain bounded by the deployed revnet logic.
73
+ - This repo should not be documented as if it had a normal mutable project-owner model.
package/ARCHITECTURE.md CHANGED
@@ -6,16 +6,16 @@
6
6
 
7
7
  ## System Overview
8
8
 
9
- `REVDeployer` handles launch-time shape, staged rulesets, hook wiring, and runtime wrapper behavior. `REVOwner` provides the owner-like runtime policy surface for pay and cash-out hooks after launch. `REVLoans` manages burn-collateral loan positions represented as ERC-721 loans. `REVHiddenTokens` lets holders burn tokens to exclude them from total supply until they reveal them again.
9
+ `REVDeployer` handles launch-time shape, staged rulesets, hook wiring, and runtime wrapper behavior. `REVOwner` provides the owner-like runtime policy surface for pay and cash-out hooks after launch. `REVLoans` manages burn-collateral loan positions represented as NFTs. `REVHiddenTokens` lets holders burn tokens to exclude them from visible supply until they reveal them again.
10
10
 
11
11
  ## Core Invariants
12
12
 
13
13
  - Revnets are intended to be ownerless after deployment; easy admin recovery paths would violate the product model.
14
14
  - Stage configuration is effectively permanent once queued.
15
- - Loan collateral is burned, not escrowed, and supply-sensitive logic must treat it as real destruction until repayment.
16
- - Hidden tokens are burned, not escrowed, and reduce total supply until revealed.
15
+ - Loan collateral is burned, not escrowed.
16
+ - Hidden tokens are burned, not escrowed, and reduce visible supply until revealed.
17
17
  - `REVOwner` and `REVDeployer` are tightly coupled; their setup order matters.
18
- - Cash-out delay affects both exits and borrowing power. If the current stage delays cash out, `REVLoans` should treat borrowability as zero until that delay expires.
18
+ - Cash-out delay affects both exits and borrowing power.
19
19
  - Cross-chain supply and surplus are part of revnet economics. Local payouts and loans must not ignore remote sucker snapshots.
20
20
 
21
21
  ## Modules
@@ -62,17 +62,17 @@ borrower
62
62
 
63
63
  ## Accounting Model
64
64
 
65
- The repo does not replace core treasury accounting. Its critical economic logic is the interaction between staged revnet configuration, burned-collateral loan state, hidden-token supply exclusion, and omnichain revnet state imported from suckers.
65
+ The repo does not replace core treasury accounting. Its critical economic logic is the interaction between staged revnet config, burned-collateral loan state, hidden-token supply exclusion, and omnichain revnet state imported from suckers.
66
66
 
67
- `REVOwner` also composes payment and cash-out hooks. On pay, it merges 721-tier split forwarding with buyback-hook behavior and scales mint weight so the terminal only mints against the share actually entering the project. On cash out, it uses omnichain supply and surplus for reclaim math, exempts trusted suckers from tax and fee routing, and may append a fee hook spec that forwards rev fees to the fee revnet.
67
+ `REVOwner` also composes payment and cash-out hooks. On pay, it can merge 721-tier split forwarding with buyback-hook behavior and scale mint weight so the terminal only mints against the share that actually enters the project. On cash out, it can use omnichain supply and surplus for reclaim math, exempt trusted suckers, and append fee-hook specs.
68
68
 
69
69
  ## Security Model
70
70
 
71
71
  - The highest-risk interactions sit where stage economics, treasury state, and loan borrowability meet.
72
- - Ownerlessness removes convenient operational recovery from misconfiguration.
72
+ - Ownerlessness removes convenient recovery from misconfiguration.
73
73
  - Hidden-token and burned-collateral semantics materially affect supply-sensitive pricing.
74
- - `REVOwner` is a live runtime policy surface, not just a launch helper. Cash-out delay, buyback composition, sucker exemptions, and fee routing all pass through it.
75
- - Rev cash-out fees stack on top of protocol-fee behavior rather than replacing it. Fee semantics should be reviewed with terminal behavior, not in isolation.
74
+ - `REVOwner` is a live runtime policy surface, not just a launch helper.
75
+ - Rev cash-out fees stack on top of protocol-fee behavior rather than replacing it.
76
76
 
77
77
  ## Safe Change Guide
78
78
 
@@ -80,8 +80,19 @@ The repo does not replace core treasury accounting. Its critical economic logic
80
80
  - If stage semantics change, inspect loan math, cash-out behavior, and downstream fee expectations together.
81
81
  - Do not casually add mutable admin escape hatches.
82
82
  - If you change borrowability, re-check cash-out-delay gating, omnichain surplus inputs, and local-surplus caps together.
83
- - If you change hook composition, re-check 721 split handling, buyback hook assumptions, and which callers retain mint permission through `REVOwner`.
84
- - If loan calculations change, review flash-loan and surplus-sensitive behavior adversarially.
83
+ - If you change hook composition, re-check 721 split handling, buyback assumptions, and mint-permission flows.
84
+
85
+ ## Cross-Chain Configuration Hash
86
+
87
+ `REVDeployer` produces an `encodedConfigurationHash` for each revnet that determines sucker deployment salts. This hash commits the revnet's identity across chains. It includes:
88
+
89
+ - `baseCurrency`, `description.name`, `description.ticker`, `description.salt`
90
+ - Terminal addresses (order-sensitive)
91
+ - Stage parameters (timing, issuance, splits, tax rates, auto-issuances)
92
+
93
+ Terminal addresses are included because they are deployed deterministically at the same address across chains. Accounting contexts (token addresses) are excluded because tokens like USDC legitimately differ per chain.
94
+
95
+ This means a revnet can only expand to a new chain if it uses the exact same terminal contract it used on the host chain. Different terminal addresses produce a different hash, preventing accidental cross-chain mismatches in sucker deployments.
85
96
 
86
97
  ## Canonical Checks
87
98
 
@@ -91,6 +102,8 @@ The repo does not replace core treasury accounting. Its critical economic logic
91
102
  `test/TestStageTransitionBorrowable.t.sol`
92
103
  - omnichain or phantom-surplus edge cases:
93
104
  `test/audit/CodexPhantomSurplusTerminal.t.sol`
105
+ - terminal encoding in configuration hash:
106
+ `test/TestTerminalEncodingInHash.t.sol`
94
107
 
95
108
  ## Source Map
96
109
 
@@ -1,124 +1,87 @@
1
1
  # Audit Instructions
2
2
 
3
- Revnets are autonomous Juicebox projects with staged economics and token-collateralized loans. Audit this repo as both a privileged deployer layer and a live economic system.
3
+ Revnet is a staged, owner-minimized product layer on top of Juicebox core. Audit it as an economic system, not just a deployer plus a loan contract.
4
4
 
5
5
  ## Audit Objective
6
6
 
7
7
  Find issues that:
8
- - let a participant borrow more than intended against revnet collateral
9
- - break stage transitions or immutable revnet economics
10
- - mis-scale weights, fees, or split behavior in composed payment flows
11
- - grant owner-like or operator-like powers outside the documented model
12
- - leave deployed revnets or loans in states that cannot settle safely
8
+
9
+ - break stage progression or let users act under the wrong stage assumptions
10
+ - overstate or understate borrowability
11
+ - mis-handle hidden tokens or burned-collateral accounting
12
+ - give operators or integrations more power than the revnet model intends
13
+ - make omnichain supply, surplus, or sucker assumptions drift from runtime behavior
13
14
 
14
15
  ## Scope
15
16
 
16
17
  In scope:
18
+
17
19
  - `src/REVDeployer.sol`
18
20
  - `src/REVOwner.sol`
19
21
  - `src/REVLoans.sol`
20
22
  - `src/REVHiddenTokens.sol`
21
- - `src/interfaces/`
22
- - `src/structs/`
23
- - deployment scripts in `script/`
24
-
25
- Key dependencies:
26
- - `nana-core-v6`
27
- - `nana-721-hook-v6`
28
- - `nana-buyback-hook-v6`
29
- - `nana-suckers-v6`
30
- - `croptop-core-v6`
23
+ - structs, interfaces, and deployment helpers
31
24
 
32
25
  ## Start Here
33
26
 
34
- Read in this order:
35
- - `REVOwner`
36
- - `REVDeployer`
37
- - `REVLoans`
38
-
39
- `REVOwner` is the fastest way to understand how a live revnet differs from plain Juicebox behavior.
40
- `REVDeployer` explains why that behavior exists.
41
- `REVLoans` is where those economics are turned into extractable collateral value.
27
+ 1. `src/REVDeployer.sol`
28
+ 2. `src/REVOwner.sol`
29
+ 3. `src/REVLoans.sol`
30
+ 4. `src/REVHiddenTokens.sol`
42
31
 
43
32
  ## Security Model
44
33
 
45
- The repo splits responsibilities:
46
- - `REVDeployer`: launches revnets, encodes stage configs, manages optional 721 and sucker composition
47
- - `REVOwner`: runtime data/cash-out hook used by deployed revnets
48
- - `REVLoans`: loan system that burns collateral on borrow and re-mints on repayment
49
- - `REVHiddenTokens`: temporary token hiding that burns tokens to exclude from totalSupply and re-mints on reveal
34
+ Revnet composes several sensitive systems:
35
+
36
+ - staged rulesets and launch-time immutability
37
+ - runtime pay and cash-out policy in `REVOwner`
38
+ - burned-collateral lending in `REVLoans`
39
+ - hidden-token supply exclusion in `REVHiddenTokens`
50
40
 
51
- Important composition behavior:
52
- - revnet payments may be proxied through 721 and buyback hooks
53
- - cash-out behavior may be altered for suckers or by revnet-specific fee handling
54
- - loan health depends on bonding-curve value and surplus, so core accounting and stage timing directly matter
41
+ The main audit mindset is composition:
55
42
 
56
- Two mental models help here:
57
- - `REVDeployer` is mostly a launch-time authority that permanently shapes economics
58
- - `REVOwner` is a runtime hook that can make a launched revnet behave very differently from a plain Juicebox project
43
+ - stage economics affect borrowability
44
+ - hidden supply affects cash-out math
45
+ - omnichain state can affect reclaim and borrowing power
46
+ - optional integrations can widen the effective trust surface
59
47
 
60
48
  ## Roles And Privileges
61
49
 
62
50
  | Role | Powers | How constrained |
63
51
  |------|--------|-----------------|
64
- | Revnet launcher | Set the stage schedule and optional compositions | Must not retain hidden runtime privilege |
65
- | `REVOwner` | Alter payment and cash-out behavior at runtime | Must remain narrowly scoped to documented economics |
66
- | Borrower or operator | Open, repay, reallocate, hide, or reveal with delegated permissions | Must not redirect collateral or proceeds away from the holder |
52
+ | Revnet deployer path | Define long-lived stage and operator shape | Must not retain unexpected mutable governance |
53
+ | Split operator | Use the allowed runtime envelope | Must stay within deployment-defined permissions |
54
+ | Borrower or delegated operator | Open or manage loans | Must not escape collateral, delay, or source limits |
55
+ | Hidden-token user or delegate | Burn and reveal visible supply | Must not create extra supply or break accounting |
67
56
 
68
57
  ## Integration Assumptions
69
58
 
70
59
  | Dependency | Assumption | What breaks if wrong |
71
60
  |------------|------------|----------------------|
72
- | `nana-core-v6` | Surplus and issuance accounting remain coherent | Borrow limits and stage economics become unsound |
73
- | `nana-721-hook-v6` and `nana-buyback-hook-v6` | Optional composition does not distort accounting unexpectedly | Runtime economics diverge from the stage design |
74
- | `nana-suckers-v6` | Omnichain privilege surfaces identify real suckers only | Fee-free or mint exemptions widen |
61
+ | `nana-core-v6` | Rulesets, reclaim math, and surplus views stay coherent | Stage and cash-out behavior drift |
62
+ | `nana-suckers-v6` | Remote supply/surplus snapshots are authentic | Omnichain reclaim and borrowability drift |
63
+ | Buyback and 721 integrations | Hook composition remains consistent with revnet expectations | Pay-path and mint-permission behavior drift |
75
64
 
76
65
  ## Critical Invariants
77
66
 
78
- 1. Stage immutability
79
- Once a revnet is launched, future stage economics must follow the encoded schedule and not become mutable through helper paths.
80
-
81
- 2. Payment accounting is scaled correctly
82
- If only part of a payment enters the treasury because of split or hook routing, token issuance must reflect only that treasury-entering portion.
83
-
84
- 3. Loan collateralization is sound
85
- Borrow, repay, refinance, and liquidation paths must never let a borrower extract more value than the design permits.
86
-
87
- 4. Hook privilege stays narrow
88
- `REVOwner` and deployer-only setters must not be callable by arbitrary actors or stale deployment helpers.
89
-
90
- 5. Sucker and operator exemptions are precise
91
- Fee-free or mint-enabled paths meant for registered omnichain components must not be reusable by arbitrary callers.
92
-
93
- 6. Collateral burn/remint symmetry holds
94
- Loan collateral that is burned on borrow and re-minted on repay must not be duplicable, strandable, or recoverable by the wrong party.
95
-
96
- 7. Hidden token accounting is sound
97
- Tokens hidden via REVHiddenTokens must be exactly recoverable on reveal. The hidden balance must not allow minting more tokens than were burned, and totalHiddenOf must equal the sum of all per-holder hidden balances.
98
-
99
- 8. Stage transitions do not create hidden refinancing windows
100
- Changes in issuance or cash-out economics across stages must not let a borrower lock in value that the system intended to become unavailable.
67
+ 1. Stage progression stays monotonic and follows deployed timing.
68
+ 2. Borrowability respects cash-out delay, surplus, supply, and source limits.
69
+ 3. Burned collateral is not accidentally treated like escrowed collateral.
70
+ 4. Hidden-token accounting preserves total claims while changing visible supply intentionally.
71
+ 5. Optional integrations do not silently widen revnet authority or mint rights.
101
72
 
102
73
  ## Attack Surfaces
103
74
 
104
- - `REVOwner.beforePayRecordedWith`
105
- - `REVOwner.beforeCashOutRecordedWith`
106
- - deployer-only linkage between `REVDeployer` and `REVOwner`
107
- - `REVLoans` borrowable amount, fee accrual, and liquidation logic
108
- - `REVHiddenTokens.hideTokensOf` and `revealTokensOf` burn/mint symmetry and `HIDE_TOKENS`/`REVEAL_TOKENS` permission checks
109
- - `REVLoans` operator delegation: `OPEN_LOAN`, `REPAY_LOAN`, `REALLOCATE_LOAN` inline permission checks — verify holder/owner receives collateral and loan NFTs in all delegation paths
110
- - any path that assumes a valid tiered 721 hook or sucker mapping exists
111
-
112
- Replay these sequences:
113
- 1. pay into a revnet with 721 and buyback composition enabled and inspect weight scaling
114
- 2. borrow near a stage boundary, then repay, refinance, or liquidate in the next stage
115
- 3. borrow after surplus inflation, then contract surplus before liquidation
116
- 4. cash out through a legitimate sucker path versus a near-sucker spoof path
117
- 5. hide tokens, let another actor cash out, then reveal
75
+ - stage-transition boundaries
76
+ - live borrowability and cross-currency debt aggregation
77
+ - hidden-token burn and reveal flows
78
+ - omnichain surplus and sucker exemptions
79
+ - payment and cash-out hook composition in `REVOwner`
118
80
 
119
81
  ## Accepted Risks Or Behaviors
120
82
 
121
- - Composition is the default audit target here, not an edge case.
83
+ - Revnets intentionally trade recoverability for predictable launch-time economics.
84
+ - Some economic surfaces are conservative by design and may refuse otherwise-valid actions rather than risk an unsafe result.
122
85
 
123
86
  ## Verification
124
87
 
package/CHANGELOG.md CHANGED
@@ -26,12 +26,12 @@ This file describes the verified change from `revnet-core-v5` to the current `re
26
26
  ## Operator delegation (permission IDs 35–39)
27
27
 
28
28
  - Added five new `JBPermissionIds` for operator delegation in `@bananapus/permission-ids-v6`:
29
- - `HIDE_TOKENS` (35) — hide tokens on behalf of a holder via `REVHiddenTokens.hideTokensOf`
29
+ - `HIDE_TOKENS` (35) — lets an authorized operator allow or disallow holders to hide their own tokens via `REVHiddenTokens`
30
30
  - `OPEN_LOAN` (36) — open a loan on behalf of a token holder via `REVLoans.borrowFrom`
31
31
  - `REALLOCATE_LOAN` (37) — reallocate loan collateral on behalf of a loan owner via `REVLoans.reallocateCollateralFromLoan`
32
32
  - `REPAY_LOAN` (38) — repay a loan on behalf of a loan owner via `REVLoans.repayLoan`
33
- - `REVEAL_TOKENS` (39) — reveal hidden tokens on behalf of a holder via `REVHiddenTokens.revealTokensOf`
34
- - `REVHiddenTokens` now inherits `JBPermissioned` and accepts a `holder` parameter on `hideTokensOf` and `revealTokensOf`. An operator with the appropriate permission can act on behalf of the holder.
33
+ - `REVEAL_TOKENS` (39) — legacy permission id; hidden-token reveal no longer depends on it
34
+ - `REVHiddenTokens` now inherits `JBPermissioned` and accepts a `holder` parameter on `hideTokensOf` and `revealTokensOf`. Hiding is available to an operator-managed holder allowlist, and also to the project owner or any operator with `HIDE_TOKENS`. Revealing is holder-only and does not require special permission.
35
35
  - `REVLoans.borrowFrom` now accepts a `holder` parameter. The loan NFT is minted to `holder`, and collateral is burned from `holder`. An operator with `OPEN_LOAN` permission can borrow on behalf of a holder.
36
36
  - `REVLoans.repayLoan` now allows permissioned operators with `REPAY_LOAN` to repay on behalf of the loan NFT owner. Replacement loans are minted to the original loan owner.
37
37
  - `REVLoans.reallocateCollateralFromLoan` now allows permissioned operators with `REALLOCATE_LOAN` to reallocate on behalf of the loan NFT owner. Returned collateral and replacement loans go to the original loan owner.
@@ -41,6 +41,7 @@ This file describes the verified change from `revnet-core-v5` to the current `re
41
41
 
42
42
  - `IREVHiddenTokens.hideTokensOf` signature changed: added `address holder` parameter
43
43
  - `IREVHiddenTokens.revealTokensOf` signature changed: added `address holder` parameter
44
+ - `IREVHiddenTokens.setTokenHidingAllowedFor` added for operator-managed holder allowlisting
44
45
  - `IREVHiddenTokens.HideTokens` event: added `address holder` field
45
46
  - `IREVHiddenTokens.RevealTokens` event: added `address holder` field
46
47
  - `IREVLoans.borrowFrom` signature changed: added `address holder` as last parameter
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Revnet Core
2
2
 
3
- `@rev-net/core-v6` deploys and operates Revnets: Juicebox project shapes with staged economics, optional tiered NFTs, cross-chain support, buyback integration, and token-collateralized loans.
3
+ `@rev-net/core-v6` deploys and operates Revnets: Juicebox project shapes with staged economics, optional tiered NFTs, cross-chain support, buyback integration, hidden-token mechanics, and token-collateralized loans.
4
4
 
5
5
  Docs: <https://docs.juicebox.money>
6
6
  Architecture: [ARCHITECTURE.md](./ARCHITECTURE.md)
@@ -18,13 +18,12 @@ This package provides:
18
18
 
19
19
  - a deployer that launches Revnets and stores their long-lived configuration
20
20
  - a runtime hook that mediates pay, cash-out, mint-permission, and delayed-cash-out behavior
21
- - an ERC-721 loan system that burns token collateral on borrow and remints on repayment
21
+ - a loan system that burns token collateral on borrow and remints on repayment
22
+ - a hidden-token system that temporarily removes tokens from visible supply
22
23
 
23
24
  It also composes with the 721 hook stack, buyback hook, router terminal, Croptop, and suckers where needed.
24
25
 
25
- Use this repo when the product is a treasury-backed network with encoded stage transitions and a tightly constrained post-launch admin surface. Do not use it when governance, mutable operator control, or simple project deployment is the goal.
26
-
27
- The key point is that a Revnet is not just "a Juicebox project with presets." It is a project shape whose admin surface is intentionally collapsed into deployment-time configuration plus constrained runtime operators, even though the deployer contract still retains the project NFT.
26
+ Use this repo when the product is a treasury-backed network with encoded stage transitions and a tightly constrained post-launch admin surface. Do not use it when the goal is ordinary governance or a simple project deploy.
28
27
 
29
28
  ## Key Contracts
30
29
 
@@ -33,48 +32,38 @@ The key point is that a Revnet is not just "a Juicebox project with presets." It
33
32
  | `REVDeployer` | Launches and configures Revnets, stages, split operators, and optional auxiliary features. |
34
33
  | `REVOwner` | Runtime data-hook and cash-out-hook surface used by active Revnets. |
35
34
  | `REVLoans` | Loan surface that lets users borrow against Revnet tokens with burned collateral and NFT loan positions. |
36
- | `REVHiddenTokens` | Lets token holders temporarily hide (burn) tokens, excluding them from totalSupply and increasing cash-out value for remaining holders. Hidden tokens can be revealed (re-minted) at any time. |
35
+ | `REVHiddenTokens` | Lets token holders temporarily hide tokens, excluding them from visible supply until reveal. |
37
36
 
38
37
  ## Mental Model
39
38
 
40
39
  Read the package in two halves:
41
40
 
42
41
  1. deployment-time shape: `REVDeployer` decides what the network will be allowed to do
43
- 2. runtime enforcement: `REVOwner` and `REVLoans` decide how that shape behaves over time
44
-
45
- That split matters because most mistakes are one of these:
46
-
47
- - assuming a deploy-time parameter can be changed later
48
- - assuming a runtime hook is only advisory rather than economically binding
42
+ 2. runtime enforcement: `REVOwner`, `REVLoans`, and `REVHiddenTokens` decide how that shape behaves over time
49
43
 
50
- The shortest useful reading order is:
51
-
52
- 1. `REVDeployer`
53
- 2. `REVOwner`
54
- 3. `REVLoans`
55
- 4. any integrated hook or bridge repo the deployment enables
44
+ Most mistakes come from assuming a deploy-time parameter can be changed later or that a runtime hook is only advisory.
56
45
 
57
46
  ## Read These Files First
58
47
 
59
48
  1. `src/REVDeployer.sol`
60
49
  2. `src/REVOwner.sol`
61
50
  3. `src/REVLoans.sol`
62
- 4. the integrated hook or bridge repo used by the deployment
51
+ 4. `src/REVHiddenTokens.sol`
52
+ 5. the integrated hook or bridge repo used by the deployment
63
53
 
64
54
  ## Integration Traps
65
55
 
66
- - the deployer holding the project NFT is not an implementation detail; it is part of the ownership model
56
+ - the deployer holding the project NFT is part of the ownership model, not an implementation detail
67
57
  - split operators are constrained, not equivalent to general protocol governance
68
- - the loan system depends on live revnet economics, so it should be reviewed together with the runtime hook and treasury assumptions
69
- - optional integrations like buybacks, 721 hooks, and suckers are compositional, but they materially change the resulting network
58
+ - the loan system depends on live revnet economics and should be reviewed together with the runtime hook
59
+ - optional integrations like buybacks, 721 hooks, and suckers materially change the resulting network
70
60
 
71
61
  ## Where State Lives
72
62
 
73
63
  - deployment-time configuration and operator envelope live in `REVDeployer`
74
64
  - runtime pay and cash-out behavior live in `REVOwner`
75
65
  - loan positions and loan-specific state live in `REVLoans`
76
-
77
- Do not audit those contracts in isolation if the deployment enables cross-package features; the composed network is the real product.
66
+ - hidden-token state lives in `REVHiddenTokens`
78
67
 
79
68
  ## High-Signal Tests
80
69
 
@@ -107,7 +96,7 @@ Useful scripts:
107
96
 
108
97
  ## Deployment Notes
109
98
 
110
- Revnet deployment assumes the core protocol, 721 hook, buyback hook, router terminal, suckers, and Croptop packages are available. Revnets are intentionally unowned in the direct human-EOA sense after deployment, but the deployer contract itself retains the project NFT and remains part of the ownership model.
99
+ Revnet deployment assumes the core protocol, 721 hook, buyback hook, router terminal, suckers, and Croptop packages are available. Revnets are intentionally unowned in the direct human sense after deployment, but the deployer contract itself remains part of the ownership model.
111
100
 
112
101
  ## Repository Layout
113
102
 
@@ -116,6 +105,7 @@ src/
116
105
  REVDeployer.sol
117
106
  REVOwner.sol
118
107
  REVLoans.sol
108
+ REVHiddenTokens.sol
119
109
  interfaces/
120
110
  structs/
121
111
  test/
@@ -128,14 +118,12 @@ script/
128
118
  ## Risks And Notes
129
119
 
130
120
  - Revnets are intentionally hard to change after launch, so bad stage design is expensive
131
- - `REVLoans` relies on live treasury conditions and is therefore sensitive to surplus and pricing assumptions
132
- - the deployer and runtime hook have a tight relationship that should be treated as one design, not two independent contracts
133
- - burned-collateral lending is operationally different from escrowed-collateral lending and needs clear integrator expectations
134
-
135
- The usual review failure mode is to focus on the loans or the stages in isolation. The real system is the combination of stage economics, runtime hook behavior, and who is still allowed to act after deployment.
121
+ - `REVLoans` relies on live treasury conditions and is sensitive to surplus and pricing assumptions
122
+ - the deployer and runtime hook should be treated as one design, not two separate systems
123
+ - burned-collateral lending is operationally different from escrowed-collateral lending
136
124
 
137
125
  ## For AI Agents
138
126
 
139
- - Describe Revnets as treasury-backed Juicebox project shapes with encoded stage transitions, not as simple deploy presets.
140
- - Read `REVDeployer`, `REVOwner`, and `REVLoans` together before answering economic or admin-surface questions.
127
+ - Describe Revnets as treasury-backed Juicebox project shapes with encoded stage transitions, not as simple presets.
128
+ - Read `REVDeployer`, `REVOwner`, `REVLoans`, and `REVHiddenTokens` together before answering economic or admin-surface questions.
141
129
  - If a deployment enables buybacks, 721 hooks, or suckers, inspect those sibling repos before making definitive claims.