mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Replaced borrows with debt in comments and the InterestRateStrategy contract
This commit is contained in:
parent
4629dcd194
commit
eecb0b4fef
|
@ -108,16 +108,16 @@ contract ATokensAndRatesHelper is Ownable {
|
|||
}
|
||||
}
|
||||
|
||||
function enableBorrowingOnReserves(address[] calldata tokens, bool[] calldata stableBorrows)
|
||||
function enableBorrowingOnReserves(address[] calldata tokens, bool[] calldata stableBorrowingEnabled)
|
||||
external
|
||||
onlyOwner
|
||||
{
|
||||
require(stableBorrows.length == tokens.length);
|
||||
require(stableBorrowingEnabled.length == tokens.length);
|
||||
|
||||
for (uint256 i = 0; i < tokens.length; i++) {
|
||||
LendingPoolConfigurator(poolConfigurator).enableBorrowingOnReserve(
|
||||
tokens[i],
|
||||
stableBorrows[i]
|
||||
stableBorrowingEnabled[i]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
}
|
||||
|
||||
struct CalcInterestRatesLocalVars {
|
||||
uint256 totalBorrows;
|
||||
uint256 totalDebt;
|
||||
uint256 currentVariableBorrowRate;
|
||||
uint256 currentStableBorrowRate;
|
||||
uint256 currentLiquidityRate;
|
||||
|
@ -133,15 +133,15 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
{
|
||||
CalcInterestRatesLocalVars memory vars;
|
||||
|
||||
vars.totalBorrows = totalStableDebt.add(totalVariableDebt);
|
||||
vars.totalDebt = totalStableDebt.add(totalVariableDebt);
|
||||
vars.currentVariableBorrowRate = 0;
|
||||
vars.currentStableBorrowRate = 0;
|
||||
vars.currentLiquidityRate = 0;
|
||||
|
||||
uint256 utilizationRate =
|
||||
vars.totalBorrows == 0
|
||||
vars.totalDebt == 0
|
||||
? 0
|
||||
: vars.totalBorrows.rayDiv(availableLiquidity.add(vars.totalBorrows));
|
||||
: vars.totalDebt.rayDiv(availableLiquidity.add(vars.totalDebt));
|
||||
|
||||
vars.currentStableBorrowRate = ILendingRateOracle(addressesProvider.getLendingRateOracle())
|
||||
.getMarketBorrowRate(reserve);
|
||||
|
@ -184,7 +184,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev Calculates the overall borrow rate as the weighted average between the total variable borrows and total stable borrows
|
||||
* @dev Calculates the overall borrow rate as the weighted average between the total variable debt and total stable debt
|
||||
* @param totalStableDebt The total borrowed from the reserve a stable rate
|
||||
* @param totalVariableDebt The total borrowed from the reserve at a variable rate
|
||||
* @param currentVariableBorrowRate The current variable borrow rate of the reserve
|
||||
|
@ -197,16 +197,16 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
|
|||
uint256 currentVariableBorrowRate,
|
||||
uint256 currentAverageStableBorrowRate
|
||||
) internal pure returns (uint256) {
|
||||
uint256 totalBorrows = totalStableDebt.add(totalVariableDebt);
|
||||
uint256 totalDebt = totalStableDebt.add(totalVariableDebt);
|
||||
|
||||
if (totalBorrows == 0) return 0;
|
||||
if (totalDebt == 0) return 0;
|
||||
|
||||
uint256 weightedVariableRate = totalVariableDebt.wadToRay().rayMul(currentVariableBorrowRate);
|
||||
|
||||
uint256 weightedStableRate = totalStableDebt.wadToRay().rayMul(currentAverageStableBorrowRate);
|
||||
|
||||
uint256 overallBorrowRate =
|
||||
weightedVariableRate.add(weightedStableRate).rayDiv(totalBorrows.wadToRay());
|
||||
weightedVariableRate.add(weightedStableRate).rayDiv(totalDebt.wadToRay());
|
||||
|
||||
return overallBorrowRate;
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(borrows/index)
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
|
||||
* @return the scaled total supply
|
||||
**/
|
||||
function scaledTotalSupply() public view virtual override returns (uint256) {
|
||||
|
|
|
@ -112,7 +112,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
|
|||
}
|
||||
|
||||
/**
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(borrows/index)
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
|
||||
* @return the scaled total supply
|
||||
**/
|
||||
function scaledTotalSupply() public view virtual override returns (uint256) {
|
||||
|
|
|
@ -19,7 +19,7 @@ interface IScaledBalanceToken {
|
|||
function getScaledUserBalanceAndSupply(address user) external view returns (uint256, uint256);
|
||||
|
||||
/**
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(borrows/index)
|
||||
* @dev Returns the scaled total supply of the variable debt token. Represents sum(debt/index)
|
||||
* @return the scaled total supply
|
||||
**/
|
||||
function scaledTotalSupply() external view returns (uint256);
|
||||
|
|
Loading…
Reference in New Issue
Block a user