Merge branch 'master' into feat/153-improve-docs

This commit is contained in:
eboado 2020-11-23 11:15:31 +01:00
commit 0bca8c6519
101 changed files with 3416 additions and 1721 deletions

View File

@ -1,4 +1,4 @@
FROM ethereum/solc:0.6.8 as build-deps
FROM ethereum/solc:0.6.12 as build-deps
FROM node:14
COPY --from=build-deps /usr/bin/solc /usr/bin/solc

View File

@ -49,7 +49,7 @@ const getCommonNetworkConfig = (networkName: eEthereumNetwork, networkId: number
const buidlerConfig: any = {
solc: {
version: '0.6.8',
version: '0.6.12',
optimizer: {enabled: true, runs: 200},
evmVersion: 'istanbul',
},

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
/**
* @dev Collection of functions related to the address type

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
pragma solidity 0.6.12;
/*
* @dev Provides information about the current execution context, including the

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IERC20} from './IERC20.sol';

View File

@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.6.8;
pragma solidity 0.6.12;
import {IERC20} from './IERC20.sol';
import {SafeMath} from './SafeMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './BaseAdminUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './UpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './Proxy.sol';
import '../contracts/Address.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './BaseAdminUpgradeabilityProxy.sol';
import './InitializableUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './BaseUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './BaseUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {LendingPool} from '../lendingpool/LendingPool.sol';
@ -31,9 +31,10 @@ contract ATokensAndRatesHelper is Ownable {
function initDeployment(
address[] calldata tokens,
string[] calldata symbols,
uint256[5][] calldata rates,
uint256[6][] calldata rates,
address incentivesController
) external onlyOwner {
require(tokens.length == symbols.length, 't Arrays not same length');
require(rates.length == symbols.length, 'r Arrays not same length');
for (uint256 i = 0; i < tokens.length; i++) {
@ -55,7 +56,8 @@ contract ATokensAndRatesHelper is Ownable {
rates[i][1],
rates[i][2],
rates[i][3],
rates[i][4]
rates[i][4],
rates[i][5]
)
)
);

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {StableDebtToken} from '../tokenization/StableDebtToken.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
library StringLib {
function concat(string memory a, string memory b) internal pure returns (string memory) {

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title IFlashLoanReceiver interface

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface IAaveIncentivesController {

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IChainlinkAggregator {
function latestAnswer() external view returns (int256);

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title LendingPoolAddressesProvider contract

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title LendingPoolAddressesProviderRegistry contract

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title ILendingRateOracle interface

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/************
@title IPriceOracle interface

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title IPriceOracleGetter interface

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title IReserveInterestRateStrategyInterface interface

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IUniswapExchange {
event TokenPurchase(

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol';
@ -26,14 +26,15 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
* @dev this constant represents the utilization rate at which the pool aims to obtain most competitive borrow rates.
* Expressed in ray
**/
uint256 public constant OPTIMAL_UTILIZATION_RATE = 0.8 * 1e27;
uint256 public immutable OPTIMAL_UTILIZATION_RATE;
/**
* @dev This constant represents the excess utilization rate above the optimal. It's always equal to
* 1-optimal utilization rate. Added as a constant here for gas optimizations.
* Expressed in ray
**/
uint256 public constant EXCESS_UTILIZATION_RATE = 0.2 * 1e27;
uint256 public immutable EXCESS_UTILIZATION_RATE;
ILendingPoolAddressesProvider public immutable addressesProvider;
@ -54,12 +55,16 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
constructor(
ILendingPoolAddressesProvider provider,
uint256 optimalUtilizationRate,
uint256 baseVariableBorrowRate,
uint256 variableRateSlope1,
uint256 variableRateSlope2,
uint256 stableRateSlope1,
uint256 stableRateSlope2
) public {
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate;
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate);
addressesProvider = provider;
_baseVariableBorrowRate = baseVariableBorrowRate;
_variableRateSlope1 = variableRateSlope1;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../dependencies/openzeppelin/contracts//SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts//IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import '../../dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import './BaseImmutableAdminUpgradeabilityProxy.sol';
import '../../dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
/**
* @title VersionedInitializable

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Errors} from '../helpers/Errors.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Errors} from '../helpers/Errors.sol';
/**

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title Errors library

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {DebtTokenBase} from '../../tokenization/base/DebtTokenBase.sol';
import {ReserveLogic} from '../logic/ReserveLogic.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {WadRayMath} from './WadRayMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Errors} from '../helpers/Errors.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Errors} from '../helpers/Errors.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
@ -10,7 +10,6 @@ import {ReserveConfiguration} from '../libraries/configuration/ReserveConfigurat
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol';
import 'hardhat/console.sol';
contract AaveProtocolDataProvider {
using ReserveConfiguration for ReserveConfiguration.Map;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {IWETH} from './interfaces/IWETH.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
contract IERC20DetailedBytes {
bytes32 public name;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';

View File

@ -1,3 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {

View File

@ -1,3 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IWETH {
function deposit() external payable;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IWETHGateway {
function depositETH(address onBehalfOf, uint16 referralCode) external payable;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
contract SelfdestructTransfer {
function destroyAndTransfer(address payable to) external payable {

View File

@ -13,7 +13,7 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity >=0.4.22 <=0.6.8;
pragma solidity >=0.4.22 <=0.6.12;
contract WETH9 {
string public name = 'Wrapped Ether';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
contract MockAggregator {
int256 private _latestAnswer;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface ChainlinkUSDETHOracleI {
event AnswerUpdated(int256 indexed current, uint256 indexed answerId);

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface GenericOracleI {
// ganache

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IExtendedPriceAggregator {
event AnswerUpdated(int256 indexed current, uint256 indexed roundId, uint256 timestamp);

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol';
import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IPriceOracle} from '../../interfaces/IPriceOracle.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {ERC20} from '../../dependencies/openzeppelin/contracts/ERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {ERC20} from '../../dependencies/openzeppelin/contracts/ERC20.sol';

View File

@ -1,4 +1,5 @@
pragma solidity >=0.4.22 <=0.6.8;
// SPDX-License-Identifier: agpl-3.0
pragma solidity >=0.4.22 <=0.6.12;
import {WETH9} from '../dependencies/weth/WETH9.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {AToken} from '../../tokenization/AToken.sol';
import {LendingPool} from '../../lendingpool/LendingPool.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {StableDebtToken} from '../../tokenization/StableDebtToken.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {VariableDebtToken} from '../../tokenization/VariableDebtToken.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IncentivizedERC20} from './IncentivizedERC20.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {AToken} from './AToken.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8;
pragma solidity 0.6.12;
import {Context} from '../dependencies/openzeppelin/contracts/Context.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {DebtTokenBase} from './base/DebtTokenBase.sol';
import {MathUtils} from '../libraries/math/MathUtils.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {DebtTokenBase} from './base/DebtTokenBase.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
interface IScaledBalanceToken {
/**

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
/**
* @title interface IStableDebtToken

View File

@ -1,3 +1,4 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6;
/**

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {IScaledBalanceToken} from './IScaledBalanceToken.sol';

View File

@ -71,7 +71,7 @@ const mainnetFork = MAINNET_FORK
const buidlerConfig: HardhatUserConfig = {
solidity: {
version: '0.6.8',
version: '0.6.12',
settings: {
optimizer: {enabled: true, runs: 200},
evmVersion: 'istanbul',

View File

@ -16,7 +16,6 @@ export const MAX_UINT_AMOUNT =
export const ONE_YEAR = '31536000';
export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
export const ONE_ADDRESS = '0x0000000000000000000000000000000000000001';
// ----------------
// PROTOCOL GLOBAL PARAMS
// ----------------

View File

@ -54,6 +54,7 @@ export const initReservesByHelper = async (
BigNumberish,
BigNumberish,
BigNumberish,
BigNumberish,
BigNumberish
][] = [];
const reservesDecimals: string[] = [];
@ -72,6 +73,7 @@ export const initReservesByHelper = async (
const [
,
{
optimalUtilizationRate,
baseVariableBorrowRate,
variableRateSlope1,
variableRateSlope2,
@ -83,6 +85,7 @@ export const initReservesByHelper = async (
tokens.push(tokenAddress);
symbols.push(assetSymbol);
strategyRates.push([
optimalUtilizationRate,
baseVariableBorrowRate,
variableRateSlope1,
variableRateSlope2,

View File

@ -263,6 +263,7 @@ export enum TokenContractId {
export interface IReserveParams extends IReserveBorrowParams, IReserveCollateralParams {}
export interface IReserveBorrowParams {
optimalUtilizationRate: string;
baseVariableBorrowRate: string;
variableRateSlope1: string;
variableRateSlope2: string;
@ -321,12 +322,8 @@ export enum EthereumNetwork {
}
export interface IProtocolGlobalConfig {
OptimalUtilizationRate: BigNumber;
ExcessUtilizationRate: BigNumber;
ApprovalAmountLendingPoolCore: string;
TokenDistributorPercentageBase: string;
MockUsdPriceInWei: string;
EthereumAddress: tEthereumAddress;
UsdAddress: tEthereumAddress;
NilAddress: tEthereumAddress;
OneAddress: tEthereumAddress;

View File

@ -33,12 +33,8 @@ export const CommonsConfig: ICommonConfiguration = {
ConfigName: 'Commons',
ProviderId: 0,
ProtocolGlobalParams: {
OptimalUtilizationRate: new BigNumber(0.8).times(RAY),
ExcessUtilizationRate: new BigNumber(0.2).times(RAY),
ApprovalAmountLendingPoolCore: '1000000000000000000000000000',
TokenDistributorPercentageBase: '10000',
MockUsdPriceInWei: '5848466240000000',
EthereumAddress: '0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE',
UsdAddress: '0x10F7Fc1F91Ba351f9C629c5947AD69bD03C05b96',
NilAddress: '0x0000000000000000000000000000000000000000',
OneAddress: '0x0000000000000000000000000000000000000001',

View File

@ -3,6 +3,7 @@ import {oneRay} from '../../helpers/constants';
import {IReserveParams} from '../../helpers/types';
export const strategyBase: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(3).multipliedBy(oneRay).toFixed(),
@ -17,6 +18,7 @@ export const strategyBase: IReserveParams = {
};
export const stablecoinStrategyBase: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1.5).multipliedBy(oneRay).toFixed(),
@ -31,6 +33,7 @@ export const stablecoinStrategyBase: IReserveParams = {
};
export const stablecoinStrategyCentralized: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.07).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.6).multipliedBy(oneRay).toFixed(),
@ -117,6 +120,7 @@ export const strategyREN: IReserveParams = {
};
export const stablecoinStrategySUSD: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0.01).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.04).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),
@ -174,6 +178,7 @@ export const stablecoinStrategyUSDT: IReserveParams = {
};
export const strategyWBTC: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(0.5).multipliedBy(oneRay).toFixed(),
@ -188,6 +193,7 @@ export const strategyWBTC: IReserveParams = {
};
export const strategyWETH: IReserveParams = {
optimalUtilizationRate: new BigNumber(0.8).multipliedBy(oneRay).toFixed(),
baseVariableBorrowRate: new BigNumber(0).multipliedBy(oneRay).toFixed(),
variableRateSlope1: new BigNumber(0.08).multipliedBy(oneRay).toFixed(),
variableRateSlope2: new BigNumber(1).multipliedBy(oneRay).toFixed(),

4902
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {

View File

@ -1,4 +1,4 @@
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
import {StableDebtToken} from '../../contracts/tokenization/StableDebtToken.sol';
import {IncentivizedERC20} from '../../contracts/tokenization/IncentivizedERC20.sol';

View File

@ -1,4 +1,4 @@
pragma solidity ^0.6.8;
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import {UserConfiguration} from '../../contracts/libraries/configuration/UserConfiguration.sol';

View File

@ -1,4 +1,4 @@
import {MAX_UINT_AMOUNT, ZERO_ADDRESS} from '../helpers/constants';
import {APPROVAL_AMOUNT_LENDING_POOL, MAX_UINT_AMOUNT, ZERO_ADDRESS} from '../helpers/constants';
import {convertToCurrencyDecimals} from '../helpers/contracts-helpers';
import {expect} from 'chai';
import {ethers} from 'ethers';
@ -6,8 +6,6 @@ import {RateMode, ProtocolErrors} from '../helpers/types';
import {makeSuite, TestEnv} from './helpers/make-suite';
import {CommonsConfig} from '../markets/aave/commons';
const APPROVAL_AMOUNT_LENDING_POOL =
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
const AAVE_REFERRAL = CommonsConfig.ProtocolGlobalParams.AaveReferral;
makeSuite('AToken: Transfer', (testEnv: TestEnv) => {

View File

@ -1,11 +1,7 @@
import {TestEnv, makeSuite} from './helpers/make-suite';
import {RAY} from '../helpers/constants';
import {APPROVAL_AMOUNT_LENDING_POOL, RAY} from '../helpers/constants';
import {convertToCurrencyDecimals} from '../helpers/contracts-helpers';
import {ProtocolErrors} from '../helpers/types';
import {CommonsConfig} from '../markets/aave/commons';
const APPROVAL_AMOUNT_LENDING_POOL =
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
const {expect} = require('chai');

View File

@ -1,16 +1,12 @@
import BigNumber from 'bignumber.js';
import {DRE} from '../helpers/misc-utils';
import {oneEther} from '../helpers/constants';
import {APPROVAL_AMOUNT_LENDING_POOL, oneEther} from '../helpers/constants';
import {convertToCurrencyDecimals} from '../helpers/contracts-helpers';
import {makeSuite} from './helpers/make-suite';
import {ProtocolErrors, RateMode} from '../helpers/types';
import {calcExpectedVariableDebtTokenBalance} from './helpers/utils/calculations';
import {getUserData, getReserveData} from './helpers/utils/helpers';
import {CommonsConfig} from '../markets/aave/commons';
const APPROVAL_AMOUNT_LENDING_POOL =
CommonsConfig.ProtocolGlobalParams.ApprovalAmountLendingPoolCore;
const chai = require('chai');
const {expect} = chai;

Some files were not shown because too many files have changed in this diff Show More