diff --git a/contracts/deployments/ATokensAndRatesHelper.sol b/contracts/deployments/ATokensAndRatesHelper.sol index 3aeef59f..37b8353b 100644 --- a/contracts/deployments/ATokensAndRatesHelper.sol +++ b/contracts/deployments/ATokensAndRatesHelper.sol @@ -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] ); } } diff --git a/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol b/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol index 05d98657..6f45004c 100644 --- a/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol +++ b/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol @@ -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; } diff --git a/contracts/protocol/tokenization/AToken.sol b/contracts/protocol/tokenization/AToken.sol index a5e36526..3fc62d2c 100644 --- a/contracts/protocol/tokenization/AToken.sol +++ b/contracts/protocol/tokenization/AToken.sol @@ -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) { diff --git a/contracts/protocol/tokenization/VariableDebtToken.sol b/contracts/protocol/tokenization/VariableDebtToken.sol index 44b68a3e..704bbc40 100644 --- a/contracts/protocol/tokenization/VariableDebtToken.sol +++ b/contracts/protocol/tokenization/VariableDebtToken.sol @@ -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) { diff --git a/contracts/protocol/tokenization/interfaces/IScaledBalanceToken.sol b/contracts/protocol/tokenization/interfaces/IScaledBalanceToken.sol index cbfb87e2..d5a1ba8e 100644 --- a/contracts/protocol/tokenization/interfaces/IScaledBalanceToken.sol +++ b/contracts/protocol/tokenization/interfaces/IScaledBalanceToken.sol @@ -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);