refactoring of DefaultReserveInterestRateStrategy to follow the stuileguide

This commit is contained in:
andyk 2020-08-24 15:35:59 +03:00
parent dfe865fc76
commit da5b6738c1
2 changed files with 8 additions and 10 deletions

View File

@ -11,7 +11,7 @@ interface IReserveInterestRateStrategy {
* @dev returns the base variable borrow rate, in rays * @dev returns the base variable borrow rate, in rays
*/ */
function getBaseVariableBorrowRate() external view returns (uint256); function baseVariableBorrowRate() external view returns (uint256);
/** /**
* @dev calculates the liquidity, stable, and variable rates depending on the current utilization rate * @dev calculates the liquidity, stable, and variable rates depending on the current utilization rate

View File

@ -69,23 +69,23 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
* @dev accessors * @dev accessors
*/ */
function getVariableRateSlope1() external view returns (uint256) { function variableRateSlope1() external view returns (uint256) {
return _variableRateSlope1; return _variableRateSlope1;
} }
function getVariableRateSlope2() external view returns (uint256) { function variableRateSlope2() external view returns (uint256) {
return _variableRateSlope2; return _variableRateSlope2;
} }
function getStableRateSlope1() external view returns (uint256) { function stableRateSlope1() external view returns (uint256) {
return _stableRateSlope1; return _stableRateSlope1;
} }
function getStableRateSlope2() external view returns (uint256) { function stableRateSlope2() external view returns (uint256) {
return _stableRateSlope2; return _stableRateSlope2;
} }
function getBaseVariableBorrowRate() external override view returns (uint256) { function baseVariableBorrowRate() external override view returns (uint256) {
return _baseVariableBorrowRate; return _baseVariableBorrowRate;
} }
@ -121,7 +121,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 currentStableBorrowRate = 0; uint256 currentStableBorrowRate = 0;
uint256 currentLiquidityRate = 0; uint256 currentLiquidityRate = 0;
uint256 utilizationRate = (totalBorrows == 0 && availableLiquidity == 0) uint256 utilizationRate = totalBorrows == 0
? 0 ? 0
: totalBorrows.rayDiv(availableLiquidity.add(totalBorrows)); : totalBorrows.rayDiv(availableLiquidity.add(totalBorrows));
@ -157,9 +157,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
) )
.rayMul(utilizationRate); .rayMul(utilizationRate);
return (currentLiquidityRate, return (currentLiquidityRate, currentStableBorrowRate, currentVariableBorrowRate);
currentStableBorrowRate,
currentVariableBorrowRate);
} }
/** /**