@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.
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/REVNET_SECURITY_CHECKLIST.md +164 -0
- package/SECURITY.md +68 -0
- package/SKILLS.md +166 -0
- package/deployments/revnet-core-v5/arbitrum/REVDeployer.json +2821 -0
- package/deployments/revnet-core-v5/arbitrum/REVLoans.json +2260 -0
- package/deployments/revnet-core-v5/arbitrum_sepolia/REVDeployer.json +2821 -0
- package/deployments/revnet-core-v5/arbitrum_sepolia/REVLoans.json +2260 -0
- package/deployments/revnet-core-v5/base/REVDeployer.json +2825 -0
- package/deployments/revnet-core-v5/base/REVLoans.json +2264 -0
- package/deployments/revnet-core-v5/base_sepolia/REVDeployer.json +2825 -0
- package/deployments/revnet-core-v5/base_sepolia/REVLoans.json +2264 -0
- package/deployments/revnet-core-v5/ethereum/REVDeployer.json +2825 -0
- package/deployments/revnet-core-v5/ethereum/REVLoans.json +2264 -0
- package/deployments/revnet-core-v5/optimism/REVDeployer.json +2821 -0
- package/deployments/revnet-core-v5/optimism/REVLoans.json +2260 -0
- package/deployments/revnet-core-v5/optimism_sepolia/REVDeployer.json +2825 -0
- package/deployments/revnet-core-v5/optimism_sepolia/REVLoans.json +2264 -0
- package/deployments/revnet-core-v5/sepolia/REVDeployer.json +2825 -0
- package/deployments/revnet-core-v5/sepolia/REVLoans.json +2264 -0
- package/docs/book.css +13 -0
- package/docs/book.toml +13 -0
- package/docs/solidity.min.js +74 -0
- package/docs/src/README.md +88 -0
- package/docs/src/SUMMARY.md +20 -0
- package/docs/src/src/README.md +7 -0
- package/docs/src/src/REVDeployer.sol/contract.REVDeployer.md +968 -0
- package/docs/src/src/REVLoans.sol/contract.REVLoans.md +1047 -0
- package/docs/src/src/interfaces/IREVDeployer.sol/interface.IREVDeployer.md +243 -0
- package/docs/src/src/interfaces/IREVLoans.sol/interface.IREVLoans.md +296 -0
- package/docs/src/src/interfaces/README.md +5 -0
- package/docs/src/src/structs/README.md +14 -0
- package/docs/src/src/structs/REVAutoIssuance.sol/struct.REVAutoIssuance.md +19 -0
- package/docs/src/src/structs/REVBuybackHookConfig.sol/struct.REVBuybackHookConfig.md +19 -0
- package/docs/src/src/structs/REVBuybackPoolConfig.sol/struct.REVBuybackPoolConfig.md +21 -0
- package/docs/src/src/structs/REVConfig.sol/struct.REVConfig.md +35 -0
- package/docs/src/src/structs/REVCroptopAllowedPost.sol/struct.REVCroptopAllowedPost.md +28 -0
- package/docs/src/src/structs/REVDeploy721TiersHookConfig.sol/struct.REVDeploy721TiersHookConfig.md +34 -0
- package/docs/src/src/structs/REVDescription.sol/struct.REVDescription.md +23 -0
- package/docs/src/src/structs/REVLoan.sol/struct.REVLoan.md +28 -0
- package/docs/src/src/structs/REVLoanSource.sol/struct.REVLoanSource.md +16 -0
- package/docs/src/src/structs/REVStageConfig.sol/struct.REVStageConfig.md +44 -0
- package/docs/src/src/structs/REVSuckerDeploymentConfig.sol/struct.REVSuckerDeploymentConfig.md +16 -0
- package/foundry.lock +11 -0
- package/foundry.toml +23 -0
- package/package.json +31 -0
- package/remappings.txt +1 -0
- package/script/Deploy.s.sol +350 -0
- package/script/helpers/RevnetCoreDeploymentLib.sol +72 -0
- package/slither-ci.config.json +10 -0
- package/sphinx.lock +507 -0
- package/src/REVDeployer.sol +1257 -0
- package/src/REVLoans.sol +1333 -0
- package/src/interfaces/IREVDeployer.sol +198 -0
- package/src/interfaces/IREVLoans.sol +241 -0
- package/src/structs/REVAutoIssuance.sol +11 -0
- package/src/structs/REVConfig.sol +17 -0
- package/src/structs/REVCroptopAllowedPost.sol +20 -0
- package/src/structs/REVDeploy721TiersHookConfig.sol +25 -0
- package/src/structs/REVDescription.sol +14 -0
- package/src/structs/REVLoan.sol +19 -0
- package/src/structs/REVLoanSource.sol +11 -0
- package/src/structs/REVStageConfig.sol +34 -0
- package/src/structs/REVSuckerDeploymentConfig.sol +11 -0
- package/test/REV.integrations.t.sol +420 -0
- package/test/REVAutoIssuanceFuzz.t.sol +276 -0
- package/test/REVDeployerAuditRegressions.t.sol +328 -0
- package/test/REVInvincibility.t.sol +1275 -0
- package/test/REVInvincibilityHandler.sol +357 -0
- package/test/REVLifecycle.t.sol +364 -0
- package/test/REVLoans.invariants.t.sol +642 -0
- package/test/REVLoansAttacks.t.sol +739 -0
- package/test/REVLoansAuditRegressions.t.sol +314 -0
- package/test/REVLoansFeeRecovery.t.sol +704 -0
- package/test/REVLoansSourced.t.sol +1732 -0
- package/test/REVLoansUnSourced.t.sol +331 -0
- package/test/TestPR09_ConversionDocumentation.t.sol +304 -0
- package/test/TestPR10_LiquidationBehavior.t.sol +340 -0
- package/test/TestPR11_LowFindings.t.sol +571 -0
- package/test/TestPR12_FlashLoanSurplus.t.sol +305 -0
- package/test/TestPR13_CrossSourceReallocation.t.sol +302 -0
- package/test/TestPR15_CashOutCallerValidation.t.sol +320 -0
- package/test/TestPR16_ZeroRepayment.t.sol +297 -0
- package/test/TestPR21_Uint112Overflow.t.sol +251 -0
- package/test/TestPR22_HookArrayOOB.t.sol +221 -0
- package/test/TestPR26_BurnHeldTokens.t.sol +331 -0
- package/test/TestPR27_CEIPattern.t.sol +448 -0
- package/test/TestPR29_SwapTerminalPermission.t.sol +206 -0
- package/test/TestPR32_MixedFixes.t.sol +529 -0
- package/test/helpers/MaliciousContracts.sol +233 -0
- package/test/mock/MockBuybackDataHook.sol +61 -0
|
@@ -0,0 +1,276 @@
|
|
|
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
|
+
|
|
17
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
18
|
+
import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
|
|
19
|
+
import {REVStageConfig, REVAutoIssuance} from "../src/structs/REVStageConfig.sol";
|
|
20
|
+
import {REVDescription} from "../src/structs/REVDescription.sol";
|
|
21
|
+
import {IREVLoans} from "./../src/interfaces/IREVLoans.sol";
|
|
22
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
23
|
+
import {JBSuckerRegistry} from "@bananapus/suckers-v6/src/JBSuckerRegistry.sol";
|
|
24
|
+
import {JB721TiersHookDeployer} from "@bananapus/721-hook-v6/src/JB721TiersHookDeployer.sol";
|
|
25
|
+
import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
26
|
+
import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
|
|
27
|
+
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
28
|
+
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
29
|
+
|
|
30
|
+
/// @notice Fuzz tests for REVDeployer multi-stage auto-issuance.
|
|
31
|
+
/// Tests stage ID computation consistency and multi-stage claiming behavior.
|
|
32
|
+
/// Related to H-5: stage IDs use block.timestamp + i which may mismatch actual ruleset IDs.
|
|
33
|
+
contract REVAutoIssuanceFuzz_Local is TestBaseWorkflow, JBTest {
|
|
34
|
+
bytes32 REV_DEPLOYER_SALT = "REVDeployer";
|
|
35
|
+
|
|
36
|
+
REVDeployer REV_DEPLOYER;
|
|
37
|
+
JB721TiersHook EXAMPLE_HOOK;
|
|
38
|
+
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
39
|
+
IJB721TiersHookStore HOOK_STORE;
|
|
40
|
+
IJBAddressRegistry ADDRESS_REGISTRY;
|
|
41
|
+
IJBSuckerRegistry SUCKER_REGISTRY;
|
|
42
|
+
CTPublisher PUBLISHER;
|
|
43
|
+
MockBuybackDataHook MOCK_BUYBACK;
|
|
44
|
+
|
|
45
|
+
uint256 FEE_PROJECT_ID;
|
|
46
|
+
uint256 decimals = 18;
|
|
47
|
+
uint256 decimalMultiplier = 10 ** decimals;
|
|
48
|
+
|
|
49
|
+
address private constant TRUSTED_FORWARDER = 0xB2b5841DBeF766d4b521221732F9B618fCf34A87;
|
|
50
|
+
|
|
51
|
+
function setUp() public override {
|
|
52
|
+
super.setUp();
|
|
53
|
+
|
|
54
|
+
FEE_PROJECT_ID = jbProjects().createFor(multisig());
|
|
55
|
+
|
|
56
|
+
SUCKER_REGISTRY = new JBSuckerRegistry(jbDirectory(), jbPermissions(), multisig(), address(0));
|
|
57
|
+
HOOK_STORE = new JB721TiersHookStore();
|
|
58
|
+
EXAMPLE_HOOK = new JB721TiersHook(jbDirectory(), jbPermissions(), jbRulesets(), HOOK_STORE, multisig());
|
|
59
|
+
ADDRESS_REGISTRY = new JBAddressRegistry();
|
|
60
|
+
HOOK_DEPLOYER = new JB721TiersHookDeployer(EXAMPLE_HOOK, HOOK_STORE, ADDRESS_REGISTRY, multisig());
|
|
61
|
+
PUBLISHER = new CTPublisher(jbDirectory(), jbPermissions(), FEE_PROJECT_ID, multisig());
|
|
62
|
+
MOCK_BUYBACK = new MockBuybackDataHook();
|
|
63
|
+
|
|
64
|
+
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
65
|
+
jbController(),
|
|
66
|
+
SUCKER_REGISTRY,
|
|
67
|
+
FEE_PROJECT_ID,
|
|
68
|
+
HOOK_DEPLOYER,
|
|
69
|
+
PUBLISHER,
|
|
70
|
+
IJBRulesetDataHook(address(MOCK_BUYBACK)),
|
|
71
|
+
makeAddr("loans"),
|
|
72
|
+
TRUSTED_FORWARDER
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
vm.prank(multisig());
|
|
76
|
+
jbProjects().approve(address(REV_DEPLOYER), FEE_PROJECT_ID);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/// @dev Deploy a revnet with N stages, each with auto-issuance.
|
|
80
|
+
function _deployMultiStageRevnet(uint256 numStages) internal returns (uint256 revnetId, uint256[] memory stageIds) {
|
|
81
|
+
require(numStages >= 1 && numStages <= 5, "1-5 stages");
|
|
82
|
+
|
|
83
|
+
JBAccountingContext[] memory tokensToAccept = new JBAccountingContext[](1);
|
|
84
|
+
tokensToAccept[0] = JBAccountingContext({
|
|
85
|
+
token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
JBTerminalConfig[] memory terminalConfigs = new JBTerminalConfig[](1);
|
|
89
|
+
terminalConfigs[0] = JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: tokensToAccept});
|
|
90
|
+
|
|
91
|
+
REVStageConfig[] memory stages = new REVStageConfig[](numStages);
|
|
92
|
+
stageIds = new uint256[](numStages);
|
|
93
|
+
|
|
94
|
+
for (uint256 i; i < numStages; i++) {
|
|
95
|
+
REVAutoIssuance[] memory autoIssuances = new REVAutoIssuance[](1);
|
|
96
|
+
autoIssuances[0] = REVAutoIssuance({
|
|
97
|
+
chainId: uint32(block.chainid),
|
|
98
|
+
count: uint104((10_000 + i * 1000) * decimalMultiplier),
|
|
99
|
+
beneficiary: multisig()
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
JBSplit[] memory splits = new JBSplit[](1);
|
|
103
|
+
splits[0].beneficiary = payable(multisig());
|
|
104
|
+
splits[0].percent = 10_000;
|
|
105
|
+
|
|
106
|
+
uint40 startsAt;
|
|
107
|
+
if (i == 0) {
|
|
108
|
+
startsAt = uint40(block.timestamp);
|
|
109
|
+
} else {
|
|
110
|
+
startsAt = uint40(stages[i - 1].startsAtOrAfter + 180 days);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
stages[i] = REVStageConfig({
|
|
114
|
+
startsAtOrAfter: startsAt,
|
|
115
|
+
autoIssuances: autoIssuances,
|
|
116
|
+
splitPercent: 2000,
|
|
117
|
+
splits: splits,
|
|
118
|
+
initialIssuance: uint112(1000 * decimalMultiplier),
|
|
119
|
+
issuanceCutFrequency: 90 days,
|
|
120
|
+
issuanceCutPercent: JBConstants.MAX_WEIGHT_CUT_PERCENT / 2,
|
|
121
|
+
cashOutTaxRate: 6000,
|
|
122
|
+
extraMetadata: 0
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
// Stage IDs are stored as block.timestamp + i.
|
|
126
|
+
stageIds[i] = block.timestamp + i;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
REVConfig memory config = REVConfig({
|
|
130
|
+
description: REVDescription("TestRevnet", "TREV", "ipfs://test", bytes32(uint256(numStages))),
|
|
131
|
+
baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
|
|
132
|
+
splitOperator: multisig(),
|
|
133
|
+
stageConfigurations: stages
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
vm.prank(multisig());
|
|
137
|
+
revnetId = REV_DEPLOYER.deployFor({
|
|
138
|
+
revnetId: 0,
|
|
139
|
+
configuration: config,
|
|
140
|
+
terminalConfigurations: terminalConfigs,
|
|
141
|
+
suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
|
|
142
|
+
deployerConfigurations: new JBSuckerDeployerConfig[](0),
|
|
143
|
+
salt: keccak256(abi.encodePacked("AUTOISSUE", numStages))
|
|
144
|
+
})
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// ───────────────── Stage ID computation
|
|
149
|
+
// ─────────────────────
|
|
150
|
+
|
|
151
|
+
/// @notice Verify all auto-issuance storage keys match block.timestamp + i for 3 stages.
|
|
152
|
+
function test_stageIdComputation_3stages() external {
|
|
153
|
+
(uint256 revnetId, uint256[] memory stageIds) = _deployMultiStageRevnet(3);
|
|
154
|
+
|
|
155
|
+
// Verify storage keys.
|
|
156
|
+
for (uint256 i; i < 3; i++) {
|
|
157
|
+
uint256 storedAmount = REV_DEPLOYER.amountToAutoIssue(revnetId, stageIds[i], multisig());
|
|
158
|
+
uint256 expectedAmount = (10_000 + i * 1000) * decimalMultiplier;
|
|
159
|
+
assertEq(storedAmount, expectedAmount, string.concat("Stage ", vm.toString(i), " storage mismatch"));
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
// ───────────────── Multi-stage claiming
|
|
164
|
+
// ─────────────────────
|
|
165
|
+
|
|
166
|
+
/// @notice Deploy 3-stage revnet, advance time, claim auto-issuance from each stage.
|
|
167
|
+
function test_multiStage_allStagesClaimable() external {
|
|
168
|
+
(uint256 revnetId, uint256[] memory stageIds) = _deployMultiStageRevnet(3);
|
|
169
|
+
|
|
170
|
+
// Stage 0 starts at block.timestamp — immediately claimable.
|
|
171
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[0], multisig());
|
|
172
|
+
|
|
173
|
+
uint256 stage0Amount = (10_000) * decimalMultiplier;
|
|
174
|
+
assertEq(
|
|
175
|
+
IJBToken(jbTokens().tokenOf(revnetId)).balanceOf(multisig()), stage0Amount, "Stage 0 auto-issuance claimed"
|
|
176
|
+
);
|
|
177
|
+
|
|
178
|
+
// Stage 1 starts at block.timestamp + 180 days.
|
|
179
|
+
vm.warp(block.timestamp + 180 days);
|
|
180
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[1], multisig());
|
|
181
|
+
|
|
182
|
+
uint256 stage1Amount = (11_000) * decimalMultiplier;
|
|
183
|
+
assertEq(
|
|
184
|
+
IJBToken(jbTokens().tokenOf(revnetId)).balanceOf(multisig()),
|
|
185
|
+
stage0Amount + stage1Amount,
|
|
186
|
+
"Stage 1 auto-issuance claimed"
|
|
187
|
+
);
|
|
188
|
+
|
|
189
|
+
// Stage 2 starts at block.timestamp + 360 days.
|
|
190
|
+
vm.warp(block.timestamp + 180 days);
|
|
191
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[2], multisig());
|
|
192
|
+
|
|
193
|
+
uint256 stage2Amount = (12_000) * decimalMultiplier;
|
|
194
|
+
assertEq(
|
|
195
|
+
IJBToken(jbTokens().tokenOf(revnetId)).balanceOf(multisig()),
|
|
196
|
+
stage0Amount + stage1Amount + stage2Amount,
|
|
197
|
+
"Stage 2 auto-issuance claimed"
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ───────────────── Wrong stageId reverts
|
|
202
|
+
// ─────────────────────
|
|
203
|
+
|
|
204
|
+
/// @notice Calling autoIssueFor with wrong stageId reverts with NothingToAutoIssue.
|
|
205
|
+
function test_stageIdMismatch_nothingToAutoIssue() external {
|
|
206
|
+
(uint256 revnetId,) = _deployMultiStageRevnet(1);
|
|
207
|
+
|
|
208
|
+
// Use a wrong stageId.
|
|
209
|
+
uint256 wrongStageId = block.timestamp + 999;
|
|
210
|
+
|
|
211
|
+
vm.expectRevert(REVDeployer.REVDeployer_NothingToAutoIssue.selector);
|
|
212
|
+
REV_DEPLOYER.autoIssueFor(revnetId, wrongStageId, multisig());
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// ───────────────── Double claim prevented
|
|
216
|
+
// ─────────────────────
|
|
217
|
+
|
|
218
|
+
/// @notice Claiming once zeroes storage; second claim reverts.
|
|
219
|
+
function test_autoIssue_doubleClaimPrevented() external {
|
|
220
|
+
(uint256 revnetId, uint256[] memory stageIds) = _deployMultiStageRevnet(1);
|
|
221
|
+
|
|
222
|
+
// First claim succeeds.
|
|
223
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[0], multisig());
|
|
224
|
+
|
|
225
|
+
// Storage should be zeroed.
|
|
226
|
+
assertEq(
|
|
227
|
+
REV_DEPLOYER.amountToAutoIssue(revnetId, stageIds[0], multisig()), 0, "Storage should be zeroed after claim"
|
|
228
|
+
);
|
|
229
|
+
|
|
230
|
+
// Second claim reverts.
|
|
231
|
+
vm.expectRevert(REVDeployer.REVDeployer_NothingToAutoIssue.selector);
|
|
232
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[0], multisig());
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
// ───────────────── Stage not started
|
|
236
|
+
// ─────────────────────
|
|
237
|
+
|
|
238
|
+
/// @notice Calling autoIssueFor before stage start time reverts.
|
|
239
|
+
function test_stageNotStarted_reverts() external {
|
|
240
|
+
(uint256 revnetId, uint256[] memory stageIds) = _deployMultiStageRevnet(2);
|
|
241
|
+
|
|
242
|
+
// Stage 1 starts at block.timestamp + 180 days.
|
|
243
|
+
// Try to claim it now (before it starts).
|
|
244
|
+
vm.expectRevert(abi.encodeWithSelector(REVDeployer.REVDeployer_StageNotStarted.selector, stageIds[1]));
|
|
245
|
+
REV_DEPLOYER.autoIssueFor(revnetId, stageIds[1], multisig());
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// ───────────────── H-5: Stage ID vs Ruleset ID comparison
|
|
249
|
+
// ─────────────────────
|
|
250
|
+
|
|
251
|
+
/// @notice H-5 EXPLORATION: Compare stored stageIds with actual ruleset IDs.
|
|
252
|
+
/// Stage IDs use block.timestamp + i during deployment.
|
|
253
|
+
/// If actual ruleset IDs differ (e.g., on cross-chain deployment), auto-issuance breaks.
|
|
254
|
+
function test_H5_stageId_vs_rulesetId_comparison() external {
|
|
255
|
+
(uint256 revnetId, uint256[] memory stageIds) = _deployMultiStageRevnet(3);
|
|
256
|
+
|
|
257
|
+
// Get the actual rulesets from the controller.
|
|
258
|
+
(JBRuleset memory currentRuleset,) = jbController().currentRulesetOf(revnetId);
|
|
259
|
+
|
|
260
|
+
// The first ruleset's ID should match stageIds[0] (both are block.timestamp).
|
|
261
|
+
assertEq(currentRuleset.id, stageIds[0], "First ruleset ID should match stage 0 ID (both block.timestamp)");
|
|
262
|
+
|
|
263
|
+
// For stage 1, the stored key is block.timestamp + 1.
|
|
264
|
+
// The actual ruleset ID depends on when JBRulesets creates it.
|
|
265
|
+
// If the ruleset hasn't started yet, getRulesetOf will use the queued ruleset.
|
|
266
|
+
// This is where H-5 manifests: the actual ID may differ from block.timestamp + 1.
|
|
267
|
+
uint256 stage1StoredKey = stageIds[1]; // block.timestamp + 1
|
|
268
|
+
uint256 storedAmount = REV_DEPLOYER.amountToAutoIssue(revnetId, stage1StoredKey, multisig());
|
|
269
|
+
assertGt(storedAmount, 0, "Auto-issuance stored at block.timestamp + 1");
|
|
270
|
+
|
|
271
|
+
// Check if the stored key actually corresponds to a valid ruleset.
|
|
272
|
+
// On the same chain/deployment tx, getRulesetOf(block.timestamp + 1) typically works
|
|
273
|
+
// because JBRulesets stores the queued ruleset with that ID.
|
|
274
|
+
// But on a different chain, block.timestamp would differ entirely.
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
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
|
+
|
|
17
|
+
import {JBConstants} from "@bananapus/core-v6/src/libraries/JBConstants.sol";
|
|
18
|
+
import {JBAccountingContext} from "@bananapus/core-v6/src/structs/JBAccountingContext.sol";
|
|
19
|
+
import {REVLoans} from "../src/REVLoans.sol";
|
|
20
|
+
import {REVStageConfig, REVAutoIssuance} from "../src/structs/REVStageConfig.sol";
|
|
21
|
+
import {REVDescription} from "../src/structs/REVDescription.sol";
|
|
22
|
+
import {IREVLoans} from "./../src/interfaces/IREVLoans.sol";
|
|
23
|
+
import {JBSuckerDeployerConfig} from "@bananapus/suckers-v6/src/structs/JBSuckerDeployerConfig.sol";
|
|
24
|
+
import {JBSuckerRegistry} from "@bananapus/suckers-v6/src/JBSuckerRegistry.sol";
|
|
25
|
+
import {JB721TiersHookDeployer} from "@bananapus/721-hook-v6/src/JB721TiersHookDeployer.sol";
|
|
26
|
+
import {JB721TiersHook} from "@bananapus/721-hook-v6/src/JB721TiersHook.sol";
|
|
27
|
+
import {JB721TiersHookStore} from "@bananapus/721-hook-v6/src/JB721TiersHookStore.sol";
|
|
28
|
+
import {JBAddressRegistry} from "@bananapus/address-registry-v6/src/JBAddressRegistry.sol";
|
|
29
|
+
import {IJBAddressRegistry} from "@bananapus/address-registry-v6/src/interfaces/IJBAddressRegistry.sol";
|
|
30
|
+
|
|
31
|
+
/// @notice Audit regression tests for REVDeployer findings C-2, C-4, and H-5.
|
|
32
|
+
contract REVDeployerAuditRegressions_Local is TestBaseWorkflow, JBTest {
|
|
33
|
+
using JBRulesetMetadataResolver for JBRuleset;
|
|
34
|
+
|
|
35
|
+
bytes32 REV_DEPLOYER_SALT = "REVDeployer";
|
|
36
|
+
bytes32 ERC20_SALT = "REV_TOKEN";
|
|
37
|
+
|
|
38
|
+
REVDeployer REV_DEPLOYER;
|
|
39
|
+
JB721TiersHook EXAMPLE_HOOK;
|
|
40
|
+
IJB721TiersHookDeployer HOOK_DEPLOYER;
|
|
41
|
+
IJB721TiersHookStore HOOK_STORE;
|
|
42
|
+
IJBAddressRegistry ADDRESS_REGISTRY;
|
|
43
|
+
IREVLoans LOANS_CONTRACT;
|
|
44
|
+
IJBSuckerRegistry SUCKER_REGISTRY;
|
|
45
|
+
CTPublisher PUBLISHER;
|
|
46
|
+
MockBuybackDataHook MOCK_BUYBACK;
|
|
47
|
+
|
|
48
|
+
uint256 FEE_PROJECT_ID;
|
|
49
|
+
|
|
50
|
+
address private constant TRUSTED_FORWARDER = 0xB2b5841DBeF766d4b521221732F9B618fCf34A87;
|
|
51
|
+
|
|
52
|
+
function setUp() public override {
|
|
53
|
+
super.setUp();
|
|
54
|
+
|
|
55
|
+
FEE_PROJECT_ID = jbProjects().createFor(multisig());
|
|
56
|
+
|
|
57
|
+
SUCKER_REGISTRY = new JBSuckerRegistry(jbDirectory(), jbPermissions(), multisig(), address(0));
|
|
58
|
+
HOOK_STORE = new JB721TiersHookStore();
|
|
59
|
+
EXAMPLE_HOOK = new JB721TiersHook(jbDirectory(), jbPermissions(), jbRulesets(), HOOK_STORE, multisig());
|
|
60
|
+
ADDRESS_REGISTRY = new JBAddressRegistry();
|
|
61
|
+
HOOK_DEPLOYER = new JB721TiersHookDeployer(EXAMPLE_HOOK, HOOK_STORE, ADDRESS_REGISTRY, multisig());
|
|
62
|
+
PUBLISHER = new CTPublisher(jbDirectory(), jbPermissions(), FEE_PROJECT_ID, multisig());
|
|
63
|
+
MOCK_BUYBACK = new MockBuybackDataHook();
|
|
64
|
+
|
|
65
|
+
LOANS_CONTRACT = new REVLoans({
|
|
66
|
+
controller: jbController(),
|
|
67
|
+
projects: jbProjects(),
|
|
68
|
+
revId: FEE_PROJECT_ID,
|
|
69
|
+
owner: address(this),
|
|
70
|
+
permit2: permit2(),
|
|
71
|
+
trustedForwarder: TRUSTED_FORWARDER
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
REV_DEPLOYER = new REVDeployer{salt: REV_DEPLOYER_SALT}(
|
|
75
|
+
jbController(),
|
|
76
|
+
SUCKER_REGISTRY,
|
|
77
|
+
FEE_PROJECT_ID,
|
|
78
|
+
HOOK_DEPLOYER,
|
|
79
|
+
PUBLISHER,
|
|
80
|
+
IJBRulesetDataHook(address(MOCK_BUYBACK)),
|
|
81
|
+
address(LOANS_CONTRACT),
|
|
82
|
+
TRUSTED_FORWARDER
|
|
83
|
+
);
|
|
84
|
+
|
|
85
|
+
vm.prank(multisig());
|
|
86
|
+
jbProjects().approve(address(REV_DEPLOYER), FEE_PROJECT_ID);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
//*********************************************************************//
|
|
90
|
+
// --- [C-2] REVDeployer.beforePayRecordedWith Array OOB Regression - //
|
|
91
|
+
//*********************************************************************//
|
|
92
|
+
|
|
93
|
+
/// @notice Tests that the C-2 array OOB pattern manifests when only buybackHook is present.
|
|
94
|
+
/// @dev REVDeployer line 258: hookSpecifications[1] = buybackHookSpecifications[0]
|
|
95
|
+
/// always writes to index [1], even when the array has size 1 (no tiered721Hook).
|
|
96
|
+
function test_C2_arrayOOB_onlyBuybackHook() public pure {
|
|
97
|
+
// Simulate: usesTiered721Hook=false, usesBuybackHook=true
|
|
98
|
+
bool usesTiered721Hook = false;
|
|
99
|
+
bool usesBuybackHook = true;
|
|
100
|
+
|
|
101
|
+
uint256 arraySize = (usesTiered721Hook ? 1 : 0) + (usesBuybackHook ? 1 : 0);
|
|
102
|
+
assertEq(arraySize, 1, "array should be size 1");
|
|
103
|
+
|
|
104
|
+
JBPayHookSpecification[] memory specs = new JBPayHookSpecification[](arraySize);
|
|
105
|
+
|
|
106
|
+
// Index [0] is NOT written (usesTiered721Hook is false)
|
|
107
|
+
// Index [1] WOULD be written by the bug, but that's OOB
|
|
108
|
+
// Verify the pattern: writing to index 1 of a size-1 array should revert
|
|
109
|
+
bool wouldRevert = (!usesTiered721Hook && usesBuybackHook);
|
|
110
|
+
assertTrue(wouldRevert, "C-2: this combination triggers the OOB bug");
|
|
111
|
+
|
|
112
|
+
// Verify the safe index: the buyback hook should go at index 0 when no tiered hook
|
|
113
|
+
uint256 correctIndex = usesTiered721Hook ? 1 : 0;
|
|
114
|
+
assertEq(correctIndex, 0, "C-2 FIX: buyback hook should use index 0 when no tiered hook");
|
|
115
|
+
|
|
116
|
+
// Write to the correct index (no revert)
|
|
117
|
+
specs[correctIndex] = JBPayHookSpecification({hook: IJBPayHook(address(0xbeef)), amount: 1 ether, metadata: ""});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/// @notice Verify both hooks present works fine (no OOB).
|
|
121
|
+
function test_C2_noOOB_bothHooksPresent() public pure {
|
|
122
|
+
bool usesTiered721Hook = true;
|
|
123
|
+
bool usesBuybackHook = true;
|
|
124
|
+
|
|
125
|
+
uint256 arraySize = (usesTiered721Hook ? 1 : 0) + (usesBuybackHook ? 1 : 0);
|
|
126
|
+
assertEq(arraySize, 2, "array should be size 2");
|
|
127
|
+
|
|
128
|
+
JBPayHookSpecification[] memory specs = new JBPayHookSpecification[](arraySize);
|
|
129
|
+
specs[0] = JBPayHookSpecification({hook: IJBPayHook(address(0xdead)), amount: 1 ether, metadata: ""});
|
|
130
|
+
specs[1] = JBPayHookSpecification({hook: IJBPayHook(address(0xbeef)), amount: 2 ether, metadata: ""});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
//*********************************************************************//
|
|
134
|
+
// --- [C-4] hasMintPermissionFor returns false for random addresses - //
|
|
135
|
+
//*********************************************************************//
|
|
136
|
+
|
|
137
|
+
/// @notice Tests that calling hasMintPermissionFor returns false for random addresses.
|
|
138
|
+
/// @dev With the buyback hook removed, hasMintPermissionFor should return false
|
|
139
|
+
/// for addresses that are not the loans contract or a sucker.
|
|
140
|
+
function test_C4_hasMintPermissionFor_noBuybackHook() public {
|
|
141
|
+
// Deploy a revnet WITHOUT a buyback hook
|
|
142
|
+
JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
|
|
143
|
+
accountingContextsToAccept[0] = JBAccountingContext({
|
|
144
|
+
token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](1);
|
|
148
|
+
terminalConfigurations[0] =
|
|
149
|
+
JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: accountingContextsToAccept});
|
|
150
|
+
|
|
151
|
+
REVStageConfig[] memory stageConfigurations = new REVStageConfig[](1);
|
|
152
|
+
JBSplit[] memory splits = new JBSplit[](1);
|
|
153
|
+
splits[0].beneficiary = payable(multisig());
|
|
154
|
+
splits[0].percent = 10_000;
|
|
155
|
+
|
|
156
|
+
stageConfigurations[0] = REVStageConfig({
|
|
157
|
+
startsAtOrAfter: uint40(block.timestamp),
|
|
158
|
+
autoIssuances: new REVAutoIssuance[](0),
|
|
159
|
+
splitPercent: 0,
|
|
160
|
+
splits: splits,
|
|
161
|
+
initialIssuance: uint112(1000e18),
|
|
162
|
+
issuanceCutFrequency: 0,
|
|
163
|
+
issuanceCutPercent: 0,
|
|
164
|
+
cashOutTaxRate: 5000,
|
|
165
|
+
extraMetadata: 0
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
REVConfig memory revnetConfiguration = REVConfig({
|
|
169
|
+
description: REVDescription("Test", "TST", "ipfs://test", "TEST_SALT"),
|
|
170
|
+
baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
|
|
171
|
+
splitOperator: multisig(),
|
|
172
|
+
stageConfigurations: stageConfigurations
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
vm.prank(multisig());
|
|
176
|
+
uint256 revnetId = REV_DEPLOYER.deployFor({
|
|
177
|
+
revnetId: FEE_PROJECT_ID,
|
|
178
|
+
configuration: revnetConfiguration,
|
|
179
|
+
terminalConfigurations: terminalConfigurations,
|
|
180
|
+
suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
|
|
181
|
+
deployerConfigurations: new JBSuckerDeployerConfig[](0), salt: keccak256("C4_TEST")
|
|
182
|
+
})
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
// hasMintPermissionFor should return false for random addresses
|
|
186
|
+
address someRandomAddr = address(0x12345);
|
|
187
|
+
|
|
188
|
+
// Get the current ruleset for the call
|
|
189
|
+
JBRuleset memory currentRuleset = jbRulesets().currentOf(revnetId);
|
|
190
|
+
|
|
191
|
+
// With buyback hook removed, hasMintPermissionFor should return false
|
|
192
|
+
// for addresses that are not the loans contract or a sucker.
|
|
193
|
+
bool hasPerm = REV_DEPLOYER.hasMintPermissionFor(revnetId, currentRuleset, someRandomAddr);
|
|
194
|
+
assertFalse(hasPerm, "C-4: random address should not have mint permission");
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
//*********************************************************************//
|
|
198
|
+
// --- [H-5] Auto-Issuance Stage ID Mismatch ----------------------- //
|
|
199
|
+
//*********************************************************************//
|
|
200
|
+
|
|
201
|
+
/// @notice Tests that auto-issuance stage IDs are computed correctly for multi-stage revnets.
|
|
202
|
+
/// @dev H-5: The stage ID is computed as `block.timestamp + i` which only works if stages
|
|
203
|
+
/// are deployed in a specific order at a specific time.
|
|
204
|
+
function test_H5_autoIssuanceStageIdMismatch() public {
|
|
205
|
+
JBAccountingContext[] memory accountingContextsToAccept = new JBAccountingContext[](1);
|
|
206
|
+
accountingContextsToAccept[0] = JBAccountingContext({
|
|
207
|
+
token: JBConstants.NATIVE_TOKEN, decimals: 18, currency: uint32(uint160(JBConstants.NATIVE_TOKEN))
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
JBTerminalConfig[] memory terminalConfigurations = new JBTerminalConfig[](1);
|
|
211
|
+
terminalConfigurations[0] =
|
|
212
|
+
JBTerminalConfig({terminal: jbMultiTerminal(), accountingContextsToAccept: accountingContextsToAccept});
|
|
213
|
+
|
|
214
|
+
JBSplit[] memory splits = new JBSplit[](1);
|
|
215
|
+
splits[0].beneficiary = payable(multisig());
|
|
216
|
+
splits[0].percent = 10_000;
|
|
217
|
+
|
|
218
|
+
uint8 decimals = 18;
|
|
219
|
+
uint256 decimalMultiplier = 10 ** decimals;
|
|
220
|
+
|
|
221
|
+
// Configure 3 stages with auto-issuance on stages 0 AND 1
|
|
222
|
+
REVStageConfig[] memory stageConfigurations = new REVStageConfig[](3);
|
|
223
|
+
|
|
224
|
+
// Stage 0: has auto-issuance
|
|
225
|
+
{
|
|
226
|
+
REVAutoIssuance[] memory issuanceConfs = new REVAutoIssuance[](1);
|
|
227
|
+
issuanceConfs[0] = REVAutoIssuance({
|
|
228
|
+
chainId: uint32(block.chainid), count: uint104(50_000 * decimalMultiplier), beneficiary: multisig()
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
stageConfigurations[0] = REVStageConfig({
|
|
232
|
+
startsAtOrAfter: uint40(block.timestamp),
|
|
233
|
+
autoIssuances: issuanceConfs,
|
|
234
|
+
splitPercent: 2000,
|
|
235
|
+
splits: splits,
|
|
236
|
+
initialIssuance: uint112(1000 * decimalMultiplier),
|
|
237
|
+
issuanceCutFrequency: 90 days,
|
|
238
|
+
issuanceCutPercent: JBConstants.MAX_WEIGHT_CUT_PERCENT / 2,
|
|
239
|
+
cashOutTaxRate: 6000,
|
|
240
|
+
extraMetadata: 0
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
// Stage 1: also has auto-issuance — this is where H-5 manifests
|
|
245
|
+
{
|
|
246
|
+
REVAutoIssuance[] memory issuanceConfs = new REVAutoIssuance[](1);
|
|
247
|
+
issuanceConfs[0] = REVAutoIssuance({
|
|
248
|
+
chainId: uint32(block.chainid), count: uint104(30_000 * decimalMultiplier), beneficiary: multisig()
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
stageConfigurations[1] = REVStageConfig({
|
|
252
|
+
startsAtOrAfter: uint40(stageConfigurations[0].startsAtOrAfter + 365 days),
|
|
253
|
+
autoIssuances: issuanceConfs,
|
|
254
|
+
splitPercent: 1000,
|
|
255
|
+
splits: splits,
|
|
256
|
+
initialIssuance: 0, // inherit
|
|
257
|
+
issuanceCutFrequency: 180 days,
|
|
258
|
+
issuanceCutPercent: JBConstants.MAX_WEIGHT_CUT_PERCENT / 2,
|
|
259
|
+
cashOutTaxRate: 3000,
|
|
260
|
+
extraMetadata: 0
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Stage 2: no auto-issuance
|
|
265
|
+
stageConfigurations[2] = REVStageConfig({
|
|
266
|
+
startsAtOrAfter: uint40(stageConfigurations[1].startsAtOrAfter + (5 * 365 days)),
|
|
267
|
+
autoIssuances: new REVAutoIssuance[](0),
|
|
268
|
+
splitPercent: 0,
|
|
269
|
+
splits: splits,
|
|
270
|
+
initialIssuance: 1,
|
|
271
|
+
issuanceCutFrequency: 0,
|
|
272
|
+
issuanceCutPercent: 0,
|
|
273
|
+
cashOutTaxRate: 500,
|
|
274
|
+
extraMetadata: 0
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
REVConfig memory revnetConfiguration = REVConfig({
|
|
278
|
+
description: REVDescription("H5Test", "H5T", "ipfs://h5test", "H5_TOKEN"),
|
|
279
|
+
baseCurrency: uint32(uint160(JBConstants.NATIVE_TOKEN)),
|
|
280
|
+
splitOperator: multisig(),
|
|
281
|
+
stageConfigurations: stageConfigurations
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
vm.prank(multisig());
|
|
285
|
+
uint256 revnetId = REV_DEPLOYER.deployFor({
|
|
286
|
+
revnetId: 0,
|
|
287
|
+
configuration: revnetConfiguration,
|
|
288
|
+
terminalConfigurations: terminalConfigurations,
|
|
289
|
+
suckerDeploymentConfiguration: REVSuckerDeploymentConfig({
|
|
290
|
+
deployerConfigurations: new JBSuckerDeployerConfig[](0), salt: keccak256("H5_TEST")
|
|
291
|
+
})
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
// Verify the revnet was deployed
|
|
295
|
+
assertGt(revnetId, 0, "revnet should be deployed");
|
|
296
|
+
|
|
297
|
+
// The H-5 bug: auto-issuance for stage 1 is stored at key (block.timestamp + 1),
|
|
298
|
+
// but the actual ruleset ID for stage 1 is the timestamp when that stage's ruleset
|
|
299
|
+
// was queued. These may not match.
|
|
300
|
+
// We verify the auto-issuance amounts are stored and can be queried.
|
|
301
|
+
uint256 stage0Amount = REV_DEPLOYER.amountToAutoIssue(revnetId, block.timestamp, multisig());
|
|
302
|
+
|
|
303
|
+
// Stage 0 auto-issuance should be stored at block.timestamp
|
|
304
|
+
assertEq(stage0Amount, 50_000 * decimalMultiplier, "Stage 0 auto-issuance should be stored at block.timestamp");
|
|
305
|
+
|
|
306
|
+
// Stage 1 auto-issuance is stored at (block.timestamp + 1) per H-5
|
|
307
|
+
uint256 stage1Amount = REV_DEPLOYER.amountToAutoIssue(revnetId, block.timestamp + 1, multisig());
|
|
308
|
+
assertEq(
|
|
309
|
+
stage1Amount,
|
|
310
|
+
30_000 * decimalMultiplier,
|
|
311
|
+
"H-5: Stage 1 auto-issuance stored at block.timestamp + 1 (may not match ruleset ID)"
|
|
312
|
+
);
|
|
313
|
+
|
|
314
|
+
// Now check the actual ruleset IDs to demonstrate the mismatch
|
|
315
|
+
JBRuleset[] memory rulesets = jbRulesets().allOf(revnetId, 0, 3);
|
|
316
|
+
if (rulesets.length >= 2) {
|
|
317
|
+
uint256 actualStage1RulesetId = rulesets[1].id;
|
|
318
|
+
|
|
319
|
+
// The H-5 mismatch: the storage key (block.timestamp + 1) likely != the actual ruleset ID
|
|
320
|
+
// If they don't match, auto-issuance tokens for stage 1 become unclaimable
|
|
321
|
+
if (actualStage1RulesetId != block.timestamp + 1) {
|
|
322
|
+
// Verify the amount at the ACTUAL ruleset ID is 0 (the mismatch)
|
|
323
|
+
uint256 amountAtActualId = REV_DEPLOYER.amountToAutoIssue(revnetId, actualStage1RulesetId, multisig());
|
|
324
|
+
assertEq(amountAtActualId, 0, "H-5 CONFIRMED: auto-issuance at actual ruleset ID is 0 (mismatch)");
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|