-
Notifications
You must be signed in to change notification settings - Fork 13
/
ICdpManager.sol
78 lines (55 loc) · 2.33 KB
/
ICdpManager.sol
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// SPDX-License-Identifier: MIT
pragma solidity 0.8.17;
import "./IEbtcBase.sol";
import "./ICdpManagerData.sol";
// Common interface for the Cdp Manager.
interface ICdpManager is IEbtcBase, ICdpManagerData {
// --- Functions ---
function getActiveCdpsCount() external view returns (uint256);
function getIdFromCdpIdsArray(uint256 _index) external view returns (bytes32);
function liquidate(bytes32 _cdpId) external;
function partiallyLiquidate(
bytes32 _cdpId,
uint256 _partialAmount,
bytes32 _upperPartialHint,
bytes32 _lowerPartialHint
) external;
function batchLiquidateCdps(bytes32[] calldata _cdpArray) external;
function redeemCollateral(
uint256 _EBTCAmount,
bytes32 _firstRedemptionHint,
bytes32 _upperPartialRedemptionHint,
bytes32 _lowerPartialRedemptionHint,
uint256 _partialRedemptionHintNICR,
uint256 _maxIterations,
uint256 _maxFee
) external;
function updateStakeAndTotalStakes(bytes32 _cdpId) external returns (uint256);
function syncAccounting(bytes32 _cdpId) external;
function closeCdp(bytes32 _cdpId, address _borrower, uint256 _debt, uint256 _coll) external;
function getRedemptionRate() external view returns (uint256);
function getRedemptionRateWithDecay() external view returns (uint256);
function getRedemptionFeeWithDecay(uint256 _stETHToRedeem) external view returns (uint256);
function getCdpStatus(bytes32 _cdpId) external view returns (uint256);
function getCdpStake(bytes32 _cdpId) external view returns (uint256);
function getCdpDebt(bytes32 _cdpId) external view returns (uint256);
function getCdpCollShares(bytes32 _cdpId) external view returns (uint256);
function getCdpLiquidatorRewardShares(bytes32 _cdpId) external view returns (uint);
function initializeCdp(
bytes32 _cdpId,
uint256 _debt,
uint256 _coll,
uint256 _liquidatorRewardShares,
address _borrower
) external;
function updateCdp(
bytes32 _cdpId,
address _borrower,
uint256 _coll,
uint256 _debt,
uint256 _newColl,
uint256 _newDebt
) external;
function getCachedTCR(uint256 _price) external view returns (uint256);
function checkRecoveryMode(uint256 _price) external view returns (bool);
}