-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch from loss liquidators to loss policies
This commit also contains minor changes to allow migration from v3.0.x to v3.1.x: - `CreditConfiguratorV3`'s constructor accepts `acl` as argument - `CreditFacadeV3`'s constructor accepts `lossPolicy` as argument - `lossPolicy` is no longer migrated during credit facade replacement
- Loading branch information
1 parent
b8a2c07
commit 06d77c3
Showing
13 changed files
with
209 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
// Gearbox Protocol. Generalized leverage for DeFi protocols | ||
// (c) Gearbox Foundation, 2024. | ||
pragma solidity ^0.8.17; | ||
|
||
import {IVersion} from "./IVersion.sol"; | ||
|
||
/// @notice Loss policy dictates the conditions under which a liquidation with bad debt can proceed. | ||
/// For example, it can restrict such liquidations to only be performed by whitelisted accounts that | ||
/// can return premium to the DAO to recover part of the losses, or prevent liquidations of an asset | ||
/// whose market price drops for a short period of time while its fundamental value doesn't change. | ||
interface ILossPolicy is IVersion { | ||
/// @notice Whether `creditAccount` can be liquidated with loss by `caller`, `data` is an optional field | ||
/// that can be used to pass some off-chain data specific to the loss policy implementation | ||
function isLiquidatable(address creditAccount, address caller, bytes calldata data) external returns (bool); | ||
|
||
/// @notice Emergency function which forces `isLiquidatable` to always return `false` | ||
function disable() external; | ||
|
||
/// @notice Emergency function which forces `isLiquidatable` to always return `true` | ||
function enable() external; | ||
} |
Oops, something went wrong.