This repository has been archived by the owner on Jan 22, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathIFraxlendPair.sol
246 lines (170 loc) · 7.91 KB
/
IFraxlendPair.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
// SPDX-License-Identifier: ISC
pragma solidity >=0.8.19;
interface IFraxlendPair {
struct CurrentRateInfo {
uint32 lastBlock;
uint32 feeToProtocolRate; // Fee amount 1e5 precision
uint64 lastTimestamp;
uint64 ratePerSec;
uint64 fullUtilizationRate;
}
struct VaultAccount {
uint128 amount; // Total amount, analogous to market cap
uint128 shares; // Total shares, analogous to shares outstanding
}
function CIRCUIT_BREAKER_ADDRESS() external view returns (address);
function COMPTROLLER_ADDRESS() external view returns (address);
function DEPLOYER_ADDRESS() external view returns (address);
function FRAXLEND_WHITELIST_ADDRESS() external view returns (address);
function timelockAddress() external view returns (address);
function addCollateral(uint256 _collateralAmount, address _borrower) external;
function addInterest(bool _returnAccounting)
external
returns (
uint256 _interestEarned,
uint256 _feesAmount,
uint256 _feesShare,
CurrentRateInfo memory,
VaultAccount memory,
VaultAccount memory
);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function approvedBorrowers(address) external view returns (bool);
function approvedLenders(address) external view returns (bool);
function asset() external view returns (address);
function balanceOf(address account) external view returns (uint256);
function borrowAsset(uint256 _borrowAmount, uint256 _collateralAmount, address _receiver)
external
returns (uint256 _shares);
function borrowerWhitelistActive() external view returns (bool);
function changeFee(uint32 _newFee) external;
function cleanLiquidationFee() external view returns (uint256);
function collateralContract() external view returns (address);
function currentRateInfo()
external
view
returns (
uint32 lastBlock,
uint32 feeToProtocolRate,
uint64 lastTimestamp,
uint64 ratePerSec,
uint64 fullUtilizationRate
);
function decimals() external view returns (uint8);
function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool);
function deposit(uint256 _amount, address _receiver) external returns (uint256 _sharesReceived);
function dirtyLiquidationFee() external view returns (uint256);
function exchangeRateInfo() external view returns (uint32 lastTimestamp, uint224 exchangeRate);
function getConstants()
external
pure
returns (
uint256 _LTV_PRECISION,
uint256 _LIQ_PRECISION,
uint256 _UTIL_PREC,
uint256 _FEE_PRECISION,
uint256 _EXCHANGE_PRECISION,
uint64 _DEFAULT_INT,
uint16 _DEFAULT_PROTOCOL_FEE,
uint256 _MAX_PROTOCOL_FEE
);
function getImmutableAddressBool()
external
view
returns (
address _assetContract,
address _collateralContract,
address _oracleMultiply,
address _oracleDivide,
address _rateContract,
address _DEPLOYER_CONTRACT,
address _COMPTROLLER_ADDRESS,
address _FRAXLEND_WHITELIST,
bool _borrowerWhitelistActive,
bool _lenderWhitelistActive
);
function getImmutableUint256()
external
view
returns (
uint256 _oracleNormalization,
uint256 _maxLTV,
uint256 _cleanLiquidationFee,
uint256 _maturityDate,
uint256 _penaltyRate
);
function getPairAccounting()
external
view
returns (
uint128 _totalAssetAmount,
uint128 _totalAssetShares,
uint128 _totalBorrowAmount,
uint128 _totalBorrowShares,
uint256 _totalCollateral
);
function getUserSnapshot(address _address)
external
view
returns (uint256 _userAssetShares, uint256 _userBorrowShares, uint256 _userCollateralBalance);
function increaseAllowance(address spender, uint256 addedValue) external returns (bool);
function lenderWhitelistActive() external view returns (bool);
function leveragedPosition(
address _swapperAddress,
uint256 _borrowAmount,
uint256 _initialCollateralAmount,
uint256 _amountCollateralOutMin,
address[] memory _path
) external returns (uint256 _totalCollateralBalance);
function liquidate(uint128 _sharesToLiquidate, uint256 _deadline, address _borrower)
external
returns (uint256 _collateralForLiquidator);
function maturityDate() external view returns (uint256);
function maxLTV() external view returns (uint256);
function maxOracleDelay() external view returns (uint256);
function name() external view returns (string memory);
function oracleDivide() external view returns (address);
function oracleMultiply() external view returns (address);
function oracleNormalization() external view returns (uint256);
function owner() external view returns (address);
function pause() external;
function paused() external view returns (bool);
function penaltyRate() external view returns (uint256);
function rateContract() external view returns (address);
function redeem(uint256 _shares, address _receiver, address _owner) external returns (uint256 _amountToReturn);
function removeCollateral(uint256 _collateralAmount, address _receiver) external;
function renounceOwnership() external;
function repayAsset(uint256 _shares, address _borrower) external returns (uint256 _amountToRepay);
function repayAssetWithCollateral(
address _swapperAddress,
uint256 _collateralToSwap,
uint256 _amountAssetOutMin,
uint256 _swapDeadline,
address[] memory _path
) external returns (uint256 _amountAssetOut);
function setApprovedBorrowers(address[] memory _borrowers, bool _approval) external;
function setApprovedLenders(address[] memory _lenders, bool _approval) external;
function setMaxOracleDelay(uint256 _newDelay) external;
function setSwapper(address _swapper, bool _approval) external;
function setTimelock(address _newAddress) external;
function swappers(address) external view returns (bool);
function symbol() external view returns (string memory);
function toAssetAmount(uint256 _shares, bool _roundUp) external view returns (uint256);
function toAssetShares(uint256 _amount, bool _roundUp) external view returns (uint256);
function toBorrowAmount(uint256 _shares, bool _roundUp) external view returns (uint256);
function toBorrowShares(uint256 _amount, bool _roundUp) external view returns (uint256);
function totalAsset() external view returns (uint128 amount, uint128 shares);
function totalBorrow() external view returns (uint128 amount, uint128 shares);
function totalCollateral() external view returns (uint256);
function totalSupply() external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
function transferOwnership(address newOwner) external;
function unpause() external;
function updateExchangeRate() external returns (uint256 _exchangeRate);
function userBorrowShares(address) external view returns (uint256);
function userCollateralBalance(address) external view returns (uint256);
function version() external pure returns (uint256 _major, uint256 _minor, uint256 _patch);
function withdrawFees(uint128 _shares, address _recipient) external returns (uint256 _amountToTransfer);
}