-
Notifications
You must be signed in to change notification settings - Fork 572
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #832 from aave/feat/3.0.2
3.0.2 Upgrade
- Loading branch information
Showing
25 changed files
with
751 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity ^0.8.0; | ||
|
||
import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; | ||
import {IDefaultInterestRateStrategy} from '../interfaces/IDefaultInterestRateStrategy.sol'; | ||
import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol'; | ||
import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; | ||
|
||
/** | ||
* @title ZeroReserveInterestRateStrategy contract | ||
* @author Aave | ||
* @notice Interest Rate Strategy contract, with all parameters zeroed. | ||
* @dev It returns zero liquidity and borrow rate. | ||
*/ | ||
contract ZeroReserveInterestRateStrategy is IDefaultInterestRateStrategy { | ||
/// @inheritdoc IDefaultInterestRateStrategy | ||
uint256 public constant OPTIMAL_USAGE_RATIO = 0; | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
uint256 public constant OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO = 0; | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
uint256 public constant MAX_EXCESS_USAGE_RATIO = 0; | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
uint256 public constant MAX_EXCESS_STABLE_TO_TOTAL_DEBT_RATIO = 0; | ||
|
||
IPoolAddressesProvider public immutable ADDRESSES_PROVIDER; | ||
|
||
// Base variable borrow rate when usage rate = 0. Expressed in ray | ||
uint256 internal constant _baseVariableBorrowRate = 0; | ||
|
||
// Slope of the variable interest curve when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO. Expressed in ray | ||
uint256 internal constant _variableRateSlope1 = 0; | ||
|
||
// Slope of the variable interest curve when usage ratio > OPTIMAL_USAGE_RATIO. Expressed in ray | ||
uint256 internal constant _variableRateSlope2 = 0; | ||
|
||
// Slope of the stable interest curve when usage ratio > 0 and <= OPTIMAL_USAGE_RATIO. Expressed in ray | ||
uint256 internal constant _stableRateSlope1 = 0; | ||
|
||
// Slope of the stable interest curve when usage ratio > OPTIMAL_USAGE_RATIO. Expressed in ray | ||
uint256 internal constant _stableRateSlope2 = 0; | ||
|
||
// Premium on top of `_variableRateSlope1` for base stable borrowing rate | ||
uint256 internal constant _baseStableRateOffset = 0; | ||
|
||
// Additional premium applied to stable rate when stable debt surpass `OPTIMAL_STABLE_TO_TOTAL_DEBT_RATIO` | ||
uint256 internal constant _stableRateExcessOffset = 0; | ||
|
||
/** | ||
* @dev Constructor. | ||
* @param provider The address of the PoolAddressesProvider contract | ||
*/ | ||
constructor(IPoolAddressesProvider provider) { | ||
ADDRESSES_PROVIDER = provider; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getVariableRateSlope1() external pure returns (uint256) { | ||
return _variableRateSlope1; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getVariableRateSlope2() external pure returns (uint256) { | ||
return _variableRateSlope2; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getStableRateSlope1() external pure returns (uint256) { | ||
return _stableRateSlope1; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getStableRateSlope2() external pure returns (uint256) { | ||
return _stableRateSlope2; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getStableRateExcessOffset() external pure returns (uint256) { | ||
return _stableRateExcessOffset; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getBaseStableBorrowRate() public pure returns (uint256) { | ||
return _variableRateSlope1 + _baseStableRateOffset; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getBaseVariableBorrowRate() external pure override returns (uint256) { | ||
return _baseVariableBorrowRate; | ||
} | ||
|
||
/// @inheritdoc IDefaultInterestRateStrategy | ||
function getMaxVariableBorrowRate() external pure override returns (uint256) { | ||
return _baseVariableBorrowRate + _variableRateSlope1 + _variableRateSlope2; | ||
} | ||
|
||
/// @inheritdoc IReserveInterestRateStrategy | ||
function calculateInterestRates( | ||
DataTypes.CalculateInterestRatesParams memory | ||
) public pure override returns (uint256, uint256, uint256) { | ||
return (0, 0, 0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.