-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathIFlashLiquidationReceiver.sol
More file actions
26 lines (25 loc) · 1.44 KB
/
IFlashLiquidationReceiver.sol
File metadata and controls
26 lines (25 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
/// @dev when performing Silo flash liquidation, FlashReceiver contract will receive all collaterals
interface IFlashLiquidationReceiver {
/// @dev this method is called when doing Silo flash liquidation
/// one can NOT assume, that if _seizedCollateral[i] != 0, then _shareAmountsToRepaid[i] must be 0
/// one should assume, that any combination of amounts is possible
/// on callback, one must call `Silo.repayFor` because at the end of transaction,
/// Silo will check if borrower is solvent.
/// @param _user user address, that is liquidated
/// @param _assets array of collateral assets received during user liquidation
/// this array contains all assets (collateral borrowed) without any order
/// @param _receivedCollaterals array of collateral amounts received during user liquidation
/// indexes of amounts are related to `_assets`,
/// @param _shareAmountsToRepaid array of amounts to repay for each asset
/// indexes of amounts are related to `_assets`,
/// @param _flashReceiverData data that are passed from sender that executes liquidation
function siloLiquidationCallback(
address _user,
address[] calldata _assets,
uint256[] calldata _receivedCollaterals,
uint256[] calldata _shareAmountsToRepaid,
bytes memory _flashReceiverData
) external;
}