Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 6b2178b

Browse files
made univ3 liquidator receive auction proceedings
1 parent 2eda87e commit 6b2178b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

contracts/IonicUniV3Liquidator.sol

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@ import { ICErc20 } from "./compound/CTokenInterfaces.sol";
1818

1919
import "./PoolLens.sol";
2020
import "@pythnetwork/express-relay-sdk-solidity/IExpressRelay.sol";
21+
import "@pythnetwork/express-relay-sdk-solidity/IExpressRelayFeeReceiver.sol";
2122

2223
/**
2324
* @title IonicUniV3Liquidator
2425
* @author Veliko Minkov <[email protected]> (https://github.com/vminkov)
2526
* @notice IonicUniV3Liquidator liquidates unhealthy borrowers with flashloan support.
2627
*/
27-
contract IonicUniV3Liquidator is OwnableUpgradeable, ILiquidator, IUniswapV3FlashCallback {
28+
contract IonicUniV3Liquidator is OwnableUpgradeable, ILiquidator, IUniswapV3FlashCallback, IExpressRelayFeeReceiver {
2829
using AddressUpgradeable for address payable;
2930
using SafeERC20Upgradeable for IERC20Upgradeable;
3031

@@ -178,6 +179,21 @@ contract IonicUniV3Liquidator is OwnableUpgradeable, ILiquidator, IUniswapV3Flas
178179
require(payable(msg.sender).isContract(), "Sender is not a contract.");
179180
}
180181

182+
/**
183+
* @notice receiveAuctionProceedings function - receives native token from the express relay
184+
* You can use permission key to distribute the received funds to users who got liquidated, LPs, etc...
185+
*/
186+
function receiveAuctionProceedings(bytes calldata permissionKey) external payable {}
187+
188+
function withdrawAll() external onlyOwner {
189+
uint256 balance = address(this).balance;
190+
require(balance > 0, "No Ether left to withdraw");
191+
192+
// Transfer all Ether to the owner
193+
(bool sent, ) = msg.sender.call{ value: balance }("");
194+
require(sent, "Failed to send Ether");
195+
}
196+
181197
/**
182198
* @dev Callback function for Uniswap flashloans.
183199
*/

0 commit comments

Comments
 (0)