@rev-net/core-v6 0.0.36 → 0.0.39
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/CHANGELOG.md +2 -2
- package/README.md +6 -7
- package/foundry.toml +1 -1
- package/package.json +23 -16
- package/references/operations.md +1 -1
- package/references/runtime.md +1 -1
- package/script/Deploy.s.sol +12 -9
- package/src/REVDeployer.sol +60 -65
- package/src/REVHiddenTokens.sol +2 -2
- package/src/REVLoans.sol +134 -90
- package/src/REVOwner.sol +124 -17
- package/src/interfaces/IREVDeployer.sol +2 -1
- package/src/interfaces/IREVHiddenTokens.sol +4 -1
- package/src/interfaces/IREVOwner.sol +5 -0
- package/ADMINISTRATION.md +0 -73
- package/ARCHITECTURE.md +0 -116
- package/AUDIT_INSTRUCTIONS.md +0 -90
- package/RISKS.md +0 -97
- package/SKILLS.md +0 -46
- package/STYLE_GUIDE.md +0 -610
- package/USER_JOURNEYS.md +0 -195
- package/foundry.lock +0 -11
- package/slither-ci.config.json +0 -10
- package/sphinx.lock +0 -507
- package/test/REV.integrations.t.sol +0 -573
- package/test/REVAutoIssuanceFuzz.t.sol +0 -328
- package/test/REVDeployerRegressions.t.sol +0 -396
- package/test/REVInvincibility.t.sol +0 -1371
- package/test/REVInvincibilityHandler.sol +0 -387
- package/test/REVLifecycle.t.sol +0 -420
- package/test/REVLoans.invariants.t.sol +0 -724
- package/test/REVLoansAttacks.t.sol +0 -816
- package/test/REVLoansFeeRecovery.t.sol +0 -783
- package/test/REVLoansFindings.t.sol +0 -711
- package/test/REVLoansRegressions.t.sol +0 -364
- package/test/REVLoansSourceFeeRecovery.t.sol +0 -517
- package/test/REVLoansSourced.t.sol +0 -1839
- package/test/REVLoansUnSourced.t.sol +0 -409
- package/test/TestAuditFixVerification.t.sol +0 -675
- package/test/TestBurnHeldTokens.t.sol +0 -394
- package/test/TestCEIPattern.t.sol +0 -508
- package/test/TestCashOutCallerValidation.t.sol +0 -452
- package/test/TestConversionDocumentation.t.sol +0 -368
- package/test/TestCrossCurrencyReclaim.t.sol +0 -610
- package/test/TestCrossSourceReallocation.t.sol +0 -361
- package/test/TestERC2771MetaTx.t.sol +0 -585
- package/test/TestEmptyBuybackSpecs.t.sol +0 -300
- package/test/TestFlashLoanSurplus.t.sol +0 -365
- package/test/TestHiddenTokens.t.sol +0 -474
- package/test/TestHookArrayOOB.t.sol +0 -278
- package/test/TestLiquidationBehavior.t.sol +0 -398
- package/test/TestLoanSourceRotation.t.sol +0 -553
- package/test/TestLoansCashOutDelay.t.sol +0 -493
- package/test/TestLongTailEconomics.t.sol +0 -677
- package/test/TestLowFindings.t.sol +0 -677
- package/test/TestMixedFixes.t.sol +0 -593
- package/test/TestPermit2Signatures.t.sol +0 -683
- package/test/TestReallocationSandwich.t.sol +0 -412
- package/test/TestRevnetRegressions.t.sol +0 -350
- package/test/TestSplitWeightAdjustment.t.sol +0 -527
- package/test/TestSplitWeightE2E.t.sol +0 -605
- package/test/TestSplitWeightFork.t.sol +0 -855
- package/test/TestStageTransitionBorrowable.t.sol +0 -301
- package/test/TestSwapTerminalPermission.t.sol +0 -262
- package/test/TestTerminalEncodingInHash.t.sol +0 -326
- package/test/TestUint112Overflow.t.sol +0 -311
- package/test/TestZeroAmountLoanGuard.t.sol +0 -378
- package/test/TestZeroRepayment.t.sol +0 -354
- package/test/audit/CodexCrossChainBuybackRouteMismatch.t.sol +0 -184
- package/test/audit/CodexPhantomSurplusTerminal.t.sol +0 -367
- package/test/audit/CodexREVOwnerRemoteSurplusCurrencyMismatch.t.sol +0 -142
- package/test/audit/LoanIdOverflowGuard.t.sol +0 -523
- package/test/audit/NemesisOperatorDelegation.t.sol +0 -356
- package/test/audit/SupportsInterfaceTest.t.sol +0 -51
- package/test/audit/TestFeeAllowanceLeak.t.sol +0 -197
- package/test/audit/TestLoansAndDeployerFixes.t.sol +0 -576
- package/test/fork/ForkTestBase.sol +0 -727
- package/test/fork/TestAutoIssuanceFork.t.sol +0 -148
- package/test/fork/TestCashOutFork.t.sol +0 -253
- package/test/fork/TestIssuanceDecayFork.t.sol +0 -158
- package/test/fork/TestLoanBorrowFork.t.sol +0 -163
- package/test/fork/TestLoanCrossRulesetFork.t.sol +0 -308
- package/test/fork/TestLoanERC20Fork.t.sol +0 -465
- package/test/fork/TestLoanLiquidationFork.t.sol +0 -135
- package/test/fork/TestLoanReallocateFork.t.sol +0 -113
- package/test/fork/TestLoanRepayFork.t.sol +0 -188
- package/test/fork/TestLoanTransferFork.t.sol +0 -143
- package/test/fork/TestPermit2PaymentFork.t.sol +0 -300
- package/test/fork/TestSplitWeightFork.t.sol +0 -189
- package/test/helpers/MaliciousContracts.sol +0 -247
- package/test/helpers/REVEmpty721Config.sol +0 -45
- package/test/mock/MockBuybackCashOutRecorder.sol +0 -84
- package/test/mock/MockBuybackDataHook.sol +0 -112
- package/test/mock/MockBuybackDataHookMintPath.sol +0 -68
- package/test/mock/MockSuckerRegistry.sol +0 -17
- package/test/regression/TestBurnPermissionRequired.t.sol +0 -294
- package/test/regression/TestCashOutBuybackFeeLeak.t.sol +0 -232
- package/test/regression/TestCrossRevnetLiquidation.t.sol +0 -255
- package/test/regression/TestCumulativeLoanCounter.t.sol +0 -361
- package/test/regression/TestLiquidateGapHandling.t.sol +0 -394
- package/test/regression/TestZeroPriceFeed.t.sol +0 -422
package/USER_JOURNEYS.md
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
# User Journeys
|
|
2
|
-
|
|
3
|
-
## Repo Purpose
|
|
4
|
-
|
|
5
|
-
This repo packages autonomous Revnets: staged Juicebox projects whose runtime behavior is intentionally constrained after launch. It owns deploy-time stage encoding, runtime enforcement, hidden-token mechanics, and lending against revnet token exposure.
|
|
6
|
-
|
|
7
|
-
## Primary Actors
|
|
8
|
-
|
|
9
|
-
- teams launching autonomous Revnets with encoded stage transitions
|
|
10
|
-
- participants buying, holding, and cashing out Revnet exposure over time
|
|
11
|
-
- borrowers using Revnet tokens as collateral instead of selling them
|
|
12
|
-
- operators working inside the narrow post-launch envelope the deployer allows
|
|
13
|
-
|
|
14
|
-
## Key Surfaces
|
|
15
|
-
|
|
16
|
-
- `REVDeployer`: launch-time packaging, stage config, and operator envelope
|
|
17
|
-
- `REVOwner`: runtime pay and cash-out behavior for active Revnets
|
|
18
|
-
- `REVLoans`: borrowing, repayment, transfer, reallocation, and liquidation
|
|
19
|
-
- `REVHiddenTokens`: temporarily hide and later reveal token supply
|
|
20
|
-
- `autoIssueFor(...)`, `hideTokensOf(...)`, `revealTokensOf(...)`, `borrowFrom(...)`: high-signal runtime entrypoints
|
|
21
|
-
|
|
22
|
-
## Journey 1: Launch A Revnet With Its Long-Lived Rules Encoded Up Front
|
|
23
|
-
|
|
24
|
-
**Actor:** launch team.
|
|
25
|
-
|
|
26
|
-
**Intent:** deploy a Revnet whose economic envelope is encoded up front and stays bounded afterward.
|
|
27
|
-
|
|
28
|
-
**Preconditions**
|
|
29
|
-
|
|
30
|
-
- the team knows the stage schedule, issuance behavior, operator envelope, and optional integrations
|
|
31
|
-
- the team accepts that many choices become expensive or impossible to change later
|
|
32
|
-
|
|
33
|
-
**Main Flow**
|
|
34
|
-
|
|
35
|
-
1. Use `REVDeployer` with the staged config, split operators, and optional integrations.
|
|
36
|
-
2. The deployer launches the underlying project and preserves the intended ownership model.
|
|
37
|
-
3. Stage and auxiliary behavior are committed at launch instead of left to ordinary owner discretion.
|
|
38
|
-
4. The Revnet can now accept payments and progress through stages under the encoded rules.
|
|
39
|
-
|
|
40
|
-
**Failure Modes**
|
|
41
|
-
|
|
42
|
-
- teams assume deploy-time parameters can be revisited casually
|
|
43
|
-
- optional integrations are enabled without auditing their effect on the resulting network
|
|
44
|
-
|
|
45
|
-
**Postconditions**
|
|
46
|
-
|
|
47
|
-
- the Revnet launches with its long-lived stage envelope encoded up front
|
|
48
|
-
|
|
49
|
-
## Journey 2: Participate Across Stage Transitions
|
|
50
|
-
|
|
51
|
-
**Actor:** participant.
|
|
52
|
-
|
|
53
|
-
**Intent:** buy, hold, and exit Revnet exposure across stage changes.
|
|
54
|
-
|
|
55
|
-
**Preconditions**
|
|
56
|
-
|
|
57
|
-
- the Revnet is already live
|
|
58
|
-
- the participant understands active stage parameters can change behavior over time
|
|
59
|
-
|
|
60
|
-
**Main Flow**
|
|
61
|
-
|
|
62
|
-
1. Pay through the configured terminal or router.
|
|
63
|
-
2. Let `REVOwner` enforce runtime behavior such as pay handling, delayed exits, and stage-sensitive constraints.
|
|
64
|
-
3. As stages advance, later pays and exits follow the new active parameters while project identity stays constant.
|
|
65
|
-
|
|
66
|
-
**Failure Modes**
|
|
67
|
-
|
|
68
|
-
- stage parameters are misread as mutable when they are fixed
|
|
69
|
-
- delayed cash-out behavior is misunderstood
|
|
70
|
-
- optional integrations materially change the participant experience
|
|
71
|
-
|
|
72
|
-
**Postconditions**
|
|
73
|
-
|
|
74
|
-
- the participant's buys and exits follow the active stage's constraints
|
|
75
|
-
|
|
76
|
-
## Journey 3: Claim Stage-Based Auto-Issuance
|
|
77
|
-
|
|
78
|
-
**Actor:** auto-issuance beneficiary.
|
|
79
|
-
|
|
80
|
-
**Intent:** claim stage-specific issuance only when it is actually live.
|
|
81
|
-
|
|
82
|
-
**Preconditions**
|
|
83
|
-
|
|
84
|
-
- the Revnet was deployed with auto-issuance allocations
|
|
85
|
-
- the target stage has started
|
|
86
|
-
|
|
87
|
-
**Main Flow**
|
|
88
|
-
|
|
89
|
-
1. Check `amountToAutoIssue(...)`.
|
|
90
|
-
2. Call `autoIssueFor(...)` once the stage is active.
|
|
91
|
-
3. The stored allocation is consumed and cannot be claimed twice.
|
|
92
|
-
|
|
93
|
-
**Failure Modes**
|
|
94
|
-
|
|
95
|
-
- callers try to claim before the stage is active
|
|
96
|
-
- reviewers assume auto-issuance is a generic mint path rather than a bounded stage allocation
|
|
97
|
-
|
|
98
|
-
**Postconditions**
|
|
99
|
-
|
|
100
|
-
- the stage allocation is either claimed once or remains reserved until valid
|
|
101
|
-
|
|
102
|
-
## Journey 4: Hide Tokens To Change Visible Supply
|
|
103
|
-
|
|
104
|
-
**Actor:** holder or authorized operator.
|
|
105
|
-
|
|
106
|
-
**Intent:** remove tokens from visible supply temporarily and later restore them.
|
|
107
|
-
|
|
108
|
-
**Preconditions**
|
|
109
|
-
|
|
110
|
-
- the holder granted `BURN_TOKENS` to `REVHiddenTokens`
|
|
111
|
-
- either the holder has been allowlisted for hidden-token actions, or the caller is the project owner / an operator with `HIDE_TOKENS`
|
|
112
|
-
- the holder accepts the supply and collateral implications of hiding tokens
|
|
113
|
-
|
|
114
|
-
**Main Flow**
|
|
115
|
-
|
|
116
|
-
1. Grant `BURN_TOKENS` to `REVHiddenTokens`.
|
|
117
|
-
2. An operator calls `setTokenHidingAllowedFor(...)` to allow the holder to hide their own tokens.
|
|
118
|
-
3. The holder, project owner, or a `HIDE_TOKENS` operator calls `hideTokensOf(...)` to burn tokens and track the hidden balance.
|
|
119
|
-
4. The lower visible supply changes per-token cash-out value.
|
|
120
|
-
5. Later, the holder calls `revealTokensOf(...)` to remint hidden tokens back to themselves.
|
|
121
|
-
|
|
122
|
-
**Failure Modes**
|
|
123
|
-
|
|
124
|
-
- more tokens are revealed than were hidden
|
|
125
|
-
- holders attempt to hide tokens without being allowlisted
|
|
126
|
-
- non-holders attempt to reveal hidden tokens
|
|
127
|
-
- hidden tokens are assumed to remain usable as loan collateral
|
|
128
|
-
|
|
129
|
-
**Postconditions**
|
|
130
|
-
|
|
131
|
-
- visible supply is reduced or restored according to the holder's hidden-token state
|
|
132
|
-
|
|
133
|
-
## Journey 5: Borrow Against Revnet Tokens Instead Of Selling Them
|
|
134
|
-
|
|
135
|
-
**Actor:** holder or delegated loan operator.
|
|
136
|
-
|
|
137
|
-
**Intent:** borrow against Revnet exposure instead of selling it.
|
|
138
|
-
|
|
139
|
-
**Preconditions**
|
|
140
|
-
|
|
141
|
-
- the holder has eligible Revnet token exposure
|
|
142
|
-
- the holder trusts any delegated operator with `OPEN_LOAN`
|
|
143
|
-
|
|
144
|
-
**Main Flow**
|
|
145
|
-
|
|
146
|
-
1. Interact with `REVLoans` using eligible token exposure as collateral.
|
|
147
|
-
2. The system burns the collateralized exposure and mints a loan NFT.
|
|
148
|
-
3. Borrowed value is issued under live Revnet economics.
|
|
149
|
-
4. The borrower can later repay, reallocate, transfer, or face liquidation.
|
|
150
|
-
|
|
151
|
-
**Failure Modes**
|
|
152
|
-
|
|
153
|
-
- delegated operators redirect value in ways the holder did not intend
|
|
154
|
-
- reviewers model the loan system as escrowed collateral when it is burned-collateral lending
|
|
155
|
-
|
|
156
|
-
**Postconditions**
|
|
157
|
-
|
|
158
|
-
- collateralized exposure becomes a live loan position under Revnet economics
|
|
159
|
-
|
|
160
|
-
## Journey 6: Operate Inside The Bounded Post-Launch Control Envelope
|
|
161
|
-
|
|
162
|
-
**Actor:** operator with ongoing powers.
|
|
163
|
-
|
|
164
|
-
**Intent:** use the sanctioned post-launch controls without violating the autonomous model.
|
|
165
|
-
|
|
166
|
-
**Preconditions**
|
|
167
|
-
|
|
168
|
-
- the Revnet is live
|
|
169
|
-
- the operator knows exactly which controls the deployment left available
|
|
170
|
-
|
|
171
|
-
**Main Flow**
|
|
172
|
-
|
|
173
|
-
1. Review what `REVDeployer` allowed.
|
|
174
|
-
2. Use only those sanctioned surfaces.
|
|
175
|
-
3. Audit cross-package behavior whenever optional integrations are enabled.
|
|
176
|
-
|
|
177
|
-
**Failure Modes**
|
|
178
|
-
|
|
179
|
-
- operators behave as though the Revnet were a normal owner-governed project
|
|
180
|
-
- reviewers inspect controls in isolation and miss integrated runtime behavior
|
|
181
|
-
|
|
182
|
-
**Postconditions**
|
|
183
|
-
|
|
184
|
-
- post-launch control remains inside the bounded envelope left by deployment
|
|
185
|
-
|
|
186
|
-
## Trust Boundaries
|
|
187
|
-
|
|
188
|
-
- this repo is trusted for revnet-specific economics and runtime policy
|
|
189
|
-
- treasury accounting still comes from core
|
|
190
|
-
- optional integrations materially change revnet behavior and must be reviewed together with the local code
|
|
191
|
-
|
|
192
|
-
## Hand-Offs
|
|
193
|
-
|
|
194
|
-
- Use [nana-core-v6](../nana-core-v6/USER_JOURNEYS.md) for underlying terminal and project accounting.
|
|
195
|
-
- Use [nana-buyback-hook-v6](../nana-buyback-hook-v6/USER_JOURNEYS.md), [nana-suckers-v6](../nana-suckers-v6/USER_JOURNEYS.md), and [nana-721-hook-v6](../nana-721-hook-v6/USER_JOURNEYS.md) when those integrations are enabled.
|
package/foundry.lock
DELETED
package/slither-ci.config.json
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"detectors_to_exclude": "timestamp,uninitialized-local,naming-convention,solc-version,shadowing-local",
|
|
3
|
-
"exclude_informational": true,
|
|
4
|
-
"exclude_low": false,
|
|
5
|
-
"exclude_medium": false,
|
|
6
|
-
"exclude_high": false,
|
|
7
|
-
"disable_color": false,
|
|
8
|
-
"filter_paths": "(mocks/|test/|node_modules/|lib/)",
|
|
9
|
-
"legacy_ast": false
|
|
10
|
-
}
|