@@ -157,6 +157,31 @@ contract IonicLiquidatorTest is UpgradesBaseTest {
157
157
liquidator.safeLiquidateToTokensWithFlashLoan (vars);
158
158
}
159
159
160
+ function testWithdrawalLiquidator () public debuggingOnly fork (MODE_MAINNET) {
161
+ TransparentUpgradeableProxy proxyV3 = TransparentUpgradeableProxy (payable (ap.getAddress ("IonicUniV3Liquidator " )));
162
+ IonicUniV3Liquidator implV3 = new IonicUniV3Liquidator ();
163
+ IonicUniV3Liquidator liquidatorV3 = IonicUniV3Liquidator (payable (ap.getAddress ("IonicUniV3Liquidator " )));
164
+ ProxyAdmin proxyAdmin = ProxyAdmin (ap.getAddress ("DefaultProxyAdmin " ));
165
+
166
+ vm.startPrank (proxyAdmin.owner ());
167
+ proxyAdmin.upgrade (proxyV3, address (implV3));
168
+ vm.stopPrank ();
169
+
170
+ vm.prank (0x4200000000000000000000000000000000000016 );
171
+ (bool success , ) = address (liquidatorV3).call { value: 1 ether }("" );
172
+ require (success, "transfer of funds failed " );
173
+
174
+ uint256 beforeBalance = liquidatorV3.owner ().balance;
175
+
176
+ vm.prank (liquidatorV3.owner ());
177
+ liquidatorV3.withdrawAll ();
178
+
179
+ emit log_named_uint ("balance of liquidator " , liquidatorV3.owner ().balance);
180
+
181
+ assertEq (liquidatorV3.owner ().balance, beforeBalance + 1 ether);
182
+ assertEq (address (liquidatorV3).balance, 0 );
183
+ }
184
+
160
185
function testLiquidateAfterUpgradeLiquidator () public debuggingOnly forkAtBlock (MODE_MAINNET, 9382006 ) {
161
186
// upgrade IonicLiquidator
162
187
TransparentUpgradeableProxy proxyV3 = TransparentUpgradeableProxy (payable (ap.getAddress ("IonicUniV3Liquidator " )));
0 commit comments