@rev-net/core-v6 0.0.18 → 0.0.20
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 +14 -4
- package/ARCHITECTURE.md +13 -10
- package/AUDIT_INSTRUCTIONS.md +39 -18
- package/CHANGE_LOG.md +78 -1
- package/README.md +10 -5
- package/RISKS.md +12 -11
- package/SKILLS.md +27 -12
- package/USER_JOURNEYS.md +15 -14
- package/foundry.toml +1 -1
- package/package.json +1 -1
- package/script/Deploy.s.sol +37 -4
- package/src/REVDeployer.sol +23 -305
- package/src/REVLoans.sol +24 -29
- package/src/REVOwner.sol +429 -0
- package/src/interfaces/IREVDeployer.sol +4 -10
- package/src/interfaces/IREVOwner.sol +10 -0
- package/test/REV.integrations.t.sol +12 -1
- package/test/REVAutoIssuanceFuzz.t.sol +12 -1
- package/test/REVDeployerRegressions.t.sol +15 -2
- package/test/REVInvincibility.t.sol +27 -3
- package/test/REVLifecycle.t.sol +14 -1
- package/test/REVLoans.invariants.t.sol +14 -1
- package/test/REVLoansAttacks.t.sol +14 -1
- package/test/REVLoansFeeRecovery.t.sol +14 -1
- package/test/REVLoansFindings.t.sol +14 -1
- package/test/REVLoansRegressions.t.sol +14 -1
- package/test/REVLoansSourceFeeRecovery.t.sol +14 -1
- package/test/REVLoansSourced.t.sol +14 -1
- package/test/REVLoansUnSourced.t.sol +14 -1
- package/test/TestBurnHeldTokens.t.sol +14 -1
- package/test/TestCEIPattern.t.sol +15 -1
- package/test/TestCashOutCallerValidation.t.sol +17 -4
- package/test/TestConversionDocumentation.t.sol +14 -1
- package/test/TestCrossCurrencyReclaim.t.sol +14 -1
- package/test/TestCrossSourceReallocation.t.sol +15 -1
- package/test/TestERC2771MetaTx.t.sol +14 -1
- package/test/TestEmptyBuybackSpecs.t.sol +17 -3
- package/test/TestFlashLoanSurplus.t.sol +15 -1
- package/test/TestHookArrayOOB.t.sol +16 -2
- package/test/TestLiquidationBehavior.t.sol +15 -1
- package/test/TestLoanSourceRotation.t.sol +14 -1
- package/test/TestLoansCashOutDelay.t.sol +19 -6
- package/test/TestLongTailEconomics.t.sol +14 -1
- package/test/TestLowFindings.t.sol +14 -1
- package/test/TestMixedFixes.t.sol +15 -1
- package/test/TestPermit2Signatures.t.sol +14 -1
- package/test/TestReallocationSandwich.t.sol +15 -1
- package/test/TestRevnetRegressions.t.sol +14 -1
- package/test/TestSplitWeightAdjustment.t.sol +41 -19
- package/test/TestSplitWeightE2E.t.sol +23 -2
- package/test/TestSplitWeightFork.t.sol +14 -1
- package/test/TestStageTransitionBorrowable.t.sol +15 -1
- package/test/TestSwapTerminalPermission.t.sol +15 -1
- package/test/TestUint112Overflow.t.sol +14 -1
- package/test/TestZeroRepayment.t.sol +15 -1
- package/test/audit/LoanIdOverflowGuard.t.sol +14 -1
- package/test/fork/ForkTestBase.sol +14 -1
- package/test/fork/TestPermit2PaymentFork.t.sol +4 -3
- package/test/regression/TestBurnPermissionRequired.t.sol +15 -1
- package/test/regression/TestCashOutBuybackFeeLeak.t.sol +13 -1
- package/test/regression/TestCrossRevnetLiquidation.t.sol +15 -1
- package/test/regression/TestCumulativeLoanCounter.t.sol +15 -1
- package/test/regression/TestLiquidateGapHandling.t.sol +15 -1
- package/test/regression/TestZeroPriceFeed.t.sol +14 -1
|
@@ -48,6 +48,8 @@ import {mulDiv} from "@prb/math/src/Common.sol";
|
|
|
48
48
|
import {REVInvincibilityHandler} from "./REVInvincibilityHandler.sol";
|
|
49
49
|
import {BrokenFeeTerminal} from "./helpers/MaliciousContracts.sol";
|
|
50
50
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
51
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
52
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
51
53
|
|
|
52
54
|
// =========================================================================
|
|
53
55
|
// Shared config struct
|
|
@@ -87,6 +89,8 @@ contract REVInvincibility_PropertyTests is TestBaseWorkflow {
|
|
|
87
89
|
CTPublisher PUBLISHER;
|
|
88
90
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
89
91
|
MockBuybackDataHook MOCK_BUYBACK;
|
|
92
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
93
|
+
REVOwner REV_OWNER;
|
|
90
94
|
|
|
91
95
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
92
96
|
uint256 FEE_PROJECT_ID;
|
|
@@ -247,6 +251,14 @@ contract REVInvincibility_PropertyTests is TestBaseWorkflow {
|
|
|
247
251
|
trustedForwarder: TRUSTED_FORWARDER
|
|
248
252
|
});
|
|
249
253
|
|
|
254
|
+
REV_OWNER = new REVOwner(
|
|
255
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
256
|
+
jbDirectory(),
|
|
257
|
+
FEE_PROJECT_ID,
|
|
258
|
+
SUCKER_REGISTRY,
|
|
259
|
+
address(LOANS_CONTRACT)
|
|
260
|
+
);
|
|
261
|
+
|
|
250
262
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
251
263
|
jbController(),
|
|
252
264
|
SUCKER_REGISTRY,
|
|
@@ -255,7 +267,8 @@ contract REVInvincibility_PropertyTests is TestBaseWorkflow {
|
|
|
255
267
|
PUBLISHER,
|
|
256
268
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
257
269
|
address(LOANS_CONTRACT),
|
|
258
|
-
TRUSTED_FORWARDER
|
|
270
|
+
TRUSTED_FORWARDER,
|
|
271
|
+
address(REV_OWNER)
|
|
259
272
|
);
|
|
260
273
|
|
|
261
274
|
// Deploy fee project
|
|
@@ -415,7 +428,7 @@ contract REVInvincibility_PropertyTests is TestBaseWorkflow {
|
|
|
415
428
|
|
|
416
429
|
// hasMintPermissionFor should return false for random addresses
|
|
417
430
|
address randomAddr = address(0x12345);
|
|
418
|
-
bool hasPerm =
|
|
431
|
+
bool hasPerm = REV_OWNER.hasMintPermissionFor(FEE_PROJECT_ID, currentRuleset, randomAddr);
|
|
419
432
|
assertFalse(hasPerm, "random address should not have mint permission");
|
|
420
433
|
}
|
|
421
434
|
|
|
@@ -959,6 +972,8 @@ contract REVInvincibility_Invariants is StdInvariant, TestBaseWorkflow {
|
|
|
959
972
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
960
973
|
REVDeployer REV_DEPLOYER;
|
|
961
974
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
975
|
+
REVOwner REV_OWNER;
|
|
976
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
962
977
|
JB721TiersHook EXAMPLE_HOOK;
|
|
963
978
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
964
979
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -1018,6 +1033,14 @@ contract REVInvincibility_Invariants is StdInvariant, TestBaseWorkflow {
|
|
|
1018
1033
|
trustedForwarder: TRUSTED_FORWARDER
|
|
1019
1034
|
});
|
|
1020
1035
|
|
|
1036
|
+
REV_OWNER = new REVOwner(
|
|
1037
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
1038
|
+
jbDirectory(),
|
|
1039
|
+
FEE_PROJECT_ID,
|
|
1040
|
+
SUCKER_REGISTRY,
|
|
1041
|
+
address(LOANS_CONTRACT)
|
|
1042
|
+
);
|
|
1043
|
+
|
|
1021
1044
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
1022
1045
|
jbController(),
|
|
1023
1046
|
SUCKER_REGISTRY,
|
|
@@ -1026,7 +1049,8 @@ contract REVInvincibility_Invariants is StdInvariant, TestBaseWorkflow {
|
|
|
1026
1049
|
PUBLISHER,
|
|
1027
1050
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
1028
1051
|
address(LOANS_CONTRACT),
|
|
1029
|
-
TRUSTED_FORWARDER
|
|
1052
|
+
TRUSTED_FORWARDER,
|
|
1053
|
+
address(REV_OWNER)
|
|
1030
1054
|
);
|
|
1031
1055
|
|
|
1032
1056
|
// Deploy fee project
|
package/test/REVLifecycle.t.sol
CHANGED
|
@@ -37,6 +37,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
37
37
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
38
38
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
39
39
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
40
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
41
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
40
42
|
|
|
41
43
|
/// @notice Full revnet lifecycle E2E: deploy 3-stage -> pay -> advance stages -> cash out.
|
|
42
44
|
contract REVLifecycle_Local is TestBaseWorkflow {
|
|
@@ -48,6 +50,8 @@ contract REVLifecycle_Local is TestBaseWorkflow {
|
|
|
48
50
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
49
51
|
REVDeployer REV_DEPLOYER;
|
|
50
52
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
53
|
+
REVOwner REV_OWNER;
|
|
54
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
51
55
|
JB721TiersHook EXAMPLE_HOOK;
|
|
52
56
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
53
57
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -103,6 +107,14 @@ contract REVLifecycle_Local is TestBaseWorkflow {
|
|
|
103
107
|
trustedForwarder: TRUSTED_FORWARDER
|
|
104
108
|
});
|
|
105
109
|
|
|
110
|
+
REV_OWNER = new REVOwner(
|
|
111
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
112
|
+
jbDirectory(),
|
|
113
|
+
FEE_PROJECT_ID,
|
|
114
|
+
SUCKER_REGISTRY,
|
|
115
|
+
address(LOANS_CONTRACT)
|
|
116
|
+
);
|
|
117
|
+
|
|
106
118
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
107
119
|
jbController(),
|
|
108
120
|
SUCKER_REGISTRY,
|
|
@@ -111,7 +123,8 @@ contract REVLifecycle_Local is TestBaseWorkflow {
|
|
|
111
123
|
PUBLISHER,
|
|
112
124
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
113
125
|
address(LOANS_CONTRACT),
|
|
114
|
-
TRUSTED_FORWARDER
|
|
126
|
+
TRUSTED_FORWARDER,
|
|
127
|
+
address(REV_OWNER)
|
|
115
128
|
);
|
|
116
129
|
|
|
117
130
|
vm.prank(multisig());
|
|
@@ -42,6 +42,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
42
42
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
43
43
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
44
44
|
import {JBTest} from "@bananapus/core-v6/test/helpers/JBTest.sol";
|
|
45
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
46
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
45
47
|
|
|
46
48
|
struct FeeProjectConfig {
|
|
47
49
|
REVConfig configuration;
|
|
@@ -291,6 +293,8 @@ contract InvariantREVLoansTests is StdInvariant, TestBaseWorkflow {
|
|
|
291
293
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
292
294
|
REVDeployer REV_DEPLOYER;
|
|
293
295
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
296
|
+
REVOwner REV_OWNER;
|
|
297
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
294
298
|
JB721TiersHook EXAMPLE_HOOK;
|
|
295
299
|
|
|
296
300
|
/// @notice Deploys tiered ERC-721 hooks for revnets.
|
|
@@ -545,6 +549,14 @@ contract InvariantREVLoansTests is StdInvariant, TestBaseWorkflow {
|
|
|
545
549
|
trustedForwarder: TRUSTED_FORWARDER
|
|
546
550
|
});
|
|
547
551
|
|
|
552
|
+
REV_OWNER = new REVOwner(
|
|
553
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
554
|
+
jbDirectory(),
|
|
555
|
+
FEE_PROJECT_ID,
|
|
556
|
+
SUCKER_REGISTRY,
|
|
557
|
+
address(LOANS_CONTRACT)
|
|
558
|
+
);
|
|
559
|
+
|
|
548
560
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
549
561
|
jbController(),
|
|
550
562
|
SUCKER_REGISTRY,
|
|
@@ -553,7 +565,8 @@ contract InvariantREVLoansTests is StdInvariant, TestBaseWorkflow {
|
|
|
553
565
|
PUBLISHER,
|
|
554
566
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
555
567
|
address(LOANS_CONTRACT),
|
|
556
|
-
TRUSTED_FORWARDER
|
|
568
|
+
TRUSTED_FORWARDER,
|
|
569
|
+
address(REV_OWNER)
|
|
557
570
|
);
|
|
558
571
|
|
|
559
572
|
// Approve the basic deployer to configure the project.
|
|
@@ -44,6 +44,8 @@ import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
|
44
44
|
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
45
45
|
import {JBRuleset} from "@bananapus/core-v6/src/structs/JBRuleset.sol";
|
|
46
46
|
import {JBPayHookSpecification} from "@bananapus/core-v6/src/structs/JBPayHookSpecification.sol";
|
|
47
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
48
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
47
49
|
|
|
48
50
|
/// @notice A malicious terminal that re-enters REVLoans during fee payment in _adjust().
|
|
49
51
|
/// @dev Reentrancy during pay() callback in _adjust.
|
|
@@ -202,6 +204,8 @@ contract REVLoansAttacks is TestBaseWorkflow {
|
|
|
202
204
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
203
205
|
REVDeployer REV_DEPLOYER;
|
|
204
206
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
207
|
+
REVOwner REV_OWNER;
|
|
208
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
205
209
|
JB721TiersHook EXAMPLE_HOOK;
|
|
206
210
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
207
211
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -386,6 +390,14 @@ contract REVLoansAttacks is TestBaseWorkflow {
|
|
|
386
390
|
trustedForwarder: TRUSTED_FORWARDER
|
|
387
391
|
});
|
|
388
392
|
|
|
393
|
+
REV_OWNER = new REVOwner(
|
|
394
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
395
|
+
jbDirectory(),
|
|
396
|
+
FEE_PROJECT_ID,
|
|
397
|
+
SUCKER_REGISTRY,
|
|
398
|
+
address(LOANS_CONTRACT)
|
|
399
|
+
);
|
|
400
|
+
|
|
389
401
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
390
402
|
jbController(),
|
|
391
403
|
SUCKER_REGISTRY,
|
|
@@ -394,7 +406,8 @@ contract REVLoansAttacks is TestBaseWorkflow {
|
|
|
394
406
|
PUBLISHER,
|
|
395
407
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
396
408
|
address(LOANS_CONTRACT),
|
|
397
|
-
TRUSTED_FORWARDER
|
|
409
|
+
TRUSTED_FORWARDER,
|
|
410
|
+
address(REV_OWNER)
|
|
398
411
|
);
|
|
399
412
|
|
|
400
413
|
// Deploy fee project
|
|
@@ -45,6 +45,8 @@ import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
|
45
45
|
import {JBRuleset} from "@bananapus/core-v6/src/structs/JBRuleset.sol";
|
|
46
46
|
import {JBPayHookSpecification} from "@bananapus/core-v6/src/structs/JBPayHookSpecification.sol";
|
|
47
47
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
48
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
49
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
48
50
|
|
|
49
51
|
/// @notice A terminal mock that always reverts on pay(), used to simulate fee payment failure.
|
|
50
52
|
contract RevertingFeeTerminal is ERC165, IJBPayoutTerminal {
|
|
@@ -162,6 +164,8 @@ contract REVLoansFeeRecovery is TestBaseWorkflow {
|
|
|
162
164
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
163
165
|
REVDeployer REV_DEPLOYER;
|
|
164
166
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
167
|
+
REVOwner REV_OWNER;
|
|
168
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
165
169
|
JB721TiersHook EXAMPLE_HOOK;
|
|
166
170
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
167
171
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -352,6 +356,14 @@ contract REVLoansFeeRecovery is TestBaseWorkflow {
|
|
|
352
356
|
trustedForwarder: TRUSTED_FORWARDER
|
|
353
357
|
});
|
|
354
358
|
|
|
359
|
+
REV_OWNER = new REVOwner(
|
|
360
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
361
|
+
jbDirectory(),
|
|
362
|
+
FEE_PROJECT_ID,
|
|
363
|
+
SUCKER_REGISTRY,
|
|
364
|
+
address(LOANS_CONTRACT)
|
|
365
|
+
);
|
|
366
|
+
|
|
355
367
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
356
368
|
jbController(),
|
|
357
369
|
SUCKER_REGISTRY,
|
|
@@ -360,7 +372,8 @@ contract REVLoansFeeRecovery is TestBaseWorkflow {
|
|
|
360
372
|
PUBLISHER,
|
|
361
373
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
362
374
|
address(LOANS_CONTRACT),
|
|
363
|
-
TRUSTED_FORWARDER
|
|
375
|
+
TRUSTED_FORWARDER,
|
|
376
|
+
address(REV_OWNER)
|
|
364
377
|
);
|
|
365
378
|
|
|
366
379
|
// Deploy fee project.
|
|
@@ -45,6 +45,8 @@ import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/
|
|
|
45
45
|
import {JBRuleset} from "@bananapus/core-v6/src/structs/JBRuleset.sol";
|
|
46
46
|
import {JBPayHookSpecification} from "@bananapus/core-v6/src/structs/JBPayHookSpecification.sol";
|
|
47
47
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
48
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
49
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
48
50
|
|
|
49
51
|
/// @notice A fake terminal that returns garbage accounting contexts.
|
|
50
52
|
/// Used to test unvalidated loan source terminal rejection.
|
|
@@ -160,6 +162,8 @@ contract REVLoansFindings is TestBaseWorkflow {
|
|
|
160
162
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
161
163
|
REVDeployer REV_DEPLOYER;
|
|
162
164
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
165
|
+
REVOwner REV_OWNER;
|
|
166
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
163
167
|
JB721TiersHook EXAMPLE_HOOK;
|
|
164
168
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
165
169
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -210,6 +214,14 @@ contract REVLoansFindings is TestBaseWorkflow {
|
|
|
210
214
|
trustedForwarder: TRUSTED_FORWARDER
|
|
211
215
|
});
|
|
212
216
|
|
|
217
|
+
REV_OWNER = new REVOwner(
|
|
218
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
219
|
+
jbDirectory(),
|
|
220
|
+
FEE_PROJECT_ID,
|
|
221
|
+
SUCKER_REGISTRY,
|
|
222
|
+
address(LOANS_CONTRACT)
|
|
223
|
+
);
|
|
224
|
+
|
|
213
225
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
214
226
|
jbController(),
|
|
215
227
|
SUCKER_REGISTRY,
|
|
@@ -218,7 +230,8 @@ contract REVLoansFindings is TestBaseWorkflow {
|
|
|
218
230
|
PUBLISHER,
|
|
219
231
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
220
232
|
address(LOANS_CONTRACT),
|
|
221
|
-
TRUSTED_FORWARDER
|
|
233
|
+
TRUSTED_FORWARDER,
|
|
234
|
+
address(REV_OWNER)
|
|
222
235
|
);
|
|
223
236
|
|
|
224
237
|
vm.prank(multisig());
|
|
@@ -41,6 +41,8 @@ import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
|
|
|
41
41
|
import {JBRuleset} from "@bananapus/core-v6/src/structs/JBRuleset.sol";
|
|
42
42
|
import {JBPayHookSpecification} from "@bananapus/core-v6/src/structs/JBPayHookSpecification.sol";
|
|
43
43
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
44
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
45
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
44
46
|
|
|
45
47
|
/// @notice A fake terminal that tracks whether useAllowanceOf was called.
|
|
46
48
|
/// @dev REVLoans.borrowFrom does not validate source terminal registration.
|
|
@@ -155,6 +157,8 @@ contract REVLoansRegressions is TestBaseWorkflow {
|
|
|
155
157
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
156
158
|
REVDeployer REV_DEPLOYER;
|
|
157
159
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
160
|
+
REVOwner REV_OWNER;
|
|
161
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
158
162
|
JB721TiersHook EXAMPLE_HOOK;
|
|
159
163
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
160
164
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -205,6 +209,14 @@ contract REVLoansRegressions is TestBaseWorkflow {
|
|
|
205
209
|
trustedForwarder: TRUSTED_FORWARDER
|
|
206
210
|
});
|
|
207
211
|
|
|
212
|
+
REV_OWNER = new REVOwner(
|
|
213
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
214
|
+
jbDirectory(),
|
|
215
|
+
FEE_PROJECT_ID,
|
|
216
|
+
SUCKER_REGISTRY,
|
|
217
|
+
address(LOANS_CONTRACT)
|
|
218
|
+
);
|
|
219
|
+
|
|
208
220
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
209
221
|
jbController(),
|
|
210
222
|
SUCKER_REGISTRY,
|
|
@@ -213,7 +225,8 @@ contract REVLoansRegressions is TestBaseWorkflow {
|
|
|
213
225
|
PUBLISHER,
|
|
214
226
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
215
227
|
address(LOANS_CONTRACT),
|
|
216
|
-
TRUSTED_FORWARDER
|
|
228
|
+
TRUSTED_FORWARDER,
|
|
229
|
+
address(REV_OWNER)
|
|
217
230
|
);
|
|
218
231
|
|
|
219
232
|
vm.prank(multisig());
|
|
@@ -38,6 +38,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
38
38
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
39
39
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
40
40
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
41
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
42
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
41
43
|
|
|
42
44
|
struct SourceFeeProjectConfig {
|
|
43
45
|
REVConfig configuration;
|
|
@@ -58,6 +60,8 @@ contract REVLoansSourceFeeRecovery is TestBaseWorkflow {
|
|
|
58
60
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
59
61
|
REVDeployer REV_DEPLOYER;
|
|
60
62
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
|
+
REVOwner REV_OWNER;
|
|
64
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
61
65
|
JB721TiersHook EXAMPLE_HOOK;
|
|
62
66
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
67
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -232,6 +236,14 @@ contract REVLoansSourceFeeRecovery is TestBaseWorkflow {
|
|
|
232
236
|
trustedForwarder: TRUSTED_FORWARDER
|
|
233
237
|
});
|
|
234
238
|
|
|
239
|
+
REV_OWNER = new REVOwner(
|
|
240
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
241
|
+
jbDirectory(),
|
|
242
|
+
FEE_PROJECT_ID,
|
|
243
|
+
SUCKER_REGISTRY,
|
|
244
|
+
address(LOANS_CONTRACT)
|
|
245
|
+
);
|
|
246
|
+
|
|
235
247
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
236
248
|
jbController(),
|
|
237
249
|
SUCKER_REGISTRY,
|
|
@@ -240,7 +252,8 @@ contract REVLoansSourceFeeRecovery is TestBaseWorkflow {
|
|
|
240
252
|
PUBLISHER,
|
|
241
253
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
242
254
|
address(LOANS_CONTRACT),
|
|
243
|
-
TRUSTED_FORWARDER
|
|
255
|
+
TRUSTED_FORWARDER,
|
|
256
|
+
address(REV_OWNER)
|
|
244
257
|
);
|
|
245
258
|
|
|
246
259
|
// Deploy fee project.
|
|
@@ -41,6 +41,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
41
41
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
42
42
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
43
43
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
44
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
45
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
44
46
|
|
|
45
47
|
struct FeeProjectConfig {
|
|
46
48
|
REVConfig configuration;
|
|
@@ -58,6 +60,8 @@ contract REVLoansSourcedTests is TestBaseWorkflow {
|
|
|
58
60
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
59
61
|
REVDeployer REV_DEPLOYER;
|
|
60
62
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
|
+
REVOwner REV_OWNER;
|
|
64
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
61
65
|
JB721TiersHook EXAMPLE_HOOK;
|
|
62
66
|
|
|
63
67
|
/// @notice Deploys tiered ERC-721 hooks for revnets.
|
|
@@ -331,6 +335,14 @@ contract REVLoansSourcedTests is TestBaseWorkflow {
|
|
|
331
335
|
trustedForwarder: TRUSTED_FORWARDER
|
|
332
336
|
});
|
|
333
337
|
|
|
338
|
+
REV_OWNER = new REVOwner(
|
|
339
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
340
|
+
jbDirectory(),
|
|
341
|
+
FEE_PROJECT_ID,
|
|
342
|
+
SUCKER_REGISTRY,
|
|
343
|
+
address(LOANS_CONTRACT)
|
|
344
|
+
);
|
|
345
|
+
|
|
334
346
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
335
347
|
jbController(),
|
|
336
348
|
SUCKER_REGISTRY,
|
|
@@ -339,7 +351,8 @@ contract REVLoansSourcedTests is TestBaseWorkflow {
|
|
|
339
351
|
PUBLISHER,
|
|
340
352
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
341
353
|
address(LOANS_CONTRACT),
|
|
342
|
-
TRUSTED_FORWARDER
|
|
354
|
+
TRUSTED_FORWARDER,
|
|
355
|
+
address(REV_OWNER)
|
|
343
356
|
);
|
|
344
357
|
|
|
345
358
|
// Approve the basic deployer to configure the project.
|
|
@@ -40,6 +40,8 @@ import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
|
40
40
|
import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
|
|
41
41
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
42
42
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
43
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
44
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
43
45
|
|
|
44
46
|
struct FeeProjectConfig {
|
|
45
47
|
REVConfig configuration;
|
|
@@ -57,6 +59,8 @@ contract REVLoansUnsourcedTests is TestBaseWorkflow {
|
|
|
57
59
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
58
60
|
REVDeployer REV_DEPLOYER;
|
|
59
61
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
62
|
+
REVOwner REV_OWNER;
|
|
63
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
60
64
|
JB721TiersHook EXAMPLE_HOOK;
|
|
61
65
|
|
|
62
66
|
/// @notice Deploys tiered ERC-721 hooks for revnets.
|
|
@@ -307,6 +311,14 @@ contract REVLoansUnsourcedTests is TestBaseWorkflow {
|
|
|
307
311
|
trustedForwarder: TRUSTED_FORWARDER
|
|
308
312
|
});
|
|
309
313
|
|
|
314
|
+
REV_OWNER = new REVOwner(
|
|
315
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
316
|
+
jbDirectory(),
|
|
317
|
+
FEE_PROJECT_ID,
|
|
318
|
+
SUCKER_REGISTRY,
|
|
319
|
+
address(LOANS_CONTRACT)
|
|
320
|
+
);
|
|
321
|
+
|
|
310
322
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
311
323
|
jbController(),
|
|
312
324
|
SUCKER_REGISTRY,
|
|
@@ -315,7 +327,8 @@ contract REVLoansUnsourcedTests is TestBaseWorkflow {
|
|
|
315
327
|
PUBLISHER,
|
|
316
328
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
317
329
|
address(LOANS_CONTRACT),
|
|
318
|
-
TRUSTED_FORWARDER
|
|
330
|
+
TRUSTED_FORWARDER,
|
|
331
|
+
address(REV_OWNER)
|
|
319
332
|
);
|
|
320
333
|
|
|
321
334
|
// Approve the basic deployer to configure the project.
|
|
@@ -37,6 +37,8 @@ import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
|
37
37
|
import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
|
|
38
38
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
39
39
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
40
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
41
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
40
42
|
|
|
41
43
|
struct FeeProjectConfig {
|
|
42
44
|
REVConfig configuration;
|
|
@@ -53,6 +55,8 @@ contract TestBurnHeldTokens is TestBaseWorkflow {
|
|
|
53
55
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
54
56
|
REVDeployer REV_DEPLOYER;
|
|
55
57
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
58
|
+
REVOwner REV_OWNER;
|
|
59
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
56
60
|
JB721TiersHook EXAMPLE_HOOK;
|
|
57
61
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
58
62
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -210,6 +214,14 @@ contract TestBurnHeldTokens is TestBaseWorkflow {
|
|
|
210
214
|
trustedForwarder: TRUSTED_FORWARDER
|
|
211
215
|
});
|
|
212
216
|
|
|
217
|
+
REV_OWNER = new REVOwner(
|
|
218
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
219
|
+
jbDirectory(),
|
|
220
|
+
FEE_PROJECT_ID,
|
|
221
|
+
SUCKER_REGISTRY,
|
|
222
|
+
address(LOANS_CONTRACT)
|
|
223
|
+
);
|
|
224
|
+
|
|
213
225
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
214
226
|
jbController(),
|
|
215
227
|
SUCKER_REGISTRY,
|
|
@@ -218,7 +230,8 @@ contract TestBurnHeldTokens is TestBaseWorkflow {
|
|
|
218
230
|
PUBLISHER,
|
|
219
231
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
220
232
|
address(LOANS_CONTRACT),
|
|
221
|
-
TRUSTED_FORWARDER
|
|
233
|
+
TRUSTED_FORWARDER,
|
|
234
|
+
address(REV_OWNER)
|
|
222
235
|
);
|
|
223
236
|
|
|
224
237
|
// Deploy fee project.
|
|
@@ -40,6 +40,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
40
40
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
41
41
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
42
42
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
43
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
44
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
43
45
|
|
|
44
46
|
/// @notice Contract that reenters REVLoans when it receives ETH during a borrow payout.
|
|
45
47
|
/// Records the loan state it observes during reentrancy to verify CEI correctness.
|
|
@@ -86,6 +88,8 @@ contract TestCEIPattern is TestBaseWorkflow {
|
|
|
86
88
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
87
89
|
REVDeployer REV_DEPLOYER;
|
|
88
90
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
91
|
+
REVOwner REV_OWNER;
|
|
92
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
89
93
|
JB721TiersHook EXAMPLE_HOOK;
|
|
90
94
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
91
95
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -138,6 +142,14 @@ contract TestCEIPattern is TestBaseWorkflow {
|
|
|
138
142
|
permit2: permit2(),
|
|
139
143
|
trustedForwarder: TRUSTED_FORWARDER
|
|
140
144
|
});
|
|
145
|
+
REV_OWNER = new REVOwner(
|
|
146
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
147
|
+
jbDirectory(),
|
|
148
|
+
FEE_PROJECT_ID,
|
|
149
|
+
SUCKER_REGISTRY,
|
|
150
|
+
address(LOANS_CONTRACT)
|
|
151
|
+
);
|
|
152
|
+
|
|
141
153
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
142
154
|
jbController(),
|
|
143
155
|
SUCKER_REGISTRY,
|
|
@@ -146,8 +158,10 @@ contract TestCEIPattern is TestBaseWorkflow {
|
|
|
146
158
|
PUBLISHER,
|
|
147
159
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
148
160
|
address(LOANS_CONTRACT),
|
|
149
|
-
TRUSTED_FORWARDER
|
|
161
|
+
TRUSTED_FORWARDER,
|
|
162
|
+
address(REV_OWNER)
|
|
150
163
|
);
|
|
164
|
+
|
|
151
165
|
vm.prank(multisig());
|
|
152
166
|
jbProjects().approve(address(REV_DEPLOYER), FEE_PROJECT_ID);
|
|
153
167
|
_deployFeeProject();
|
|
@@ -42,6 +42,8 @@ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStor
|
|
|
42
42
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
43
43
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
44
44
|
import {REVEmpty721Config} from "./helpers/REVEmpty721Config.sol";
|
|
45
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
46
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
45
47
|
|
|
46
48
|
struct FeeProjectConfig {
|
|
47
49
|
REVConfig configuration;
|
|
@@ -58,6 +60,8 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
58
60
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
59
61
|
REVDeployer REV_DEPLOYER;
|
|
60
62
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
|
+
REVOwner REV_OWNER;
|
|
64
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
61
65
|
JB721TiersHook EXAMPLE_HOOK;
|
|
62
66
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
63
67
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -223,6 +227,14 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
223
227
|
trustedForwarder: TRUSTED_FORWARDER
|
|
224
228
|
});
|
|
225
229
|
|
|
230
|
+
REV_OWNER = new REVOwner(
|
|
231
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
232
|
+
jbDirectory(),
|
|
233
|
+
FEE_PROJECT_ID,
|
|
234
|
+
SUCKER_REGISTRY,
|
|
235
|
+
address(LOANS_CONTRACT)
|
|
236
|
+
);
|
|
237
|
+
|
|
226
238
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
227
239
|
jbController(),
|
|
228
240
|
SUCKER_REGISTRY,
|
|
@@ -231,7 +243,8 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
231
243
|
PUBLISHER,
|
|
232
244
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
233
245
|
address(LOANS_CONTRACT),
|
|
234
|
-
TRUSTED_FORWARDER
|
|
246
|
+
TRUSTED_FORWARDER,
|
|
247
|
+
address(REV_OWNER)
|
|
235
248
|
);
|
|
236
249
|
|
|
237
250
|
// Approve the deployer to configure the fee project.
|
|
@@ -341,7 +354,7 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
341
354
|
uint256 cashOutCount,
|
|
342
355
|
uint256 totalSupply,
|
|
343
356
|
JBCashOutHookSpecification[] memory hookSpecifications
|
|
344
|
-
) =
|
|
357
|
+
) = REV_OWNER.beforeCashOutRecordedWith(context);
|
|
345
358
|
|
|
346
359
|
uint256 feeCashOutCount = context.cashOutCount * REV_DEPLOYER.FEE() / JBConstants.MAX_FEE;
|
|
347
360
|
uint256 nonFeeCashOutCount = context.cashOutCount - feeCashOutCount;
|
|
@@ -367,7 +380,7 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
367
380
|
assertEq(hookSpecifications[0].amount, 0, "Buyback sell-side spec should preserve its forwarded amount");
|
|
368
381
|
assertEq(hookSpecifications[0].metadata, buybackMetadata, "Buyback metadata should be preserved");
|
|
369
382
|
|
|
370
|
-
assertEq(address(hookSpecifications[1].hook), address(
|
|
383
|
+
assertEq(address(hookSpecifications[1].hook), address(REV_OWNER), "Second hook spec should charge fee");
|
|
371
384
|
assertEq(hookSpecifications[1].amount, feeAmount, "Fee spec amount should match the revnet fee math");
|
|
372
385
|
assertEq(
|
|
373
386
|
hookSpecifications[1].metadata,
|
|
@@ -416,7 +429,7 @@ contract TestCashOutCallerValidation is TestBaseWorkflow {
|
|
|
416
429
|
// This should NOT revert with any authorization error.
|
|
417
430
|
// The caller sends ETH which gets paid as a fee to the fee project.
|
|
418
431
|
vm.prank(RANDOM_CALLER);
|
|
419
|
-
|
|
432
|
+
REV_OWNER.afterCashOutRecordedWith{value: 1 ether}(context);
|
|
420
433
|
|
|
421
434
|
// Verify the fee project received the ETH (donation).
|
|
422
435
|
uint256 feeBalanceAfter =
|
|
@@ -37,6 +37,8 @@ import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
|
37
37
|
import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
|
|
38
38
|
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
39
39
|
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
40
|
+
import {REVOwner} from "../src/REVOwner.sol";
|
|
41
|
+
import {IREVDeployer} from "../src/interfaces/IREVDeployer.sol";
|
|
40
42
|
|
|
41
43
|
contract TestConversionDocumentation is TestBaseWorkflow {
|
|
42
44
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
@@ -47,6 +49,8 @@ contract TestConversionDocumentation is TestBaseWorkflow {
|
|
|
47
49
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
48
50
|
REVDeployer REV_DEPLOYER;
|
|
49
51
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
52
|
+
REVOwner REV_OWNER;
|
|
53
|
+
// forge-lint: disable-next-line(mixed-case-variable)
|
|
50
54
|
JB721TiersHook EXAMPLE_HOOK;
|
|
51
55
|
// forge-lint: disable-next-line(mixed-case-variable)
|
|
52
56
|
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
@@ -153,6 +157,14 @@ contract TestConversionDocumentation is TestBaseWorkflow {
|
|
|
153
157
|
trustedForwarder: TRUSTED_FORWARDER
|
|
154
158
|
});
|
|
155
159
|
|
|
160
|
+
REV_OWNER = new REVOwner(
|
|
161
|
+
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
162
|
+
jbDirectory(),
|
|
163
|
+
FEE_PROJECT_ID,
|
|
164
|
+
SUCKER_REGISTRY,
|
|
165
|
+
address(LOANS_CONTRACT)
|
|
166
|
+
);
|
|
167
|
+
|
|
156
168
|
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
157
169
|
jbController(),
|
|
158
170
|
SUCKER_REGISTRY,
|
|
@@ -161,7 +173,8 @@ contract TestConversionDocumentation is TestBaseWorkflow {
|
|
|
161
173
|
PUBLISHER,
|
|
162
174
|
IJBBuybackHookRegistry(address(MOCK_BUYBACK)),
|
|
163
175
|
address(LOANS_CONTRACT),
|
|
164
|
-
TRUSTED_FORWARDER
|
|
176
|
+
TRUSTED_FORWARDER,
|
|
177
|
+
address(REV_OWNER)
|
|
165
178
|
);
|
|
166
179
|
|
|
167
180
|
// Deploy fee project as revnet.
|