@rev-net/core-v6 0.0.36 → 0.0.37
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/RISKS.md +11 -1
- package/package.json +9 -9
- package/src/REVLoans.sol +120 -83
- package/src/REVOwner.sol +3 -3
- package/test/REV.integrations.t.sol +14 -14
- package/test/REVInvincibility.t.sol +16 -16
- package/test/REVLifecycle.t.sol +32 -32
- package/test/REVLoansSourced.t.sol +15 -15
- package/test/TestCashOutCallerValidation.t.sol +8 -8
- package/test/TestConversionDocumentation.t.sol +2 -5
- package/test/TestCrossCurrencyReclaim.t.sol +72 -72
- package/test/TestLongTailEconomics.t.sol +56 -56
- package/test/TestSwapTerminalPermission.t.sol +21 -21
- package/test/audit/HiddenSupplyCashout.t.sol +61 -0
- package/test/audit/NemesisVerification.t.sol +97 -0
- package/test/audit/REVOwnerCurrencyMismatch.t.sol +188 -0
- package/test/audit/{CodexREVOwnerRemoteSurplusCurrencyMismatch.t.sol → REVOwnerRemoteSurplusCurrencyMismatch.t.sol} +4 -6
- package/test/audit/ReallocatePermission.t.sol +363 -0
- package/test/audit/RemoteLoanAccountingGap.t.sol +74 -0
- package/test/fork/TestCashOutFork.t.sol +48 -48
- package/test/fork/TestLoanAdversarialFork.t.sol +744 -0
- package/test/fork/TestLoanERC20Fork.t.sol +2 -8
- package/test/fork/TestPermit2PaymentFork.t.sol +32 -32
- package/test/regression/TestBurnPermissionRequired.t.sol +5 -5
- package/test/regression/TestCashOutBuybackFeeLeak.t.sol +8 -8
- /package/test/audit/{CodexCrossChainBuybackRouteMismatch.t.sol → CrossChainBuybackRouteMismatch.t.sol} +0 -0
- /package/test/audit/{NemesisOperatorDelegation.t.sol → OperatorDelegation.t.sol} +0 -0
- /package/test/audit/{CodexPhantomSurplusTerminal.t.sol → PhantomSurplusTerminal.t.sol} +0 -0
|
@@ -45,14 +45,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
45
45
|
vm.prank(PAYER);
|
|
46
46
|
jbMultiTerminal()
|
|
47
47
|
.cashOutTokensOf({
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
holder: PAYER,
|
|
49
|
+
projectId: revnetId,
|
|
50
|
+
cashOutCount: cashOutCount,
|
|
51
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
52
|
+
minTokensReclaimed: 0,
|
|
53
|
+
beneficiary: payable(PAYER),
|
|
54
|
+
metadata: ""
|
|
55
|
+
});
|
|
56
56
|
|
|
57
57
|
// Payer received ETH (via buyback hook swap).
|
|
58
58
|
uint256 ethReceived = PAYER.balance - payerEthBefore;
|
|
@@ -82,14 +82,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
82
82
|
vm.prank(PAYER);
|
|
83
83
|
uint256 reclaimedAmount = jbMultiTerminal()
|
|
84
84
|
.cashOutTokensOf({
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
85
|
+
holder: PAYER,
|
|
86
|
+
projectId: highTaxRevnet,
|
|
87
|
+
cashOutCount: cashOutCount,
|
|
88
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
89
|
+
minTokensReclaimed: 0,
|
|
90
|
+
beneficiary: payable(PAYER),
|
|
91
|
+
metadata: ""
|
|
92
|
+
});
|
|
93
93
|
|
|
94
94
|
// With 90% tax rate, reclaim should be very small relative to surplus.
|
|
95
95
|
uint256 terminalBalance = _terminalBalance(highTaxRevnet, JBConstants.NATIVE_TOKEN);
|
|
@@ -125,14 +125,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
125
125
|
vm.prank(sucker);
|
|
126
126
|
uint256 reclaimedAmount = jbMultiTerminal()
|
|
127
127
|
.cashOutTokensOf({
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
128
|
+
holder: sucker,
|
|
129
|
+
projectId: revnetId,
|
|
130
|
+
cashOutCount: suckerTokens,
|
|
131
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
132
|
+
minTokensReclaimed: 0,
|
|
133
|
+
beneficiary: payable(sucker),
|
|
134
|
+
metadata: ""
|
|
135
|
+
});
|
|
136
136
|
|
|
137
137
|
// Full pro-rata reclaim (0% tax).
|
|
138
138
|
uint256 expectedReclaim = (surplus * suckerTokens) / totalSupply;
|
|
@@ -183,14 +183,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
183
183
|
vm.prank(PAYER);
|
|
184
184
|
jbMultiTerminal()
|
|
185
185
|
.cashOutTokensOf({
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
186
|
+
holder: PAYER,
|
|
187
|
+
projectId: splitRevnetId,
|
|
188
|
+
cashOutCount: payerTokens,
|
|
189
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
190
|
+
minTokensReclaimed: 0,
|
|
191
|
+
beneficiary: payable(PAYER),
|
|
192
|
+
metadata: ""
|
|
193
|
+
});
|
|
194
194
|
|
|
195
195
|
assertGt(PAYER.balance, payerEthBefore, "payer should receive ETH after tier split cashout");
|
|
196
196
|
}
|
|
@@ -220,14 +220,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
220
220
|
vm.expectRevert();
|
|
221
221
|
jbMultiTerminal()
|
|
222
222
|
.cashOutTokensOf({
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
223
|
+
holder: PAYER,
|
|
224
|
+
projectId: delayRevnet,
|
|
225
|
+
cashOutCount: payerTokens,
|
|
226
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
227
|
+
minTokensReclaimed: 0,
|
|
228
|
+
beneficiary: payable(PAYER),
|
|
229
|
+
metadata: ""
|
|
230
|
+
});
|
|
231
231
|
|
|
232
232
|
// Warp past delay.
|
|
233
233
|
vm.warp(block.timestamp + REV_DEPLOYER.CASH_OUT_DELAY() + 1);
|
|
@@ -239,14 +239,14 @@ contract TestCashOutFork is ForkTestBase {
|
|
|
239
239
|
vm.prank(PAYER);
|
|
240
240
|
jbMultiTerminal()
|
|
241
241
|
.cashOutTokensOf({
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
242
|
+
holder: PAYER,
|
|
243
|
+
projectId: delayRevnet,
|
|
244
|
+
cashOutCount: payerTokens,
|
|
245
|
+
tokenToReclaim: JBConstants.NATIVE_TOKEN,
|
|
246
|
+
minTokensReclaimed: 0,
|
|
247
|
+
beneficiary: payable(PAYER),
|
|
248
|
+
metadata: ""
|
|
249
|
+
});
|
|
250
250
|
|
|
251
251
|
assertGt(PAYER.balance, payerEthBefore, "should succeed after delay expires");
|
|
252
252
|
}
|