@rev-net/core-v6 0.0.1

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.
Files changed (92) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -0
  3. package/REVNET_SECURITY_CHECKLIST.md +164 -0
  4. package/SECURITY.md +68 -0
  5. package/SKILLS.md +166 -0
  6. package/deployments/revnet-core-v5/arbitrum/REVDeployer.json +2821 -0
  7. package/deployments/revnet-core-v5/arbitrum/REVLoans.json +2260 -0
  8. package/deployments/revnet-core-v5/arbitrum_sepolia/REVDeployer.json +2821 -0
  9. package/deployments/revnet-core-v5/arbitrum_sepolia/REVLoans.json +2260 -0
  10. package/deployments/revnet-core-v5/base/REVDeployer.json +2825 -0
  11. package/deployments/revnet-core-v5/base/REVLoans.json +2264 -0
  12. package/deployments/revnet-core-v5/base_sepolia/REVDeployer.json +2825 -0
  13. package/deployments/revnet-core-v5/base_sepolia/REVLoans.json +2264 -0
  14. package/deployments/revnet-core-v5/ethereum/REVDeployer.json +2825 -0
  15. package/deployments/revnet-core-v5/ethereum/REVLoans.json +2264 -0
  16. package/deployments/revnet-core-v5/optimism/REVDeployer.json +2821 -0
  17. package/deployments/revnet-core-v5/optimism/REVLoans.json +2260 -0
  18. package/deployments/revnet-core-v5/optimism_sepolia/REVDeployer.json +2825 -0
  19. package/deployments/revnet-core-v5/optimism_sepolia/REVLoans.json +2264 -0
  20. package/deployments/revnet-core-v5/sepolia/REVDeployer.json +2825 -0
  21. package/deployments/revnet-core-v5/sepolia/REVLoans.json +2264 -0
  22. package/docs/book.css +13 -0
  23. package/docs/book.toml +13 -0
  24. package/docs/solidity.min.js +74 -0
  25. package/docs/src/README.md +88 -0
  26. package/docs/src/SUMMARY.md +20 -0
  27. package/docs/src/src/README.md +7 -0
  28. package/docs/src/src/REVDeployer.sol/contract.REVDeployer.md +968 -0
  29. package/docs/src/src/REVLoans.sol/contract.REVLoans.md +1047 -0
  30. package/docs/src/src/interfaces/IREVDeployer.sol/interface.IREVDeployer.md +243 -0
  31. package/docs/src/src/interfaces/IREVLoans.sol/interface.IREVLoans.md +296 -0
  32. package/docs/src/src/interfaces/README.md +5 -0
  33. package/docs/src/src/structs/README.md +14 -0
  34. package/docs/src/src/structs/REVAutoIssuance.sol/struct.REVAutoIssuance.md +19 -0
  35. package/docs/src/src/structs/REVBuybackHookConfig.sol/struct.REVBuybackHookConfig.md +19 -0
  36. package/docs/src/src/structs/REVBuybackPoolConfig.sol/struct.REVBuybackPoolConfig.md +21 -0
  37. package/docs/src/src/structs/REVConfig.sol/struct.REVConfig.md +35 -0
  38. package/docs/src/src/structs/REVCroptopAllowedPost.sol/struct.REVCroptopAllowedPost.md +28 -0
  39. package/docs/src/src/structs/REVDeploy721TiersHookConfig.sol/struct.REVDeploy721TiersHookConfig.md +34 -0
  40. package/docs/src/src/structs/REVDescription.sol/struct.REVDescription.md +23 -0
  41. package/docs/src/src/structs/REVLoan.sol/struct.REVLoan.md +28 -0
  42. package/docs/src/src/structs/REVLoanSource.sol/struct.REVLoanSource.md +16 -0
  43. package/docs/src/src/structs/REVStageConfig.sol/struct.REVStageConfig.md +44 -0
  44. package/docs/src/src/structs/REVSuckerDeploymentConfig.sol/struct.REVSuckerDeploymentConfig.md +16 -0
  45. package/foundry.lock +11 -0
  46. package/foundry.toml +23 -0
  47. package/package.json +31 -0
  48. package/remappings.txt +1 -0
  49. package/script/Deploy.s.sol +350 -0
  50. package/script/helpers/RevnetCoreDeploymentLib.sol +72 -0
  51. package/slither-ci.config.json +10 -0
  52. package/sphinx.lock +507 -0
  53. package/src/REVDeployer.sol +1257 -0
  54. package/src/REVLoans.sol +1333 -0
  55. package/src/interfaces/IREVDeployer.sol +198 -0
  56. package/src/interfaces/IREVLoans.sol +241 -0
  57. package/src/structs/REVAutoIssuance.sol +11 -0
  58. package/src/structs/REVConfig.sol +17 -0
  59. package/src/structs/REVCroptopAllowedPost.sol +20 -0
  60. package/src/structs/REVDeploy721TiersHookConfig.sol +25 -0
  61. package/src/structs/REVDescription.sol +14 -0
  62. package/src/structs/REVLoan.sol +19 -0
  63. package/src/structs/REVLoanSource.sol +11 -0
  64. package/src/structs/REVStageConfig.sol +34 -0
  65. package/src/structs/REVSuckerDeploymentConfig.sol +11 -0
  66. package/test/REV.integrations.t.sol +420 -0
  67. package/test/REVAutoIssuanceFuzz.t.sol +276 -0
  68. package/test/REVDeployerAuditRegressions.t.sol +328 -0
  69. package/test/REVInvincibility.t.sol +1275 -0
  70. package/test/REVInvincibilityHandler.sol +357 -0
  71. package/test/REVLifecycle.t.sol +364 -0
  72. package/test/REVLoans.invariants.t.sol +642 -0
  73. package/test/REVLoansAttacks.t.sol +739 -0
  74. package/test/REVLoansAuditRegressions.t.sol +314 -0
  75. package/test/REVLoansFeeRecovery.t.sol +704 -0
  76. package/test/REVLoansSourced.t.sol +1732 -0
  77. package/test/REVLoansUnSourced.t.sol +331 -0
  78. package/test/TestPR09_ConversionDocumentation.t.sol +304 -0
  79. package/test/TestPR10_LiquidationBehavior.t.sol +340 -0
  80. package/test/TestPR11_LowFindings.t.sol +571 -0
  81. package/test/TestPR12_FlashLoanSurplus.t.sol +305 -0
  82. package/test/TestPR13_CrossSourceReallocation.t.sol +302 -0
  83. package/test/TestPR15_CashOutCallerValidation.t.sol +320 -0
  84. package/test/TestPR16_ZeroRepayment.t.sol +297 -0
  85. package/test/TestPR21_Uint112Overflow.t.sol +251 -0
  86. package/test/TestPR22_HookArrayOOB.t.sol +221 -0
  87. package/test/TestPR26_BurnHeldTokens.t.sol +331 -0
  88. package/test/TestPR27_CEIPattern.t.sol +448 -0
  89. package/test/TestPR29_SwapTerminalPermission.t.sol +206 -0
  90. package/test/TestPR32_MixedFixes.t.sol +529 -0
  91. package/test/helpers/MaliciousContracts.sol +233 -0
  92. package/test/mock/MockBuybackDataHook.sol +61 -0
@@ -0,0 +1,331 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity 0.8.23;
3
+
4
+ import "forge-std/Test.sol";
5
+ import /* {*} from */ "@bananapus/core-v6/test/helpers/TestBaseWorkflow.sol";
6
+ import /* {*} from "@bananapus/721-hook-v6/src/JB721TiersHookDeployer.sol";
7
+ import /* {*} from */ "./../src/REVDeployer.sol";
8
+ import "@croptop/core-v6/src/CTPublisher.sol";
9
+ import {MockBuybackDataHook} from "./mock/MockBuybackDataHook.sol";
10
+
11
+ import "@bananapus/core-v6/script/helpers/CoreDeploymentLib.sol";
12
+ import "@bananapus/721-hook-v6/script/helpers/Hook721DeploymentLib.sol";
13
+ import "@bananapus/suckers-v6/script/helpers/SuckerDeploymentLib.sol";
14
+ import "@croptop/core-v6/script/helpers/CroptopDeploymentLib.sol";
15
+ import "@bananapus/swap-terminal-v6/script/helpers/SwapTerminalDeploymentLib.sol";
16
+ import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
17
+ import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
18
+ import {MockPriceFeed} from "@bananapus/core-v6/test/mock/MockPriceFeed.sol";
19
+ import {MockERC20} from "@bananapus/core-v6/test/mock/MockERC20.sol";
20
+ import {REVLoans} from "../src/REVLoans.sol";
21
+ import {REVLoan} from "../src/structs/REVLoan.sol";
22
+ import {REVStageConfig, REVAutoIssuance} from "../src/structs/REVStageConfig.sol";
23
+ import {REVLoanSource} from "../src/structs/REVLoanSource.sol";
24
+ import {REVDescription} from "../src/structs/REVDescription.sol";
25
+ import {IREVLoans} from "./../src/interfaces/IREVLoans.sol";
26
+ import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
27
+ import {JBSuckerRegistry} from "@bananapus/suckers-v6/src/JBSuckerRegistry.sol";
28
+ import {JB721TiersHookDeployer} from "@bananapus/721-hook-v6/src/JB721TiersHookDeployer.sol";
29
+ import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
30
+ import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
31
+ import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
32
+ import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
33
+
34
+ struct FeeProjectConfig {
35
+ REVConfig configuration;
36
+ JBTerminalConfig[] terminalConfigurations;
37
+ REVSuckerDeploymentConfig suckerDeploymentConfiguration;
38
+ }
39
+
40
+ contract TestPR26_BurnHeldTokens is TestBaseWorkflow, JBTest {
41
+ bytes32 REV_DEPLOYER_SALT = "REVDeployer";
42
+ bytes32 ERC20_SALT = "REV_TOKEN";
43
+
44
+ REVDeployer REV_DEPLOYER;
45
+ JB721TiersHook EXAMPLE_HOOK;
46
+ IJB721TiersHookDeployer HOOK_DEPLOYER;
47
+ IJB721TiersHookStore HOOK_STORE;
48
+ IJBAddressRegistry ADDRESS_REGISTRY;
49
+ IREVLoans LOANS_CONTRACT;
50
+ MockERC20 TOKEN;
51
+ IJBSuckerRegistry SUCKER_REGISTRY;
52
+ CTPublisher PUBLISHER;
53
+ MockBuybackDataHook MOCK_BUYBACK;
54
+
55
+ uint256 FEE_PROJECT_ID;
56
+ uint256 REVNET_ID;
57
+
58
+ address USER = makeAddr("user");
59
+ address RANDOM_CALLER = makeAddr("randomCaller");
60
+
61
+ address private constant TRUSTED_FORWARDER = 0xB2b5841DBeF766d4b521221732F9B618fCf34A87;
62
+
63
+ function getFeeProjectConfig() internal view returns (FeeProjectConfig memory) {
64
+ uint8 decimals = 18;
65
+ uint256 decimalMultiplier = 10 ** decimals;
66
+
67
+ JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
68
+ accountingContextsToAccept[0] = JBAccountingContext({
69
+ token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
70
+ });
71
+
72
+ JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](1);
73
+ terminalConfigurations[0] =
74
+ JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: accountingContextsToAccept});
75
+
76
+ REVStageConfig[] memory stageConfigurations = new REVStageConfig[](1);
77
+ JBSplit[] memory splits = new JBSplit[](1);
78
+ splits[0].beneficiary = payable(multisig());
79
+ splits[0].percent = JBConstants.SPLITS_TOTAL_PERCENT; // 100% to avoid held tokens on fee project
80
+
81
+ stageConfigurations[0] = REVStageConfig({
82
+ startsAtOrAfter: uint40(block.timestamp),
83
+ autoIssuances: new REVAutoIssuance[](0),
84
+ splitPercent: 2000,
85
+ splits: splits,
86
+ initialIssuance: uint112(1000 * decimalMultiplier),
87
+ issuanceCutFrequency: 90 days,
88
+ issuanceCutPercent: JBConstants.MAX_WEIGHT_CUT_PERCENT / 2,
89
+ cashOutTaxRate: 6000,
90
+ extraMetadata: 0
91
+ });
92
+
93
+ REVConfig memory revnetConfiguration = REVConfig({
94
+ description: REVDescription("Revnet", "$REV", "ipfs://test", ERC20_SALT),
95
+ baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
96
+ splitOperator: multisig(),
97
+ stageConfigurations: stageConfigurations
98
+ });
99
+
100
+ return FeeProjectConfig({
101
+ configuration: revnetConfiguration,
102
+ terminalConfigurations: terminalConfigurations,
103
+ suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
104
+ deployerConfigurations: new JBSuckerDeployerConfig[](0), salt: keccak256(abi.encodePacked("REV"))
105
+ })
106
+ });
107
+ }
108
+
109
+ /// @notice Deploy a revnet with splits that don't sum to 100%.
110
+ /// The split covers 50% of reserved tokens; the remaining 50% goes to project owner (REVDeployer).
111
+ function _deployRevnetWithPartialSplits() internal returns (uint256 revnetId) {
112
+ uint8 decimals = 18;
113
+ uint256 decimalMultiplier = 10 ** decimals;
114
+
115
+ JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
116
+ accountingContextsToAccept[0] = JBAccountingContext({
117
+ token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
118
+ });
119
+
120
+ JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](1);
121
+ terminalConfigurations[0] =
122
+ JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: accountingContextsToAccept});
123
+
124
+ REVStageConfig[] memory stageConfigurations = new REVStageConfig[](1);
125
+
126
+ // Splits only cover 50% of reserved tokens — the other 50% goes to REVDeployer.
127
+ JBSplit[] memory splits = new JBSplit[](1);
128
+ splits[0].beneficiary = payable(multisig());
129
+ splits[0].percent = uint32(JBConstants.SPLITS_TOTAL_PERCENT / 2); // 50%
130
+
131
+ stageConfigurations[0] = REVStageConfig({
132
+ startsAtOrAfter: uint40(block.timestamp),
133
+ autoIssuances: new REVAutoIssuance[](0),
134
+ splitPercent: 2000, // 20% reserved
135
+ splits: splits,
136
+ initialIssuance: uint112(1000 * decimalMultiplier),
137
+ issuanceCutFrequency: 0,
138
+ issuanceCutPercent: 0,
139
+ cashOutTaxRate: 3000,
140
+ extraMetadata: 0
141
+ });
142
+
143
+ REVConfig memory revnetConfiguration = REVConfig({
144
+ description: REVDescription("Partial", "$PRT", "ipfs://test", "PRT_TOKEN"),
145
+ baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
146
+ splitOperator: multisig(),
147
+ stageConfigurations: stageConfigurations
148
+ });
149
+
150
+ revnetId = REV_DEPLOYER.deployFor({
151
+ revnetId: 0,
152
+ configuration: revnetConfiguration,
153
+ terminalConfigurations: terminalConfigurations,
154
+ suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
155
+ deployerConfigurations: new JBSuckerDeployerConfig[](0), salt: keccak256(abi.encodePacked("PRT"))
156
+ })
157
+ });
158
+ }
159
+
160
+ function setUp() public override {
161
+ super.setUp();
162
+
163
+ FEE_PROJECT_ID = jbProjects().createFor(multisig());
164
+ SUCKER_REGISTRY = new JBSuckerRegistry(jbDirectory(), jbPermissions(), multisig(), address(0));
165
+ HOOK_STORE = new JB721TiersHookStore();
166
+ EXAMPLE_HOOK = new JB721TiersHook(jbDirectory(), jbPermissions(), jbRulesets(), HOOK_STORE, multisig());
167
+ ADDRESS_REGISTRY = new JBAddressRegistry();
168
+ HOOK_DEPLOYER = new JB721TiersHookDeployer(EXAMPLE_HOOK, HOOK_STORE, ADDRESS_REGISTRY, multisig());
169
+ PUBLISHER = new CTPublisher(jbDirectory(), jbPermissions(), FEE_PROJECT_ID, multisig());
170
+ MOCK_BUYBACK = new MockBuybackDataHook();
171
+ TOKEN = new MockERC20("1/2 ETH", "1/2");
172
+
173
+ LOANS_CONTRACT = new REVLoans({
174
+ controller: jbController(),
175
+ projects: jbProjects(),
176
+ revId: FEE_PROJECT_ID,
177
+ owner: address(this),
178
+ permit2: permit2(),
179
+ trustedForwarder: TRUSTED_FORWARDER
180
+ });
181
+
182
+ REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
183
+ jbController(),
184
+ SUCKER_REGISTRY,
185
+ FEE_PROJECT_ID,
186
+ HOOK_DEPLOYER,
187
+ PUBLISHER,
188
+ IJBRulesetDataHook(address(MOCK_BUYBACK)),
189
+ address(LOANS_CONTRACT),
190
+ TRUSTED_FORWARDER
191
+ );
192
+
193
+ // Deploy fee project.
194
+ vm.prank(multisig());
195
+ jbProjects().approve(address(REV_DEPLOYER), FEE_PROJECT_ID);
196
+
197
+ FeeProjectConfig memory feeProjectConfig = getFeeProjectConfig();
198
+ vm.prank(multisig());
199
+ REV_DEPLOYER.deployFor({
200
+ revnetId: FEE_PROJECT_ID,
201
+ configuration: feeProjectConfig.configuration,
202
+ terminalConfigurations: feeProjectConfig.terminalConfigurations,
203
+ suckerDeploymentConfiguration: feeProjectConfig.suckerDeploymentConfiguration
204
+ });
205
+
206
+ // Deploy revnet with partial splits.
207
+ REVNET_ID = _deployRevnetWithPartialSplits();
208
+
209
+ vm.deal(USER, 100 ether);
210
+ }
211
+
212
+ /// @notice Helper: pay into revnet and distribute reserved tokens to get tokens held by REVDeployer.
213
+ function _payAndDistribute() internal {
214
+ // Pay ETH into revnet to create surplus and generate reserved tokens.
215
+ vm.prank(USER);
216
+ jbMultiTerminal().pay{value: 10 ether}(REVNET_ID, JBConstants.NATIVE_TOKEN, 10 ether, USER, 0, "", "");
217
+
218
+ // Distribute reserved tokens. Since splits only cover 50%, the other 50% goes to REVDeployer.
219
+ jbController().sendReservedTokensToSplitsOf(REVNET_ID);
220
+ }
221
+
222
+ /// @notice Burn held tokens succeeds and reduces REVDeployer balance to 0.
223
+ function test_burnHeldTokens_succeeds() public {
224
+ _payAndDistribute();
225
+
226
+ // Verify REVDeployer holds tokens.
227
+ uint256 deployerBalance = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), REVNET_ID);
228
+ assertGt(deployerBalance, 0, "REVDeployer should hold tokens after reserved distribution");
229
+
230
+ // Burn held tokens.
231
+ REV_DEPLOYER.burnHeldTokensOf(REVNET_ID);
232
+
233
+ // Verify balance is now 0.
234
+ uint256 deployerBalanceAfter = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), REVNET_ID);
235
+ assertEq(deployerBalanceAfter, 0, "REVDeployer balance should be 0 after burn");
236
+ }
237
+
238
+ /// @notice Burn held tokens reduces total supply.
239
+ function test_burnHeldTokens_reducesTotalSupply() public {
240
+ _payAndDistribute();
241
+
242
+ // Record total supply before burn.
243
+ uint256 totalSupplyBefore = jbController().totalTokenSupplyWithReservedTokensOf(REVNET_ID);
244
+
245
+ uint256 deployerBalance = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), REVNET_ID);
246
+ assertGt(deployerBalance, 0, "REVDeployer should hold tokens");
247
+
248
+ // Burn held tokens.
249
+ REV_DEPLOYER.burnHeldTokensOf(REVNET_ID);
250
+
251
+ // Record total supply after burn.
252
+ uint256 totalSupplyAfter = jbController().totalTokenSupplyWithReservedTokensOf(REVNET_ID);
253
+
254
+ assertLt(totalSupplyAfter, totalSupplyBefore, "Total supply should decrease after burn");
255
+ assertEq(
256
+ totalSupplyBefore - totalSupplyAfter, deployerBalance, "Total supply should decrease by the burned amount"
257
+ );
258
+ }
259
+
260
+ /// @notice Burn held tokens reverts with NothingToBurn when balance is 0.
261
+ function test_burnHeldTokens_zeroBalance_reverts() public {
262
+ // Deploy a revnet with 100% splits so REVDeployer gets nothing.
263
+ uint8 decimals = 18;
264
+ uint256 decimalMultiplier = 10 ** decimals;
265
+
266
+ JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
267
+ accountingContextsToAccept[0] = JBAccountingContext({
268
+ token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
269
+ });
270
+
271
+ JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](1);
272
+ terminalConfigurations[0] =
273
+ JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: accountingContextsToAccept});
274
+
275
+ JBSplit[] memory splits = new JBSplit[](1);
276
+ splits[0].beneficiary = payable(multisig());
277
+ splits[0].percent = uint32(JBConstants.SPLITS_TOTAL_PERCENT); // 100%
278
+
279
+ REVStageConfig[] memory stageConfigurations = new REVStageConfig[](1);
280
+ stageConfigurations[0] = REVStageConfig({
281
+ startsAtOrAfter: uint40(block.timestamp),
282
+ autoIssuances: new REVAutoIssuance[](0),
283
+ splitPercent: 2000,
284
+ splits: splits,
285
+ initialIssuance: uint112(1000 * decimalMultiplier),
286
+ issuanceCutFrequency: 0,
287
+ issuanceCutPercent: 0,
288
+ cashOutTaxRate: 3000,
289
+ extraMetadata: 0
290
+ });
291
+
292
+ uint256 fullSplitRevnetId = REV_DEPLOYER.deployFor({
293
+ revnetId: 0,
294
+ configuration: REVConfig({
295
+ description: REVDescription("Full", "$FUL", "ipfs://test", "FUL_TOKEN"),
296
+ baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
297
+ splitOperator: multisig(),
298
+ stageConfigurations: stageConfigurations
299
+ }),
300
+ terminalConfigurations: terminalConfigurations,
301
+ suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
302
+ deployerConfigurations: new JBSuckerDeployerConfig[](0), salt: keccak256(abi.encodePacked("FUL"))
303
+ })
304
+ });
305
+
306
+ // REVDeployer should have no tokens for this revnet.
307
+ uint256 balance = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), fullSplitRevnetId);
308
+ assertEq(balance, 0, "REVDeployer should have 0 balance");
309
+
310
+ // Should revert with NothingToBurn.
311
+ vm.expectRevert(abi.encodeWithSignature("REVDeployer_NothingToBurn()"));
312
+ REV_DEPLOYER.burnHeldTokensOf(fullSplitRevnetId);
313
+ }
314
+
315
+ /// @notice Anyone can call burnHeldTokensOf — it has no access control.
316
+ function test_burnHeldTokens_anyoneCanCall() public {
317
+ _payAndDistribute();
318
+
319
+ // Verify REVDeployer holds tokens.
320
+ uint256 deployerBalance = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), REVNET_ID);
321
+ assertGt(deployerBalance, 0, "REVDeployer should hold tokens");
322
+
323
+ // A random caller (not owner, not multisig) can call burnHeldTokensOf.
324
+ vm.prank(RANDOM_CALLER);
325
+ REV_DEPLOYER.burnHeldTokensOf(REVNET_ID);
326
+
327
+ // Verify tokens were burned.
328
+ uint256 deployerBalanceAfter = jbController().TOKENS().totalBalanceOf(address(REV_DEPLOYER), REVNET_ID);
329
+ assertEq(deployerBalanceAfter, 0, "Tokens should be burned regardless of caller");
330
+ }
331
+ }