Skip to content

Commit a76de71

Browse files
committed
test: remove forge warnings
1 parent 2f9f63d commit a76de71

16 files changed

+136
-154
lines changed

contracts/test/live/adapters/camelot/Live_CamelotV3EquivalenceTest.sol

Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,16 @@ contract Live_CamelotV3EquivalenceTest is LiveTestHelper {
7272

7373
vm.startPrank(USER);
7474

75-
ICamelotV3Router.ExactInputSingleParams memory exactInputSingleParams = ICamelotV3Router
76-
.ExactInputSingleParams({
77-
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
78-
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
79-
recipient: creditAccount,
80-
deadline: block.timestamp + 3600,
81-
amountIn: WAD,
82-
amountOutMinimum: 0,
83-
limitSqrtPrice: 0
84-
});
75+
ICamelotV3Router.ExactInputSingleParams memory exactInputSingleParams =
76+
ICamelotV3Router.ExactInputSingleParams({
77+
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
78+
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
79+
recipient: creditAccount,
80+
deadline: block.timestamp + 3600,
81+
amountIn: WAD,
82+
amountOutMinimum: 0,
83+
limitSqrtPrice: 0
84+
});
8585

8686
creditFacade.multicall(
8787
creditAccount, MultiCallBuilder.build(router.exactInputSingle(exactInputSingleParams))
@@ -94,15 +94,15 @@ contract Live_CamelotV3EquivalenceTest is LiveTestHelper {
9494
);
9595
comparator.takeSnapshot("after_exactInputSingleSupportingFeeOnTransferTokens", creditAccount);
9696

97-
ICamelotV3AdapterTypes.ExactDiffInputSingleParams memory exactDiffInputSingleParams = ICamelotV3AdapterTypes
98-
.ExactDiffInputSingleParams({
99-
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
100-
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
101-
deadline: block.timestamp + 3600,
102-
leftoverAmount: 20 * WAD,
103-
rateMinRAY: 0,
104-
limitSqrtPrice: 0
105-
});
97+
ICamelotV3AdapterTypes.ExactDiffInputSingleParams memory exactDiffInputSingleParams =
98+
ICamelotV3AdapterTypes.ExactDiffInputSingleParams({
99+
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
100+
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
101+
deadline: block.timestamp + 3600,
102+
leftoverAmount: 20 * WAD,
103+
rateMinRAY: 0,
104+
limitSqrtPrice: 0
105+
});
106106

107107
creditFacade.multicall(
108108
creditAccount, MultiCallBuilder.build(router.exactDiffInputSingle(exactDiffInputSingleParams))
@@ -129,27 +129,27 @@ contract Live_CamelotV3EquivalenceTest is LiveTestHelper {
129129
creditFacade.multicall(creditAccount, MultiCallBuilder.build(router.exactInput(exactInputParams)));
130130
comparator.takeSnapshot("after_exactInput", creditAccount);
131131

132-
ICamelotV3AdapterTypes.ExactDiffInputParams memory exactDiffInputParams = ICamelotV3AdapterTypes
133-
.ExactDiffInputParams({
134-
path: abi.encodePacked(tokenTestSuite.addressOf(TOKEN_WETH), tokenTestSuite.addressOf(TOKEN_USDC)),
135-
deadline: block.timestamp + 3600,
136-
leftoverAmount: 10 * WAD,
137-
rateMinRAY: 0
138-
});
132+
ICamelotV3AdapterTypes.ExactDiffInputParams memory exactDiffInputParams =
133+
ICamelotV3AdapterTypes.ExactDiffInputParams({
134+
path: abi.encodePacked(tokenTestSuite.addressOf(TOKEN_WETH), tokenTestSuite.addressOf(TOKEN_USDC)),
135+
deadline: block.timestamp + 3600,
136+
leftoverAmount: 10 * WAD,
137+
rateMinRAY: 0
138+
});
139139
creditFacade.multicall(creditAccount, MultiCallBuilder.build(router.exactDiffInput(exactDiffInputParams)));
140140
comparator.takeSnapshot("after_exactDiffInput", creditAccount);
141141

142-
ICamelotV3Router.ExactOutputSingleParams memory exactOutputSingleParams = ICamelotV3Router
143-
.ExactOutputSingleParams({
144-
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
145-
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
146-
fee: 0,
147-
recipient: creditAccount,
148-
deadline: block.timestamp + 3600,
149-
amountOut: 100 * 10 ** 6,
150-
amountInMaximum: type(uint256).max,
151-
limitSqrtPrice: 0
152-
});
142+
ICamelotV3Router.ExactOutputSingleParams memory exactOutputSingleParams =
143+
ICamelotV3Router.ExactOutputSingleParams({
144+
tokenIn: tokenTestSuite.addressOf(TOKEN_WETH),
145+
tokenOut: tokenTestSuite.addressOf(TOKEN_USDC),
146+
fee: 0,
147+
recipient: creditAccount,
148+
deadline: block.timestamp + 3600,
149+
amountOut: 100 * 10 ** 6,
150+
amountInMaximum: type(uint256).max,
151+
limitSqrtPrice: 0
152+
});
153153
creditFacade.multicall(
154154
creditAccount, MultiCallBuilder.build(router.exactOutputSingle(exactOutputSingleParams))
155155
);
@@ -297,9 +297,8 @@ contract Live_CamelotV3EquivalenceTest is LiveTestHelper {
297297

298298
if (
299299
routerAdapter == address(0)
300-
|| !ICamelotV3Adapter(routerAdapter).isPoolAllowed(
301-
tokenTestSuite.addressOf(TOKEN_WETH), tokenTestSuite.addressOf(TOKEN_USDC)
302-
)
300+
|| !ICamelotV3Adapter(routerAdapter)
301+
.isPoolAllowed(tokenTestSuite.addressOf(TOKEN_WETH), tokenTestSuite.addressOf(TOKEN_USDC))
303302
) {
304303
return;
305304
}
@@ -316,14 +315,14 @@ contract Live_CamelotV3EquivalenceTest is LiveTestHelper {
316315
supportedContracts.addressOf(Contracts.CAMELOT_V3_ROUTER)
317316
);
318317

319-
uint256 snapshot = vm.snapshot();
318+
uint256 snapshot = vm.snapshotState();
320319

321320
compareBehavior(creditAccount, supportedContracts.addressOf(Contracts.CAMELOT_V3_ROUTER), false);
322321

323322
/// Stores save balances in memory, because all state data would be reverted afer snapshot
324323
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
325324

326-
vm.revertTo(snapshot);
325+
vm.revertToState(snapshot);
327326

328327
compareBehavior(creditAccount, getAdapter(address(creditManager), Contracts.CAMELOT_V3_ROUTER), true);
329328

contracts/test/live/adapters/convex/Live_ConvexEquivalenceTest.t.sol

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ contract Live_ConvexEquivalenceTest is LiveTestHelper {
256256
for (uint256 i = 0; i < adapters.length; ++i) {
257257
if (IAdapter(adapters[i]).contractType() != "ADAPTER::CVX_V1_BASE_REWARD_POOL") continue;
258258

259-
uint256 snapshot0 = vm.snapshot();
259+
uint256 snapshot0 = vm.snapshotState();
260260

261261
address creditAccount =
262262
openCreditAccountWithUnderlying(IConvexV1BaseRewardPoolAdapter(adapters[i]).curveLPtoken(), 3000 * WAD);
@@ -271,23 +271,23 @@ contract Live_ConvexEquivalenceTest is LiveTestHelper {
271271
IAdapter(adapters[i]).targetContract()
272272
);
273273

274-
uint256 snapshot1 = vm.snapshot();
274+
uint256 snapshot1 = vm.snapshotState();
275275

276276
BalanceComparator comparator = prepareComparator(adapters[i], booster);
277277

278278
compareBehavior(creditAccount, booster, IAdapter(adapters[i]).targetContract(), false, comparator);
279279

280280
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
281281

282-
vm.revertTo(snapshot1);
282+
vm.revertToState(snapshot1);
283283

284284
comparator = prepareComparator(adapters[i], booster);
285285

286286
compareBehavior(creditAccount, creditManager.contractToAdapter(booster), adapters[i], true, comparator);
287287

288288
comparator.compareAllSnapshots(creditAccount, savedBalanceSnapshots);
289289

290-
vm.revertTo(snapshot0);
290+
vm.revertToState(snapshot0);
291291
}
292292
}
293293

@@ -296,7 +296,7 @@ contract Live_ConvexEquivalenceTest is LiveTestHelper {
296296
uint256 collateralTokensCount = creditManager.collateralTokensCount();
297297

298298
for (uint256 i = 0; i < collateralTokensCount; ++i) {
299-
uint256 snapshot = vm.snapshot();
299+
uint256 snapshot = vm.snapshotState();
300300

301301
address token = creditManager.getTokenByMask(1 << i);
302302

@@ -343,7 +343,7 @@ contract Live_ConvexEquivalenceTest is LiveTestHelper {
343343

344344
assertEq(IERC20(convexToken).balanceOf(USER), WAD);
345345

346-
vm.revertTo(snapshot);
346+
vm.revertToState(snapshot);
347347
}
348348
}
349349
}

contracts/test/live/adapters/curve/Live_CurveEquivalenceTest.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ contract Live_CurveEquivalenceTest is LiveTestHelper {
622622
for (uint256 i = 0; i < adapters.length; ++i) {
623623
if (!isCurveAdapter(IAdapter(adapters[i]).contractType())) continue;
624624

625-
uint256 snapshot0 = vm.snapshot();
625+
uint256 snapshot0 = vm.snapshotState();
626626

627627
address coin0 = ICurveV1Adapter(adapters[i]).token0();
628628
address underlying0 = ICurveV1Adapter(adapters[i]).underlying0();
@@ -663,23 +663,23 @@ contract Live_CurveEquivalenceTest is LiveTestHelper {
663663
ICurveV1Adapter(adapters[i]).token(), creditAccount, ICurveV1Adapter(adapters[i]).targetContract()
664664
);
665665

666-
uint256 snapshot1 = vm.snapshot();
666+
uint256 snapshot1 = vm.snapshotState();
667667

668668
prepareComparator(adapters[i]);
669669

670670
compareBehavior(creditAccount, IAdapter(adapters[i]).targetContract(), cpp, false);
671671

672672
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
673673

674-
vm.revertTo(snapshot1);
674+
vm.revertToState(snapshot1);
675675

676676
prepareComparator(adapters[i]);
677677

678678
compareBehavior(creditAccount, adapters[i], cpp, true);
679679

680680
comparator.compareAllSnapshots(creditAccount, savedBalanceSnapshots, 0);
681681

682-
vm.revertTo(snapshot0);
682+
vm.revertToState(snapshot0);
683683
}
684684
}
685685
}

contracts/test/live/adapters/erc4626/Live_ERC4626EquivalenceTest.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ contract Live_ERC4626EquivalenceTest is LiveTestHelper {
158158
for (uint256 i = 0; i < adapters.length; ++i) {
159159
if (IAdapter(adapters[i]).contractType() != "ADAPTER::ERC4626_VAULT") continue;
160160

161-
uint256 snapshot0 = vm.snapshot();
161+
uint256 snapshot0 = vm.snapshotState();
162162

163163
address asset = IERC4626Adapter(adapters[i]).asset();
164164

@@ -167,7 +167,7 @@ contract Live_ERC4626EquivalenceTest is LiveTestHelper {
167167

168168
tokenTestSuite.approve(asset, creditAccount, IAdapter(adapters[i]).targetContract());
169169

170-
uint256 snapshot1 = vm.snapshot();
170+
uint256 snapshot1 = vm.snapshotState();
171171

172172
BalanceComparator comparator = prepareComparator(adapters[i]);
173173

@@ -181,15 +181,15 @@ contract Live_ERC4626EquivalenceTest is LiveTestHelper {
181181

182182
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
183183

184-
vm.revertTo(snapshot1);
184+
vm.revertToState(snapshot1);
185185

186186
comparator = prepareComparator(adapters[i]);
187187

188188
compareBehavior(creditAccount, adapters[i], 10 ** IERC20Metadata(asset).decimals(), true, comparator);
189189

190190
comparator.compareAllSnapshots(creditAccount, savedBalanceSnapshots, 0);
191191

192-
vm.revertTo(snapshot0);
192+
vm.revertToState(snapshot0);
193193
}
194194
}
195195
}

contracts/test/live/adapters/lido/Live_LidoEquivalenceTest.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,13 @@ contract Live_LidoEquivalenceTest is LiveTestHelper {
116116
supportedContracts.addressOf(Contracts.LIDO_STETH_GATEWAY)
117117
);
118118

119-
uint256 snapshot = vm.snapshot();
119+
uint256 snapshot = vm.snapshotState();
120120

121121
compareBehavior(creditAccount, lidoGateway, false);
122122

123123
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
124124

125-
vm.revertTo(snapshot);
125+
vm.revertToState(snapshot);
126126

127127
compareBehavior(creditAccount, lidoAdapter, true);
128128

contracts/test/live/adapters/lido/Live_WstETHV1Adapter.t.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,13 @@ contract LiveWstETHV1AdapterTest is LiveTestHelper {
125125
tokenTestSuite.addressOf(TOKEN_STETH), creditAccount, supportedContracts.addressOf(Contracts.LIDO_WSTETH)
126126
);
127127

128-
uint256 snapshot = vm.snapshot();
128+
uint256 snapshot = vm.snapshotState();
129129

130130
compareBehavior(creditAccount, wsteth, false);
131131

132132
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
133133

134-
vm.revertTo(snapshot);
134+
vm.revertToState(snapshot);
135135

136136
compareBehavior(creditAccount, wstethAdapter, true);
137137

contracts/test/live/adapters/pendle/Live_PendleRouterEquivalenceTest.t.sol

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,9 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
8989
netTokenIn: 10 * baseUnit,
9090
tokenMintSy: pair.inputToken,
9191
pendleSwap: address(0),
92-
swapData: SwapData({swapType: SwapType.NONE, extRouter: address(0), extCalldata: "", needScale: false})
92+
swapData: SwapData({
93+
swapType: SwapType.NONE, extRouter: address(0), extCalldata: "", needScale: false
94+
})
9395
});
9496
creditFacade.multicall(
9597
creditAccount,
@@ -99,11 +101,7 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
99101
pair.market,
100102
0,
101103
ApproxParams({
102-
guessMin: 0,
103-
guessMax: type(uint256).max,
104-
guessOffchain: 0,
105-
maxIteration: 256,
106-
eps: 1e14
104+
guessMin: 0, guessMax: type(uint256).max, guessOffchain: 0, maxIteration: 256, eps: 1e14
107105
}),
108106
input,
109107
lod
@@ -121,11 +119,7 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
121119
pair.market,
122120
0,
123121
ApproxParams({
124-
guessMin: 0,
125-
guessMax: type(uint256).max,
126-
guessOffchain: 0,
127-
maxIteration: 256,
128-
eps: 1e14
122+
guessMin: 0, guessMax: type(uint256).max, guessOffchain: 0, maxIteration: 256, eps: 1e14
129123
}),
130124
diffInput
131125
)
@@ -176,18 +170,16 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
176170
netTokenIn: 10 * baseUnit,
177171
tokenMintSy: pair.inputToken,
178172
pendleSwap: address(0),
179-
swapData: SwapData({swapType: SwapType.NONE, extRouter: address(0), extCalldata: "", needScale: false})
173+
swapData: SwapData({
174+
swapType: SwapType.NONE, extRouter: address(0), extCalldata: "", needScale: false
175+
})
180176
});
181177
router.swapExactTokenForPt(
182178
creditAccount,
183179
pair.market,
184180
0,
185181
ApproxParams({
186-
guessMin: 0,
187-
guessMax: type(uint256).max,
188-
guessOffchain: 0,
189-
maxIteration: 256,
190-
eps: 1e14
182+
guessMin: 0, guessMax: type(uint256).max, guessOffchain: 0, maxIteration: 256, eps: 1e14
191183
}),
192184
input,
193185
lod
@@ -202,11 +194,7 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
202194
pair.market,
203195
0,
204196
ApproxParams({
205-
guessMin: 0,
206-
guessMax: type(uint256).max,
207-
guessOffchain: 0,
208-
maxIteration: 256,
209-
eps: 1e14
197+
guessMin: 0, guessMax: type(uint256).max, guessOffchain: 0, maxIteration: 256, eps: 1e14
210198
}),
211199
input,
212200
lod
@@ -289,15 +277,15 @@ contract Live_PendleRouterAdapterTest is LiveTestHelper {
289277
tokenTestSuite.approve(pair.inputToken, creditAccount, pendleRouter);
290278
tokenTestSuite.approve(pair.pendleToken, creditAccount, pendleRouter);
291279

292-
uint256 snapshot = vm.snapshot();
280+
uint256 snapshot = vm.snapshotState();
293281

294282
prepareComparator(pair.inputToken, pair.pendleToken);
295283

296284
compareBehavior(creditAccount, pendleRouter, pair, false);
297285

298286
BalanceBackup[] memory savedBalanceSnapshots = comparator.exportSnapshots(creditAccount);
299287

300-
vm.revertTo(snapshot);
288+
vm.revertToState(snapshot);
301289

302290
prepareComparator(pair.inputToken, pair.pendleToken);
303291

0 commit comments

Comments
 (0)