Merge branch 'master' of gitlab.com:aave-tech/protocol-v2 into 155-use-the-delegationawareatoken-for-the-uni-deployment

This commit is contained in:
David Racero 2020-11-23 11:43:40 +01:00
commit 55cf8f9b0e
91 changed files with 567 additions and 573 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 FROM node:14
COPY --from=build-deps /usr/bin/solc /usr/bin/solc 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 = { const buidlerConfig: any = {
solc: { solc: {
version: '0.6.8', version: '0.6.12',
optimizer: {enabled: true, runs: 200}, optimizer: {enabled: true, runs: 200},
evmVersion: 'istanbul', evmVersion: 'istanbul',
}, },

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 * @dev Collection of functions related to the address type

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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. * @dev Interface of the ERC20 standard as defined in the EIP.

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 * @dev Wrappers over Solidity's arithmetic operations with added overflow

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,16 +1,18 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {LendingPool} from '../lendingpool/LendingPool.sol'; import {LendingPool} from '../protocol/lendingpool/LendingPool.sol';
import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol'; import {
import {LendingPoolConfigurator} from '../lendingpool/LendingPoolConfigurator.sol'; LendingPoolAddressesProvider
import {AToken} from '../tokenization/AToken.sol'; } from '../protocol/configuration/LendingPoolAddressesProvider.sol';
import {LendingPoolConfigurator} from '../protocol/lendingpool/LendingPoolConfigurator.sol';
import {AToken} from '../protocol/tokenization/AToken.sol';
import { import {
DefaultReserveInterestRateStrategy DefaultReserveInterestRateStrategy
} from '../lendingpool/DefaultReserveInterestRateStrategy.sol'; } from '../protocol/lendingpool/DefaultReserveInterestRateStrategy.sol';
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {StringLib} from '../libraries/helpers/StringLib.sol'; import {StringLib} from '../protocol/libraries/helpers/StringLib.sol';
contract ATokensAndRatesHelper is Ownable { contract ATokensAndRatesHelper is Ownable {
address payable private pool; address payable private pool;
@ -34,7 +36,6 @@ contract ATokensAndRatesHelper is Ownable {
uint256[6][] calldata rates, uint256[6][] calldata rates,
address incentivesController address incentivesController
) external onlyOwner { ) external onlyOwner {
require(tokens.length == symbols.length, 't Arrays not same length'); require(tokens.length == symbols.length, 't Arrays not same length');
require(rates.length == symbols.length, 'r Arrays not same length'); require(rates.length == symbols.length, 'r Arrays not same length');
for (uint256 i = 0; i < tokens.length; i++) { for (uint256 i = 0; i < tokens.length; i++) {

View File

@ -1,12 +1,12 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {StableDebtToken} from '../tokenization/StableDebtToken.sol'; import {StableDebtToken} from '../protocol/tokenization/StableDebtToken.sol';
import {VariableDebtToken} from '../tokenization/VariableDebtToken.sol'; import {VariableDebtToken} from '../protocol/tokenization/VariableDebtToken.sol';
import {LendingRateOracle} from '../mocks/oracle/LendingRateOracle.sol'; import {LendingRateOracle} from '../mocks/oracle/LendingRateOracle.sol';
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {StringLib} from '../libraries/helpers/StringLib.sol'; import {StringLib} from '../protocol/libraries/helpers/StringLib.sol';
contract StableAndVariableTokensHelper is Ownable { contract StableAndVariableTokensHelper is Ownable {
address payable private pool; address payable private pool;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';

View File

@ -1,15 +1,15 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../protocol/libraries/logic/ReserveLogic.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol';
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../protocol/libraries/configuration/UserConfiguration.sol';
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol'; import {IStableDebtToken} from '../protocol/tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol'; import {IVariableDebtToken} from '../protocol/tokenization/interfaces/IVariableDebtToken.sol';
contract AaveProtocolDataProvider { contract AaveProtocolDataProvider {
using ReserveConfiguration for ReserveConfiguration.Map; using ReserveConfiguration for ReserveConfiguration.Map;
@ -80,10 +80,8 @@ contract AaveProtocolDataProvider {
bool isFrozen bool isFrozen
) )
{ {
ReserveConfiguration.Map memory configuration = ILendingPool( ReserveConfiguration.Map memory configuration =
ADDRESSES_PROVIDER.getLendingPool() ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getConfiguration(asset);
)
.getConfiguration(asset);
(ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor) = configuration (ltv, liquidationThreshold, liquidationBonus, decimals, reserveFactor) = configuration
.getParamsMemory(); .getParamsMemory();
@ -110,8 +108,8 @@ contract AaveProtocolDataProvider {
uint40 lastUpdateTimestamp uint40 lastUpdateTimestamp
) )
{ {
ReserveLogic.ReserveData memory reserve = ILendingPool(ADDRESSES_PROVIDER.getLendingPool()) ReserveLogic.ReserveData memory reserve =
.getReserveData(asset); ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getReserveData(asset);
return ( return (
IERC20Detailed(asset).balanceOf(reserve.aTokenAddress), IERC20Detailed(asset).balanceOf(reserve.aTokenAddress),
@ -142,11 +140,11 @@ contract AaveProtocolDataProvider {
bool usageAsCollateralEnabled bool usageAsCollateralEnabled
) )
{ {
ReserveLogic.ReserveData memory reserve = ILendingPool(ADDRESSES_PROVIDER.getLendingPool()) ReserveLogic.ReserveData memory reserve =
.getReserveData(asset); ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getReserveData(asset);
UserConfiguration.Map memory userConfig = ILendingPool(ADDRESSES_PROVIDER.getLendingPool()) UserConfiguration.Map memory userConfig =
.getUserConfiguration(user); ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getUserConfiguration(user);
currentATokenBalance = IERC20Detailed(reserve.aTokenAddress).balanceOf(user); currentATokenBalance = IERC20Detailed(reserve.aTokenAddress).balanceOf(user);
currentVariableDebt = IERC20Detailed(reserve.variableDebtTokenAddress).balanceOf(user); currentVariableDebt = IERC20Detailed(reserve.variableDebtTokenAddress).balanceOf(user);
@ -170,8 +168,8 @@ contract AaveProtocolDataProvider {
address variableDebtTokenAddress address variableDebtTokenAddress
) )
{ {
ReserveLogic.ReserveData memory reserve = ILendingPool(ADDRESSES_PROVIDER.getLendingPool()) ReserveLogic.ReserveData memory reserve =
.getReserveData(asset); ILendingPool(ADDRESSES_PROVIDER.getLendingPool()).getReserveData(asset);
return ( return (
reserve.aTokenAddress, reserve.aTokenAddress,

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
@ -7,17 +7,17 @@ import {IUiPoolDataProvider} from './interfaces/IUiPoolDataProvider.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol';
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol'; import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol';
import {IAToken} from '../tokenization/interfaces/IAToken.sol'; import {IAToken} from '../protocol/tokenization/interfaces/IAToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol'; import {IVariableDebtToken} from '../protocol/tokenization/interfaces/IVariableDebtToken.sol';
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol'; import {IStableDebtToken} from '../protocol/tokenization/interfaces/IStableDebtToken.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {WadRayMath} from '../protocol/libraries/math/WadRayMath.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../protocol/libraries/logic/ReserveLogic.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol';
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../protocol/libraries/configuration/UserConfiguration.sol';
import { import {
DefaultReserveInterestRateStrategy DefaultReserveInterestRateStrategy
} from '../lendingpool/DefaultReserveInterestRateStrategy.sol'; } from '../protocol/lendingpool/DefaultReserveInterestRateStrategy.sol';
contract UiPoolDataProvider is IUiPoolDataProvider { contract UiPoolDataProvider is IUiPoolDataProvider {
using WadRayMath for uint256; using WadRayMath for uint256;
@ -46,8 +46,8 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
function getReservesData(ILendingPoolAddressesProvider provider, address user) function getReservesData(ILendingPoolAddressesProvider provider, address user)
external external
override
view view
override
returns ( returns (
AggregatedReserveData[] memory, AggregatedReserveData[] memory,
UserReserveData[] memory, UserReserveData[] memory,
@ -60,18 +60,16 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
UserConfiguration.Map memory userConfig = lendingPool.getUserConfiguration(user); UserConfiguration.Map memory userConfig = lendingPool.getUserConfiguration(user);
AggregatedReserveData[] memory reservesData = new AggregatedReserveData[](reserves.length); AggregatedReserveData[] memory reservesData = new AggregatedReserveData[](reserves.length);
UserReserveData[] memory userReservesData = new UserReserveData[]( UserReserveData[] memory userReservesData =
user != address(0) ? reserves.length : 0 new UserReserveData[](user != address(0) ? reserves.length : 0);
);
for (uint256 i = 0; i < reserves.length; i++) { for (uint256 i = 0; i < reserves.length; i++) {
AggregatedReserveData memory reserveData = reservesData[i]; AggregatedReserveData memory reserveData = reservesData[i];
reserveData.underlyingAsset = reserves[i]; reserveData.underlyingAsset = reserves[i];
// reserve current state // reserve current state
ReserveLogic.ReserveData memory baseData = lendingPool.getReserveData( ReserveLogic.ReserveData memory baseData =
reserveData.underlyingAsset lendingPool.getReserveData(reserveData.underlyingAsset);
);
reserveData.liquidityIndex = baseData.liquidityIndex; reserveData.liquidityIndex = baseData.liquidityIndex;
reserveData.variableBorrowIndex = baseData.variableBorrowIndex; reserveData.variableBorrowIndex = baseData.variableBorrowIndex;
reserveData.liquidityRate = baseData.currentLiquidityRate; reserveData.liquidityRate = baseData.currentLiquidityRate;

View File

@ -1,15 +1,15 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {IWETH} from './interfaces/IWETH.sol'; import {IWETH} from './interfaces/IWETH.sol';
import {IWETHGateway} from './interfaces/IWETHGateway.sol'; import {IWETHGateway} from './interfaces/IWETHGateway.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol';
import {IAToken} from '../tokenization/interfaces/IAToken.sol'; import {IAToken} from '../protocol/tokenization/interfaces/IAToken.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../protocol/libraries/logic/ReserveLogic.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol';
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../protocol/libraries/configuration/UserConfiguration.sol';
import {Helpers} from '../libraries/helpers/Helpers.sol'; import {Helpers} from '../protocol/libraries/helpers/Helpers.sol';
import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
@ -40,7 +40,7 @@ contract WETHGateway is IWETHGateway, Ownable {
* @param onBehalfOf address of the user who will receive the aTokens representing the deposit * @param onBehalfOf address of the user who will receive the aTokens representing the deposit
* @param referralCode integrators are assigned a referral code and can potentially receive rewards. * @param referralCode integrators are assigned a referral code and can potentially receive rewards.
**/ **/
function depositETH(address onBehalfOf, uint16 referralCode) external override payable { function depositETH(address onBehalfOf, uint16 referralCode) external payable override {
WETH.deposit{value: msg.value}(); WETH.deposit{value: msg.value}();
POOL.deposit(address(WETH), msg.value, onBehalfOf, referralCode); POOL.deposit(address(WETH), msg.value, onBehalfOf, referralCode);
} }
@ -74,16 +74,14 @@ contract WETHGateway is IWETHGateway, Ownable {
uint256 amount, uint256 amount,
uint256 rateMode, uint256 rateMode,
address onBehalfOf address onBehalfOf
) external override payable { ) external payable override {
(uint256 stableDebt, uint256 variableDebt) = Helpers.getUserCurrentDebtMemory( (uint256 stableDebt, uint256 variableDebt) =
onBehalfOf, Helpers.getUserCurrentDebtMemory(onBehalfOf, POOL.getReserveData(address(WETH)));
POOL.getReserveData(address(WETH))
);
uint256 paybackAmount = ReserveLogic.InterestRateMode(rateMode) == uint256 paybackAmount =
ReserveLogic.InterestRateMode.STABLE ReserveLogic.InterestRateMode(rateMode) == ReserveLogic.InterestRateMode.STABLE
? stableDebt ? stableDebt
: variableDebt; : variableDebt;
if (amount < paybackAmount) { if (amount < paybackAmount) {
paybackAmount = amount; paybackAmount = amount;

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
@ -9,7 +9,7 @@ import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol';
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol';
/** /**
* @title WalletBalanceProvider contract * @title WalletBalanceProvider contract

View File

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

View File

@ -1,9 +1,9 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ReserveLogic} from '../../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../../protocol/libraries/logic/ReserveLogic.sol';
interface IUiPoolDataProvider { interface IUiPoolDataProvider {
struct AggregatedReserveData { struct AggregatedReserveData {

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
contract SelfdestructTransfer { contract SelfdestructTransfer {
function destroyAndTransfer(address payable to) external payable { 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 // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // 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 { contract WETH9 {
string public name = 'Wrapped Ether'; string public name = 'Wrapped Ether';

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,4 +1,4 @@
pragma solidity >=0.4.22 <=0.6.8; pragma solidity >=0.4.22 <=0.6.12;
import {WETH9} from '../dependencies/weth/WETH9.sol'; import {WETH9} from '../dependencies/weth/WETH9.sol';

View File

@ -1,8 +1,8 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {AToken} from '../../tokenization/AToken.sol'; import {AToken} from '../../protocol/tokenization/AToken.sol';
import {LendingPool} from '../../lendingpool/LendingPool.sol'; import {LendingPool} from '../../protocol/lendingpool/LendingPool.sol';
contract MockAToken is AToken { contract MockAToken is AToken {
constructor( constructor(
@ -24,7 +24,7 @@ contract MockAToken is AToken {
) )
{} {}
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return 0x2; return 0x2;
} }

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {StableDebtToken} from '../../tokenization/StableDebtToken.sol'; import {StableDebtToken} from '../../protocol/tokenization/StableDebtToken.sol';
contract MockStableDebtToken is StableDebtToken { contract MockStableDebtToken is StableDebtToken {
constructor( constructor(
@ -15,7 +15,7 @@ contract MockStableDebtToken is StableDebtToken {
StableDebtToken(_pool, _underlyingAssetAddress, _tokenName, _tokenSymbol, incentivesController) StableDebtToken(_pool, _underlyingAssetAddress, _tokenName, _tokenSymbol, incentivesController)
{} {}
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return 0x2; return 0x2;
} }
} }

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {VariableDebtToken} from '../../tokenization/VariableDebtToken.sol'; import {VariableDebtToken} from '../../protocol/tokenization/VariableDebtToken.sol';
contract MockVariableDebtToken is VariableDebtToken { contract MockVariableDebtToken is VariableDebtToken {
constructor( constructor(
@ -21,7 +21,7 @@ contract MockVariableDebtToken is VariableDebtToken {
) )
{} {}
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return 0x2; return 0x2;
} }
} }

View File

@ -1,13 +1,13 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol';
// Prettier ignore to prevent buidler flatter bug // Prettier ignore to prevent buidler flatter bug
// prettier-ignore // prettier-ignore
import {InitializableImmutableAdminUpgradeabilityProxy} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; import {InitializableImmutableAdminUpgradeabilityProxy} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
/** /**
* @title LendingPoolAddressesProvider contract * @title LendingPoolAddressesProvider contract
@ -33,10 +33,11 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @param implementationAddress The address of the implementation if we want it covered by a proxy * @param implementationAddress The address of the implementation if we want it covered by a proxy
* address(0) if we don't want a proxy covering * address(0) if we don't want a proxy covering
*/ */
function setAddressAsProxy( function setAddressAsProxy(bytes32 id, address implementationAddress)
bytes32 id, external
address implementationAddress override
) external override onlyOwner { onlyOwner
{
_updateImpl(id, implementationAddress); _updateImpl(id, implementationAddress);
emit AddressSet(id, implementationAddress, true); emit AddressSet(id, implementationAddress, true);
} }
@ -46,10 +47,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @param id The id * @param id The id
* @param newAddress The address to set, pass address(0) if a proxy is needed * @param newAddress The address to set, pass address(0) if a proxy is needed
*/ */
function setAddress( function setAddress(bytes32 id, address newAddress) external override onlyOwner {
bytes32 id,
address newAddress
) external override onlyOwner {
_addresses[id] = newAddress; _addresses[id] = newAddress;
emit AddressSet(id, newAddress, false); emit AddressSet(id, newAddress, false);
} }
@ -58,7 +56,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @dev Returns an address by id * @dev Returns an address by id
* @return The address * @return The address
*/ */
function getAddress(bytes32 id) public override view returns (address) { function getAddress(bytes32 id) public view override returns (address) {
return _addresses[id]; return _addresses[id];
} }
@ -66,7 +64,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @dev returns the address of the LendingPool proxy * @dev returns the address of the LendingPool proxy
* @return the lending pool proxy address * @return the lending pool proxy address
**/ **/
function getLendingPool() external override view returns (address) { function getLendingPool() external view override returns (address) {
return getAddress(LENDING_POOL); return getAddress(LENDING_POOL);
} }
@ -83,7 +81,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @dev returns the address of the LendingPoolConfigurator proxy * @dev returns the address of the LendingPoolConfigurator proxy
* @return the lending pool configurator proxy address * @return the lending pool configurator proxy address
**/ **/
function getLendingPoolConfigurator() external override view returns (address) { function getLendingPoolConfigurator() external view override returns (address) {
return getAddress(LENDING_POOL_CONFIGURATOR); return getAddress(LENDING_POOL_CONFIGURATOR);
} }
@ -103,7 +101,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* @return the address of the Lending pool collateral manager * @return the address of the Lending pool collateral manager
**/ **/
function getLendingPoolCollateralManager() external override view returns (address) { function getLendingPoolCollateralManager() external view override returns (address) {
return getAddress(LENDING_POOL_COLLATERAL_MANAGER); return getAddress(LENDING_POOL_COLLATERAL_MANAGER);
} }
@ -121,7 +119,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
* hence the upgradable proxy pattern is not used * hence the upgradable proxy pattern is not used
**/ **/
function getPoolAdmin() external override view returns (address) { function getPoolAdmin() external view override returns (address) {
return getAddress(POOL_ADMIN); return getAddress(POOL_ADMIN);
} }
@ -130,7 +128,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
emit ConfigurationAdminUpdated(admin); emit ConfigurationAdminUpdated(admin);
} }
function getEmergencyAdmin() external override view returns (address) { function getEmergencyAdmin() external view override returns (address) {
return getAddress(EMERGENCY_ADMIN); return getAddress(EMERGENCY_ADMIN);
} }
@ -139,7 +137,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
emit EmergencyAdminUpdated(emergencyAdmin); emit EmergencyAdminUpdated(emergencyAdmin);
} }
function getPriceOracle() external override view returns (address) { function getPriceOracle() external view override returns (address) {
return getAddress(PRICE_ORACLE); return getAddress(PRICE_ORACLE);
} }
@ -148,7 +146,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
emit PriceOracleUpdated(priceOracle); emit PriceOracleUpdated(priceOracle);
} }
function getLendingRateOracle() external override view returns (address) { function getLendingRateOracle() external view override returns (address) {
return getAddress(LENDING_RATE_ORACLE); return getAddress(LENDING_RATE_ORACLE);
} }
@ -165,9 +163,8 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider
function _updateImpl(bytes32 id, address newAddress) internal { function _updateImpl(bytes32 id, address newAddress) internal {
address payable proxyAddress = payable(_addresses[id]); address payable proxyAddress = payable(_addresses[id]);
InitializableImmutableAdminUpgradeabilityProxy proxy =
InitializableImmutableAdminUpgradeabilityProxy proxy InitializableImmutableAdminUpgradeabilityProxy(proxyAddress);
= InitializableImmutableAdminUpgradeabilityProxy(proxyAddress);
bytes memory params = abi.encodeWithSignature('initialize(address)', address(this)); bytes memory params = abi.encodeWithSignature('initialize(address)', address(this));
if (proxyAddress == address(0)) { if (proxyAddress == address(0)) {

View File

@ -1,10 +1,10 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol';
import { import {
ILendingPoolAddressesProviderRegistry ILendingPoolAddressesProviderRegistry
} from '../interfaces/ILendingPoolAddressesProviderRegistry.sol'; } from '../../interfaces/ILendingPoolAddressesProviderRegistry.sol';
import {Errors} from '../libraries/helpers/Errors.sol'; import {Errors} from '../libraries/helpers/Errors.sol';
/** /**
@ -24,8 +24,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
**/ **/
function isAddressesProviderRegistered(address provider) function isAddressesProviderRegistered(address provider)
external external
override
view view
override
returns (uint256) returns (uint256)
{ {
return _addressesProviders[provider]; return _addressesProviders[provider];
@ -35,7 +35,7 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
* @dev returns the list of active addressesProviders * @dev returns the list of active addressesProviders
* @return the list of addressesProviders, potentially containing address(0) elements * @return the list of addressesProviders, potentially containing address(0) elements
**/ **/
function getAddressesProvidersList() external override view returns (address[] memory) { function getAddressesProvidersList() external view override returns (address[] memory) {
address[] memory addressesProvidersList = _addressesProvidersList; address[] memory addressesProvidersList = _addressesProvidersList;
uint256 maxLength = addressesProvidersList.length; uint256 maxLength = addressesProvidersList.length;
@ -95,8 +95,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP
*/ */
function getAddressesProviderIdByAddress(address addressesProvider) function getAddressesProviderIdByAddress(address addressesProvider)
external external
override
view view
override
returns (uint256) returns (uint256)
{ {
return _addressesProviders[addressesProvider]; return _addressesProviders[addressesProvider];

View File

@ -1,12 +1,12 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IReserveInterestRateStrategy} from '../interfaces/IReserveInterestRateStrategy.sol'; import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol'; import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol'; import {LendingPoolAddressesProvider} from '../configuration/LendingPoolAddressesProvider.sol';
import {ILendingRateOracle} from '../interfaces/ILendingRateOracle.sol'; import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol';
/** /**
* @title DefaultReserveInterestRateStrategy contract * @title DefaultReserveInterestRateStrategy contract
@ -59,7 +59,6 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 stableRateSlope1, uint256 stableRateSlope1,
uint256 stableRateSlope2 uint256 stableRateSlope2
) public { ) public {
OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate; OPTIMAL_UTILIZATION_RATE = optimalUtilizationRate;
EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate); EXCESS_UTILIZATION_RATE = WadRayMath.ray().sub(optimalUtilizationRate);
addressesProvider = provider; addressesProvider = provider;
@ -90,11 +89,11 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
return _stableRateSlope2; return _stableRateSlope2;
} }
function baseVariableBorrowRate() external override view returns (uint256) { function baseVariableBorrowRate() external view override returns (uint256) {
return _baseVariableBorrowRate; return _baseVariableBorrowRate;
} }
function getMaxVariableBorrowRate() external override view returns (uint256) { function getMaxVariableBorrowRate() external view override returns (uint256) {
return _baseVariableBorrowRate.add(_variableRateSlope1).add(_variableRateSlope2); return _baseVariableBorrowRate.add(_variableRateSlope1).add(_variableRateSlope2);
} }
@ -127,8 +126,8 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 reserveFactor uint256 reserveFactor
) )
external external
override
view view
override
returns ( returns (
uint256, uint256,
uint256, uint256,
@ -142,17 +141,17 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
vars.currentStableBorrowRate = 0; vars.currentStableBorrowRate = 0;
vars.currentLiquidityRate = 0; vars.currentLiquidityRate = 0;
uint256 utilizationRate = vars.totalBorrows == 0 uint256 utilizationRate =
? 0 vars.totalBorrows == 0
: vars.totalBorrows.rayDiv(availableLiquidity.add(vars.totalBorrows)); ? 0
: vars.totalBorrows.rayDiv(availableLiquidity.add(vars.totalBorrows));
vars.currentStableBorrowRate = ILendingRateOracle(addressesProvider.getLendingRateOracle()) vars.currentStableBorrowRate = ILendingRateOracle(addressesProvider.getLendingRateOracle())
.getMarketBorrowRate(reserve); .getMarketBorrowRate(reserve);
if (utilizationRate > OPTIMAL_UTILIZATION_RATE) { if (utilizationRate > OPTIMAL_UTILIZATION_RATE) {
uint256 excessUtilizationRateRatio = utilizationRate.sub(OPTIMAL_UTILIZATION_RATE).rayDiv( uint256 excessUtilizationRateRatio =
EXCESS_UTILIZATION_RATE utilizationRate.sub(OPTIMAL_UTILIZATION_RATE).rayDiv(EXCESS_UTILIZATION_RATE);
);
vars.currentStableBorrowRate = vars.currentStableBorrowRate.add(_stableRateSlope1).add( vars.currentStableBorrowRate = vars.currentStableBorrowRate.add(_stableRateSlope1).add(
_stableRateSlope2.rayMul(excessUtilizationRateRatio) _stableRateSlope2.rayMul(excessUtilizationRateRatio)
@ -209,9 +208,8 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 weightedStableRate = totalStableDebt.wadToRay().rayMul(currentAverageStableBorrowRate); uint256 weightedStableRate = totalStableDebt.wadToRay().rayMul(currentAverageStableBorrowRate);
uint256 overallBorrowRate = weightedVariableRate.add(weightedStableRate).rayDiv( uint256 overallBorrowRate =
totalBorrows.wadToRay() weightedVariableRate.add(weightedStableRate).rayDiv(totalBorrows.wadToRay());
);
return overallBorrowRate; return overallBorrowRate;
} }

View File

@ -1,11 +1,11 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {IAToken} from '../tokenization/interfaces/IAToken.sol'; import {IAToken} from '../tokenization/interfaces/IAToken.sol';
import {Helpers} from '../libraries/helpers/Helpers.sol'; import {Helpers} from '../libraries/helpers/Helpers.sol';
import {Errors} from '../libraries/helpers/Errors.sol'; import {Errors} from '../libraries/helpers/Errors.sol';
@ -19,13 +19,13 @@ import {UserConfiguration} from '../libraries/configuration/UserConfiguration.so
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol'; import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol'; import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol';
import {DebtTokenBase} from '../tokenization/base/DebtTokenBase.sol'; import {DebtTokenBase} from '../tokenization/base/DebtTokenBase.sol';
import {IFlashLoanReceiver} from '../flashloan/interfaces/IFlashLoanReceiver.sol'; import {IFlashLoanReceiver} from '../../flashloan/interfaces/IFlashLoanReceiver.sol';
import {LendingPoolCollateralManager} from './LendingPoolCollateralManager.sol'; import {LendingPoolCollateralManager} from './LendingPoolCollateralManager.sol';
import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol'; import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol';
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {LendingPoolStorage} from './LendingPoolStorage.sol'; import {LendingPoolStorage} from './LendingPoolStorage.sol';
import {Address} from '../dependencies/openzeppelin/contracts/Address.sol'; import {Address} from '../../dependencies/openzeppelin/contracts/Address.sol';
/** /**
* @title LendingPool contract * @title LendingPool contract
@ -81,7 +81,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
require(!_paused, Errors.LP_IS_PAUSED); require(!_paused, Errors.LP_IS_PAUSED);
} }
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return LENDINGPOOL_REVISION; return LENDINGPOOL_REVISION;
} }
@ -188,7 +188,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
* @param referralCode a referral code for integrators * @param referralCode a referral code for integrators
* @param onBehalfOf address of the user who will receive the debt. Should be the address of the borrower itself * @param onBehalfOf address of the user who will receive the debt. Should be the address of the borrower itself
* calling the function if he wants to borrow against his own collateral, or the address of the credit delegator * calling the function if he wants to borrow against his own collateral, or the address of the credit delegator
* if he has been given credit delegation allowance * if he has been given credit delegation allowance
**/ **/
function borrow( function borrow(
address asset, address asset,
@ -243,9 +243,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
); );
//default to max amount //default to max amount
uint256 paybackAmount = interestRateMode == ReserveLogic.InterestRateMode.STABLE uint256 paybackAmount =
? stableDebt interestRateMode == ReserveLogic.InterestRateMode.STABLE ? stableDebt : variableDebt;
: variableDebt;
if (amount < paybackAmount) { if (amount < paybackAmount) {
paybackAmount = amount; paybackAmount = amount;
@ -418,16 +417,17 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
address collateralManager = _addressesProvider.getLendingPoolCollateralManager(); address collateralManager = _addressesProvider.getLendingPoolCollateralManager();
//solium-disable-next-line //solium-disable-next-line
(bool success, bytes memory result) = collateralManager.delegatecall( (bool success, bytes memory result) =
abi.encodeWithSignature( collateralManager.delegatecall(
'liquidationCall(address,address,address,uint256,bool)', abi.encodeWithSignature(
collateral, 'liquidationCall(address,address,address,uint256,bool)',
asset, collateral,
user, asset,
purchaseAmount, user,
receiveAToken purchaseAmount,
) receiveAToken
); )
);
require(success, Errors.LP_LIQUIDATION_CALL_FAILED); require(success, Errors.LP_LIQUIDATION_CALL_FAILED);
(uint256 returnCode, string memory returnMessage) = abi.decode(result, (uint256, string)); (uint256 returnCode, string memory returnMessage) = abi.decode(result, (uint256, string));
@ -551,8 +551,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
**/ **/
function getReserveData(address asset) function getReserveData(address asset)
external external
override
view view
override
returns (ReserveLogic.ReserveData memory) returns (ReserveLogic.ReserveData memory)
{ {
return _reserves[asset]; return _reserves[asset];
@ -570,8 +570,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
**/ **/
function getUserAccountData(address user) function getUserAccountData(address user)
external external
override
view view
override
returns ( returns (
uint256 totalCollateralETH, uint256 totalCollateralETH,
uint256 totalDebtETH, uint256 totalDebtETH,
@ -610,8 +610,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
**/ **/
function getConfiguration(address asset) function getConfiguration(address asset)
external external
override
view view
override
returns (ReserveConfiguration.Map memory) returns (ReserveConfiguration.Map memory)
{ {
return _reserves[asset].configuration; return _reserves[asset].configuration;
@ -624,8 +624,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
**/ **/
function getUserConfiguration(address user) function getUserConfiguration(address user)
external external
override
view view
override
returns (UserConfiguration.Map memory) returns (UserConfiguration.Map memory)
{ {
return _usersConfig[user]; return _usersConfig[user];
@ -638,9 +638,9 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
*/ */
function getReserveNormalizedIncome(address asset) function getReserveNormalizedIncome(address asset)
external external
view
virtual virtual
override override
view
returns (uint256) returns (uint256)
{ {
return _reserves[asset].getNormalizedIncome(); return _reserves[asset].getNormalizedIncome();
@ -653,8 +653,8 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
*/ */
function getReserveNormalizedVariableDebt(address asset) function getReserveNormalizedVariableDebt(address asset)
external external
override
view view
override
returns (uint256) returns (uint256)
{ {
return _reserves[asset].getNormalizedDebt(); return _reserves[asset].getNormalizedDebt();
@ -663,14 +663,14 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
/** /**
* @dev Returns if the LendingPool is paused * @dev Returns if the LendingPool is paused
*/ */
function paused() external override view returns (bool) { function paused() external view override returns (bool) {
return _paused; return _paused;
} }
/** /**
* @dev returns the list of the initialized reserves * @dev returns the list of the initialized reserves
**/ **/
function getReservesList() external override view returns (address[] memory) { function getReservesList() external view override returns (address[] memory) {
address[] memory _activeReserves = new address[](_reservesCount); address[] memory _activeReserves = new address[](_reservesCount);
for (uint256 i = 0; i < _reservesCount; i++) { for (uint256 i = 0; i < _reservesCount; i++) {
@ -682,7 +682,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
/** /**
* @dev returns the addresses provider * @dev returns the addresses provider
**/ **/
function getAddressesProvider() external override view returns (ILendingPoolAddressesProvider) { function getAddressesProvider() external view override returns (ILendingPoolAddressesProvider) {
return _addressesProvider; return _addressesProvider;
} }
@ -815,9 +815,10 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
address oracle = _addressesProvider.getPriceOracle(); address oracle = _addressesProvider.getPriceOracle();
uint256 amountInETH = IPriceOracleGetter(oracle).getAssetPrice(vars.asset).mul(vars.amount).div( uint256 amountInETH =
10**reserve.configuration.getDecimals() IPriceOracleGetter(oracle).getAssetPrice(vars.asset).mul(vars.amount).div(
); 10**reserve.configuration.getDecimals()
);
ValidationLogic.validateBorrow( ValidationLogic.validateBorrow(
vars.asset, vars.asset,

View File

@ -1,20 +1,20 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../dependencies/openzeppelin/contracts//SafeMath.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts//IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts//IERC20.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {IAToken} from '../tokenization/interfaces/IAToken.sol'; import {IAToken} from '../tokenization/interfaces/IAToken.sol';
import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol'; import {IStableDebtToken} from '../tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol'; import {IVariableDebtToken} from '../tokenization/interfaces/IVariableDebtToken.sol';
import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol'; import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol';
import {GenericLogic} from '../libraries/logic/GenericLogic.sol'; import {GenericLogic} from '../libraries/logic/GenericLogic.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
import {Helpers} from '../libraries/helpers/Helpers.sol'; import {Helpers} from '../libraries/helpers/Helpers.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol'; import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {Errors} from '../libraries/helpers/Errors.sol'; import {Errors} from '../libraries/helpers/Errors.sol';
import {ValidationLogic} from '../libraries/logic/ValidationLogic.sol'; import {ValidationLogic} from '../libraries/logic/ValidationLogic.sol';
import {LendingPoolStorage} from './LendingPoolStorage.sol'; import {LendingPoolStorage} from './LendingPoolStorage.sol';
@ -98,7 +98,7 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
* @dev as the contract extends the VersionedInitializable contract to match the state * @dev as the contract extends the VersionedInitializable contract to match the state
* of the LendingPool contract, the getRevision() function is needed. * of the LendingPool contract, the getRevision() function is needed.
*/ */
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return 0; return 0;
} }
@ -186,9 +186,8 @@ contract LendingPoolCollateralManager is VersionedInitializable, LendingPoolStor
//if liquidator reclaims the underlying asset, we make sure there is enough available collateral in the reserve //if liquidator reclaims the underlying asset, we make sure there is enough available collateral in the reserve
if (!receiveAToken) { if (!receiveAToken) {
uint256 currentAvailableCollateral = IERC20(collateral).balanceOf( uint256 currentAvailableCollateral =
address(vars.collateralAtoken) IERC20(collateral).balanceOf(address(vars.collateralAtoken));
);
if (currentAvailableCollateral < vars.maxCollateralToLiquidate) { if (currentAvailableCollateral < vars.maxCollateralToLiquidate) {
return ( return (
uint256(Errors.CollateralManagerErrors.NOT_ENOUGH_LIQUIDITY), uint256(Errors.CollateralManagerErrors.NOT_ENOUGH_LIQUIDITY),

View File

@ -1,17 +1,17 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import { import {
InitializableImmutableAdminUpgradeabilityProxy InitializableImmutableAdminUpgradeabilityProxy
} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; } from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {ITokenConfiguration} from '../tokenization/interfaces/ITokenConfiguration.sol'; import {ITokenConfiguration} from '../tokenization/interfaces/ITokenConfiguration.sol';
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {Errors} from '../libraries/helpers/Errors.sol'; import {Errors} from '../libraries/helpers/Errors.sol';
import {PercentageMath} from '../libraries/math/PercentageMath.sol'; import {PercentageMath} from '../libraries/math/PercentageMath.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
@ -105,14 +105,14 @@ contract LendingPoolConfigurator is VersionedInitializable {
* @param asset the address of the reserve * @param asset the address of the reserve
**/ **/
event ReserveUnfrozen(address indexed asset); event ReserveUnfrozen(address indexed asset);
/** /**
* @dev emitted when a reserve factor is updated * @dev emitted when a reserve factor is updated
* @param asset the address of the reserve * @param asset the address of the reserve
* @param factor the new reserve factor * @param factor the new reserve factor
**/ **/
event ReserveFactorChanged(address indexed asset, uint256 factor); event ReserveFactorChanged(address indexed asset, uint256 factor);
/** /**
* @dev emitted when the reserve decimals are updated * @dev emitted when the reserve decimals are updated
* @param asset the address of the reserve * @param asset the address of the reserve
@ -187,7 +187,7 @@ contract LendingPoolConfigurator is VersionedInitializable {
uint256 internal constant CONFIGURATOR_REVISION = 0x3; uint256 internal constant CONFIGURATOR_REVISION = 0x3;
function getRevision() internal override pure returns (uint256) { function getRevision() internal pure override returns (uint256) {
return CONFIGURATOR_REVISION; return CONFIGURATOR_REVISION;
} }
@ -236,15 +236,11 @@ contract LendingPoolConfigurator is VersionedInitializable {
address aTokenProxyAddress = _initTokenWithProxy(aTokenImpl, underlyingAssetDecimals); address aTokenProxyAddress = _initTokenWithProxy(aTokenImpl, underlyingAssetDecimals);
address stableDebtTokenProxyAddress = _initTokenWithProxy( address stableDebtTokenProxyAddress =
stableDebtTokenImpl, _initTokenWithProxy(stableDebtTokenImpl, underlyingAssetDecimals);
underlyingAssetDecimals
);
address variableDebtTokenProxyAddress = _initTokenWithProxy( address variableDebtTokenProxyAddress =
variableDebtTokenImpl, _initTokenWithProxy(variableDebtTokenImpl, underlyingAssetDecimals);
underlyingAssetDecimals
);
pool.initReserve( pool.initReserve(
asset, asset,
@ -368,13 +364,16 @@ contract LendingPoolConfigurator is VersionedInitializable {
if (liquidationThreshold != 0) { if (liquidationThreshold != 0) {
//liquidation bonus must be bigger than 100.00%, otherwise the liquidator would receive less //liquidation bonus must be bigger than 100.00%, otherwise the liquidator would receive less
//collateral than needed to cover the debt. //collateral than needed to cover the debt.
uint256 absoluteBonus = liquidationBonus.sub(PercentageMath.PERCENTAGE_FACTOR, Errors.LPC_INVALID_CONFIGURATION); uint256 absoluteBonus =
liquidationBonus.sub(PercentageMath.PERCENTAGE_FACTOR, Errors.LPC_INVALID_CONFIGURATION);
require(absoluteBonus > 0, Errors.LPC_INVALID_CONFIGURATION); require(absoluteBonus > 0, Errors.LPC_INVALID_CONFIGURATION);
//we also need to require that the liq threshold is lower or equal than the liquidation bonus, to ensure that //we also need to require that the liq threshold is lower or equal than the liquidation bonus, to ensure that
//there is always enough margin for liquidators to receive the bonus. //there is always enough margin for liquidators to receive the bonus.
require(liquidationThreshold.add(absoluteBonus) <= PercentageMath.PERCENTAGE_FACTOR, Errors.LPC_INVALID_CONFIGURATION); require(
liquidationThreshold.add(absoluteBonus) <= PercentageMath.PERCENTAGE_FACTOR,
Errors.LPC_INVALID_CONFIGURATION
);
} else { } else {
require(liquidationBonus == 0, Errors.LPC_INVALID_CONFIGURATION); require(liquidationBonus == 0, Errors.LPC_INVALID_CONFIGURATION);
//if the liquidation threshold is being set to 0, //if the liquidation threshold is being set to 0,
@ -512,16 +511,16 @@ contract LendingPoolConfigurator is VersionedInitializable {
* @param decimals the decimals of the token * @param decimals the decimals of the token
**/ **/
function _initTokenWithProxy(address implementation, uint8 decimals) internal returns (address) { function _initTokenWithProxy(address implementation, uint8 decimals) internal returns (address) {
InitializableImmutableAdminUpgradeabilityProxy proxy =
new InitializableImmutableAdminUpgradeabilityProxy(address(this));
InitializableImmutableAdminUpgradeabilityProxy proxy bytes memory params =
= new InitializableImmutableAdminUpgradeabilityProxy(address(this)); abi.encodeWithSignature(
'initialize(uint8,string,string)',
bytes memory params = abi.encodeWithSignature( decimals,
'initialize(uint8,string,string)', IERC20Detailed(implementation).name(),
decimals, IERC20Detailed(implementation).symbol()
IERC20Detailed(implementation).name(), );
IERC20Detailed(implementation).symbol()
);
proxy.initialize(implementation, params); proxy.initialize(implementation, params);
@ -533,20 +532,20 @@ contract LendingPoolConfigurator is VersionedInitializable {
address proxyAddress, address proxyAddress,
address implementation address implementation
) internal { ) internal {
InitializableImmutableAdminUpgradeabilityProxy proxy =
InitializableImmutableAdminUpgradeabilityProxy proxy InitializableImmutableAdminUpgradeabilityProxy(payable(proxyAddress));
= InitializableImmutableAdminUpgradeabilityProxy(payable(proxyAddress));
ReserveConfiguration.Map memory configuration = pool.getConfiguration(asset); ReserveConfiguration.Map memory configuration = pool.getConfiguration(asset);
(, , , uint256 decimals, ) = configuration.getParamsMemory(); (, , , uint256 decimals, ) = configuration.getParamsMemory();
bytes memory params = abi.encodeWithSignature( bytes memory params =
'initialize(uint8,string,string)', abi.encodeWithSignature(
uint8(decimals), 'initialize(uint8,string,string)',
IERC20Detailed(implementation).name(), uint8(decimals),
IERC20Detailed(implementation).symbol() IERC20Detailed(implementation).name(),
); IERC20Detailed(implementation).symbol()
);
proxy.upgradeToAndCall(implementation, params); proxy.upgradeToAndCall(implementation, params);
} }

View File

@ -1,10 +1,10 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol';
import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol';
import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol';
contract LendingPoolStorage { contract LendingPoolStorage {
using ReserveLogic for ReserveLogic.ReserveData; using ReserveLogic for ReserveLogic.ReserveData;

View File

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

View File

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

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity 0.6.8; pragma solidity 0.6.12;
/** /**
* @title VersionedInitializable * @title VersionedInitializable
@ -51,7 +51,7 @@ abstract contract VersionedInitializable {
/// @dev returns the revision number of the contract. /// @dev returns the revision number of the contract.
/// Needs to be defined in the inherited class as a constant. /// Needs to be defined in the inherited class as a constant.
function getRevision() internal virtual pure returns (uint256); function getRevision() internal pure virtual returns (uint256);
/// @dev Returns true if and only if the function is running in the constructor /// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) { function isConstructor() private view returns (bool) {

View File

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

View File

@ -1,14 +1,16 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {Errors} from '../helpers/Errors.sol'; import {Errors} from '../helpers/Errors.sol';
/** /**
* @title UserConfiguration library * @title UserConfiguration library
* @author Aave * @author Aave
* @notice Implements the bitmap logic to handle the user configuration * @notice Implements the bitmap logic to handle the user configuration
*/ */
library UserConfiguration { library UserConfiguration {
uint256 internal constant BORROWING_MASK = 0x5555555555555555555555555555555555555555555555555555555555555555; uint256 internal constant BORROWING_MASK =
0x5555555555555555555555555555555555555555555555555555555555555555;
struct Map { struct Map {
uint256 data; uint256 data;

View File

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

View File

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

View File

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

View File

@ -1,15 +1,15 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {SafeMath} from '../../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
import {ReserveLogic} from './ReserveLogic.sol'; import {ReserveLogic} from './ReserveLogic.sol';
import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol';
import {UserConfiguration} from '../configuration/UserConfiguration.sol'; import {UserConfiguration} from '../configuration/UserConfiguration.sol';
import {WadRayMath} from '../math/WadRayMath.sol'; import {WadRayMath} from '../math/WadRayMath.sol';
import {PercentageMath} from '../math/PercentageMath.sol'; import {PercentageMath} from '../math/PercentageMath.sol';
import {IPriceOracleGetter} from '../../interfaces/IPriceOracleGetter.sol'; import {IPriceOracleGetter} from '../../../interfaces/IPriceOracleGetter.sol';
/** /**
* @title GenericLogic library * @title GenericLogic library
@ -104,11 +104,12 @@ library GenericLogic {
.sub(vars.amountToDecreaseETH.mul(vars.liquidationThreshold)) .sub(vars.amountToDecreaseETH.mul(vars.liquidationThreshold))
.div(vars.collateralBalanceAfterDecrease); .div(vars.collateralBalanceAfterDecrease);
uint256 healthFactorAfterDecrease = calculateHealthFactorFromBalances( uint256 healthFactorAfterDecrease =
vars.collateralBalanceAfterDecrease, calculateHealthFactorFromBalances(
vars.borrowBalanceETH, vars.collateralBalanceAfterDecrease,
vars.liquidationThresholdAfterDecrease vars.borrowBalanceETH,
); vars.liquidationThresholdAfterDecrease
);
return healthFactorAfterDecrease >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD; return healthFactorAfterDecrease >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD;
} }
@ -188,10 +189,8 @@ library GenericLogic {
if (vars.liquidationThreshold != 0 && userConfig.isUsingAsCollateral(vars.i)) { if (vars.liquidationThreshold != 0 && userConfig.isUsingAsCollateral(vars.i)) {
vars.compoundedLiquidityBalance = IERC20(currentReserve.aTokenAddress).balanceOf(user); vars.compoundedLiquidityBalance = IERC20(currentReserve.aTokenAddress).balanceOf(user);
uint256 liquidityBalanceETH = vars uint256 liquidityBalanceETH =
.reserveUnitPrice vars.reserveUnitPrice.mul(vars.compoundedLiquidityBalance).div(vars.tokenUnit);
.mul(vars.compoundedLiquidityBalance)
.div(vars.tokenUnit);
vars.totalCollateralBalanceETH = vars.totalCollateralBalanceETH.add(liquidityBalanceETH); vars.totalCollateralBalanceETH = vars.totalCollateralBalanceETH.add(liquidityBalanceETH);

View File

@ -1,15 +1,15 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
import {MathUtils} from '../math/MathUtils.sol'; import {MathUtils} from '../math/MathUtils.sol';
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {IAToken} from '../../tokenization/interfaces/IAToken.sol'; import {IAToken} from '../../tokenization/interfaces/IAToken.sol';
import {IStableDebtToken} from '../../tokenization/interfaces/IStableDebtToken.sol'; import {IStableDebtToken} from '../../tokenization/interfaces/IStableDebtToken.sol';
import {IVariableDebtToken} from '../../tokenization/interfaces/IVariableDebtToken.sol'; import {IVariableDebtToken} from '../../tokenization/interfaces/IVariableDebtToken.sol';
import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol';
import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol'; import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol';
import {WadRayMath} from '../math/WadRayMath.sol'; import {WadRayMath} from '../math/WadRayMath.sol';
import {PercentageMath} from '../math/PercentageMath.sol'; import {PercentageMath} from '../math/PercentageMath.sol';
import {Errors} from '../helpers/Errors.sol'; import {Errors} from '../helpers/Errors.sol';
@ -89,9 +89,10 @@ library ReserveLogic {
return reserve.liquidityIndex; return reserve.liquidityIndex;
} }
uint256 cumulated = MathUtils uint256 cumulated =
.calculateLinearInterest(reserve.currentLiquidityRate, timestamp) MathUtils.calculateLinearInterest(reserve.currentLiquidityRate, timestamp).rayMul(
.rayMul(reserve.liquidityIndex); reserve.liquidityIndex
);
return cumulated; return cumulated;
} }
@ -112,9 +113,10 @@ library ReserveLogic {
return reserve.variableBorrowIndex; return reserve.variableBorrowIndex;
} }
uint256 cumulated = MathUtils uint256 cumulated =
.calculateCompoundedInterest(reserve.currentVariableBorrowRate, timestamp) MathUtils.calculateCompoundedInterest(reserve.currentVariableBorrowRate, timestamp).rayMul(
.rayMul(reserve.variableBorrowIndex); reserve.variableBorrowIndex
);
return cumulated; return cumulated;
} }
@ -125,19 +127,20 @@ library ReserveLogic {
* @param reserve the reserve object * @param reserve the reserve object
**/ **/
function updateState(ReserveData storage reserve) internal { function updateState(ReserveData storage reserve) internal {
uint256 scaledVariableDebt = IVariableDebtToken(reserve.variableDebtTokenAddress) uint256 scaledVariableDebt =
.scaledTotalSupply(); IVariableDebtToken(reserve.variableDebtTokenAddress).scaledTotalSupply();
uint256 previousVariableBorrowIndex = reserve.variableBorrowIndex; uint256 previousVariableBorrowIndex = reserve.variableBorrowIndex;
uint256 previousLiquidityIndex = reserve.liquidityIndex; uint256 previousLiquidityIndex = reserve.liquidityIndex;
uint40 lastUpdatedTimestamp = reserve.lastUpdateTimestamp; uint40 lastUpdatedTimestamp = reserve.lastUpdateTimestamp;
(uint256 newLiquidityIndex, uint256 newVariableBorrowIndex) = _updateIndexes( (uint256 newLiquidityIndex, uint256 newVariableBorrowIndex) =
reserve, _updateIndexes(
scaledVariableDebt, reserve,
previousLiquidityIndex, scaledVariableDebt,
previousVariableBorrowIndex, previousLiquidityIndex,
lastUpdatedTimestamp previousVariableBorrowIndex,
); lastUpdatedTimestamp
);
_mintToTreasury( _mintToTreasury(
reserve, reserve,
@ -185,7 +188,7 @@ library ReserveLogic {
address interestRateStrategyAddress address interestRateStrategyAddress
) external { ) external {
require(reserve.aTokenAddress == address(0), Errors.RL_RESERVE_ALREADY_INITIALIZED); require(reserve.aTokenAddress == address(0), Errors.RL_RESERVE_ALREADY_INITIALIZED);
reserve.liquidityIndex = uint128(WadRayMath.ray()); reserve.liquidityIndex = uint128(WadRayMath.ray());
reserve.variableBorrowIndex = uint128(WadRayMath.ray()); reserve.variableBorrowIndex = uint128(WadRayMath.ray());
reserve.aTokenAddress = aTokenAddress; reserve.aTokenAddress = aTokenAddress;
@ -362,10 +365,8 @@ library ReserveLogic {
//only cumulating if there is any income being produced //only cumulating if there is any income being produced
if (currentLiquidityRate > 0) { if (currentLiquidityRate > 0) {
uint256 cumulatedLiquidityInterest = MathUtils.calculateLinearInterest( uint256 cumulatedLiquidityInterest =
currentLiquidityRate, MathUtils.calculateLinearInterest(currentLiquidityRate, timestamp);
timestamp
);
newLiquidityIndex = cumulatedLiquidityInterest.rayMul(liquidityIndex); newLiquidityIndex = cumulatedLiquidityInterest.rayMul(liquidityIndex);
require(newLiquidityIndex < type(uint128).max, Errors.RL_LIQUIDITY_INDEX_OVERFLOW); require(newLiquidityIndex < type(uint128).max, Errors.RL_LIQUIDITY_INDEX_OVERFLOW);
@ -374,12 +375,13 @@ library ReserveLogic {
//as the liquidity rate might come only from stable rate loans, we need to ensure //as the liquidity rate might come only from stable rate loans, we need to ensure
//that there is actual variable debt before accumulating //that there is actual variable debt before accumulating
if (scaledVariableDebt != 0) { if (scaledVariableDebt != 0) {
uint256 cumulatedVariableBorrowInterest = MathUtils.calculateCompoundedInterest( uint256 cumulatedVariableBorrowInterest =
reserve.currentVariableBorrowRate, MathUtils.calculateCompoundedInterest(reserve.currentVariableBorrowRate, timestamp);
timestamp
);
newVariableBorrowIndex = cumulatedVariableBorrowInterest.rayMul(variableBorrowIndex); newVariableBorrowIndex = cumulatedVariableBorrowInterest.rayMul(variableBorrowIndex);
require(newVariableBorrowIndex < type(uint128).max, Errors.RL_VARIABLE_BORROW_INDEX_OVERFLOW); require(
newVariableBorrowIndex < type(uint128).max,
Errors.RL_VARIABLE_BORROW_INDEX_OVERFLOW
);
reserve.variableBorrowIndex = uint128(newVariableBorrowIndex); reserve.variableBorrowIndex = uint128(newVariableBorrowIndex);
} }
} }

View File

@ -1,19 +1,19 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {SafeMath} from '../../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
import {ReserveLogic} from './ReserveLogic.sol'; import {ReserveLogic} from './ReserveLogic.sol';
import {GenericLogic} from './GenericLogic.sol'; import {GenericLogic} from './GenericLogic.sol';
import {WadRayMath} from '../math/WadRayMath.sol'; import {WadRayMath} from '../math/WadRayMath.sol';
import {PercentageMath} from '../math/PercentageMath.sol'; import {PercentageMath} from '../math/PercentageMath.sol';
import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../../../dependencies/openzeppelin/contracts/SafeERC20.sol';
import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol'; import {ReserveConfiguration} from '../configuration/ReserveConfiguration.sol';
import {UserConfiguration} from '../configuration/UserConfiguration.sol'; import {UserConfiguration} from '../configuration/UserConfiguration.sol';
import {Errors} from '../helpers/Errors.sol'; import {Errors} from '../helpers/Errors.sol';
import {Helpers} from '../helpers/Helpers.sol'; import {Helpers} from '../helpers/Helpers.sol';
import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol'; import {IReserveInterestRateStrategy} from '../../../interfaces/IReserveInterestRateStrategy.sol';
/** /**
* @title ReserveLogic library * @title ReserveLogic library
@ -66,11 +66,10 @@ library ValidationLogic {
uint256 reservesCount, uint256 reservesCount,
address oracle address oracle
) external view { ) external view {
require(amount != 0, Errors.VL_INVALID_AMOUNT); require(amount != 0, Errors.VL_INVALID_AMOUNT);
require(amount <= userBalance, Errors.VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE); require(amount <= userBalance, Errors.VL_NOT_ENOUGH_AVAILABLE_USER_BALANCE);
(bool isActive,, , ) = reservesData[reserveAddress].configuration.getFlags(); (bool isActive, , , ) = reservesData[reserveAddress].configuration.getFlags();
require(isActive, Errors.VL_NO_ACTIVE_RESERVE); require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
require( require(
@ -313,31 +312,24 @@ library ValidationLogic {
address reserveAddress, address reserveAddress,
IERC20 stableDebtToken, IERC20 stableDebtToken,
IERC20 variableDebtToken, IERC20 variableDebtToken,
address aTokenAddress) external view { address aTokenAddress
) external view {
(bool isActive,,, ) = reserve.configuration.getFlags(); (bool isActive, , , ) = reserve.configuration.getFlags();
require(isActive, Errors.VL_NO_ACTIVE_RESERVE); require(isActive, Errors.VL_NO_ACTIVE_RESERVE);
//if the usage ratio is below 95%, no rebalances are needed //if the usage ratio is below 95%, no rebalances are needed
uint256 totalDebt = stableDebtToken uint256 totalDebt =
.totalSupply() stableDebtToken.totalSupply().add(variableDebtToken.totalSupply()).wadToRay();
.add(variableDebtToken.totalSupply())
.wadToRay();
uint256 availableLiquidity = IERC20(reserveAddress).balanceOf(aTokenAddress).wadToRay(); uint256 availableLiquidity = IERC20(reserveAddress).balanceOf(aTokenAddress).wadToRay();
uint256 usageRatio = totalDebt == 0 uint256 usageRatio = totalDebt == 0 ? 0 : totalDebt.rayDiv(availableLiquidity.add(totalDebt));
? 0
: totalDebt.rayDiv(availableLiquidity.add(totalDebt));
//if the liquidity rate is below REBALANCE_UP_THRESHOLD of the max variable APR at 95% usage, //if the liquidity rate is below REBALANCE_UP_THRESHOLD of the max variable APR at 95% usage,
//then we allow rebalancing of the stable rate positions. //then we allow rebalancing of the stable rate positions.
uint256 currentLiquidityRate = reserve.currentLiquidityRate; uint256 currentLiquidityRate = reserve.currentLiquidityRate;
uint256 maxVariableBorrowRate = IReserveInterestRateStrategy( uint256 maxVariableBorrowRate =
reserve IReserveInterestRateStrategy(reserve.interestRateStrategyAddress).getMaxVariableBorrowRate();
.interestRateStrategyAddress
)
.getMaxVariableBorrowRate();
require( require(
usageRatio >= REBALANCE_UP_USAGE_RATIO_THRESHOLD && usageRatio >= REBALANCE_UP_USAGE_RATIO_THRESHOLD &&
@ -345,7 +337,6 @@ library ValidationLogic {
maxVariableBorrowRate.percentMul(REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD), maxVariableBorrowRate.percentMul(REBALANCE_UP_LIQUIDITY_RATE_THRESHOLD),
Errors.LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET Errors.LP_INTEREST_RATE_REBALANCE_CONDITIONS_NOT_MET
); );
} }
/** /**
@ -373,16 +364,16 @@ library ValidationLogic {
require( require(
useAsCollateral || useAsCollateral ||
GenericLogic.balanceDecreaseAllowed( GenericLogic.balanceDecreaseAllowed(
reserveAddress, reserveAddress,
msg.sender, msg.sender,
underlyingBalance, underlyingBalance,
reservesData, reservesData,
userConfig, userConfig,
reserves, reserves,
reservesCount, reservesCount,
oracle oracle
), ),
Errors.VL_DEPOSIT_ALREADY_IN_USE Errors.VL_DEPOSIT_ALREADY_IN_USE
); );
} }
@ -429,8 +420,9 @@ library ValidationLogic {
); );
} }
bool isCollateralEnabled = collateralReserve.configuration.getLiquidationThreshold() > 0 && bool isCollateralEnabled =
userConfig.isUsingAsCollateral(collateralReserve.id); collateralReserve.configuration.getLiquidationThreshold() > 0 &&
userConfig.isUsingAsCollateral(collateralReserve.id);
//if collateral isn't enabled as collateral by user, it cannot be liquidated //if collateral isn't enabled as collateral by user, it cannot be liquidated
if (!isCollateralEnabled) { if (!isCollateralEnabled) {
@ -466,14 +458,15 @@ library ValidationLogic {
uint256 reservesCount, uint256 reservesCount,
address oracle address oracle
) internal view { ) internal view {
(, , , , uint256 healthFactor) = GenericLogic.calculateUserAccountData( (, , , , uint256 healthFactor) =
from, GenericLogic.calculateUserAccountData(
reservesData, from,
userConfig, reservesData,
reserves, userConfig,
reservesCount, reserves,
oracle reservesCount,
); oracle
);
require( require(
healthFactor >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD, healthFactor >= GenericLogic.HEALTH_FACTOR_LIQUIDATION_THRESHOLD,

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {SafeMath} from '../../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {WadRayMath} from './WadRayMath.sol'; import {WadRayMath} from './WadRayMath.sol';
library MathUtils { library MathUtils {

View File

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

View File

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

View File

@ -1,14 +1,14 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {IncentivizedERC20} from './IncentivizedERC20.sol'; import {IncentivizedERC20} from './IncentivizedERC20.sol';
import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol';
import {Errors} from '../libraries/helpers/Errors.sol'; import {Errors} from '../libraries/helpers/Errors.sol';
import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol'; import {VersionedInitializable} from '../libraries/aave-upgradeability/VersionedInitializable.sol';
import {IAToken} from './interfaces/IAToken.sol'; import {IAToken} from './interfaces/IAToken.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol';
/** /**
* @title Aave ERC20 AToken * @title Aave ERC20 AToken
@ -21,12 +21,10 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
using SafeERC20 for IERC20; using SafeERC20 for IERC20;
bytes public constant EIP712_REVISION = bytes('1'); bytes public constant EIP712_REVISION = bytes('1');
bytes32 internal constant EIP712_DOMAIN = keccak256( bytes32 internal constant EIP712_DOMAIN =
'EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)' keccak256('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)');
); bytes32 public constant PERMIT_TYPEHASH =
bytes32 public constant PERMIT_TYPEHASH = keccak256( keccak256('Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)');
'Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)'
);
uint256 public constant UINT_MAX_VALUE = uint256(-1); uint256 public constant UINT_MAX_VALUE = uint256(-1);
uint256 public constant ATOKEN_REVISION = 0x1; uint256 public constant ATOKEN_REVISION = 0x1;
@ -57,7 +55,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
RESERVE_TREASURY_ADDRESS = reserveTreasuryAddress; RESERVE_TREASURY_ADDRESS = reserveTreasuryAddress;
} }
function getRevision() internal virtual override pure returns (uint256) { function getRevision() internal pure virtual override returns (uint256) {
return ATOKEN_REVISION; return ATOKEN_REVISION;
} }
@ -187,8 +185,8 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
**/ **/
function balanceOf(address user) function balanceOf(address user)
public public
override(IncentivizedERC20, IERC20)
view view
override(IncentivizedERC20, IERC20)
returns (uint256) returns (uint256)
{ {
return super.balanceOf(user).rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS)); return super.balanceOf(user).rayMul(POOL.getReserveNormalizedIncome(UNDERLYING_ASSET_ADDRESS));
@ -200,7 +198,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
* @param user the address of the user * @param user the address of the user
* @return the scaled balance of the user * @return the scaled balance of the user
**/ **/
function scaledBalanceOf(address user) external override view returns (uint256) { function scaledBalanceOf(address user) external view override returns (uint256) {
return super.balanceOf(user); return super.balanceOf(user);
} }
@ -212,8 +210,8 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
**/ **/
function getScaledUserBalanceAndSupply(address user) function getScaledUserBalanceAndSupply(address user)
external external
override
view view
override
returns (uint256, uint256) returns (uint256, uint256)
{ {
return (super.balanceOf(user), super.totalSupply()); return (super.balanceOf(user), super.totalSupply());
@ -225,7 +223,7 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
* does that too. * does that too.
* @return the current total supply * @return the current total supply
**/ **/
function totalSupply() public override(IncentivizedERC20, IERC20) view returns (uint256) { function totalSupply() public view override(IncentivizedERC20, IERC20) returns (uint256) {
uint256 currentSupplyScaled = super.totalSupply(); uint256 currentSupplyScaled = super.totalSupply();
if (currentSupplyScaled == 0) { if (currentSupplyScaled == 0) {
@ -239,7 +237,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(borrows/index)
* @return the scaled total supply * @return the scaled total supply
**/ **/
function scaledTotalSupply() public virtual override view returns (uint256) { function scaledTotalSupply() public view virtual override returns (uint256) {
return super.totalSupply(); return super.totalSupply();
} }
@ -283,13 +281,14 @@ contract AToken is VersionedInitializable, IncentivizedERC20, IAToken {
//solium-disable-next-line //solium-disable-next-line
require(block.timestamp <= deadline, 'INVALID_EXPIRATION'); require(block.timestamp <= deadline, 'INVALID_EXPIRATION');
uint256 currentValidNonce = _nonces[owner]; uint256 currentValidNonce = _nonces[owner];
bytes32 digest = keccak256( bytes32 digest =
abi.encodePacked( keccak256(
'\x19\x01', abi.encodePacked(
DOMAIN_SEPARATOR, '\x19\x01',
keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline)) DOMAIN_SEPARATOR,
) keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, value, currentValidNonce, deadline))
); )
);
require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE'); require(owner == ecrecover(digest, v, r, s), 'INVALID_SIGNATURE');
_nonces[owner] = currentValidNonce.add(1); _nonces[owner] = currentValidNonce.add(1);
_approve(owner, spender, value); _approve(owner, spender, value);

View File

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

View File

@ -1,11 +1,11 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {Context} from '../../dependencies/openzeppelin/contracts/Context.sol';
import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol';
import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol';
import {SafeMath} from '../dependencies/openzeppelin/contracts/SafeMath.sol'; import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol';
import {IAaveIncentivesController} from '../interfaces/IAaveIncentivesController.sol'; import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol';
/** /**
* @title ERC20 * @title ERC20
@ -40,35 +40,35 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
/** /**
* @return the name of the token * @return the name of the token
**/ **/
function name() public override view returns (string memory) { function name() public view override returns (string memory) {
return _name; return _name;
} }
/** /**
* @return the symbol of the token * @return the symbol of the token
**/ **/
function symbol() public override view returns (string memory) { function symbol() public view override returns (string memory) {
return _symbol; return _symbol;
} }
/** /**
* @return the decimals of the token * @return the decimals of the token
**/ **/
function decimals() public override view returns (uint8) { function decimals() public view override returns (uint8) {
return _decimals; return _decimals;
} }
/** /**
* @return the total supply of the token * @return the total supply of the token
**/ **/
function totalSupply() public virtual override view returns (uint256) { function totalSupply() public view virtual override returns (uint256) {
return _totalSupply; return _totalSupply;
} }
/** /**
* @return the balance of the token * @return the balance of the token
**/ **/
function balanceOf(address account) public virtual override view returns (uint256) { function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account]; return _balances[account];
} }
@ -92,9 +92,9 @@ contract IncentivizedERC20 is Context, IERC20, IERC20Detailed {
**/ **/
function allowance(address owner, address spender) function allowance(address owner, address spender)
public public
view
virtual virtual
override override
view
returns (uint256) returns (uint256)
{ {
return _allowances[owner][spender]; return _allowances[owner][spender];

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {DebtTokenBase} from './base/DebtTokenBase.sol'; import {DebtTokenBase} from './base/DebtTokenBase.sol';
import {MathUtils} from '../libraries/math/MathUtils.sol'; import {MathUtils} from '../libraries/math/MathUtils.sol';
@ -34,7 +34,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @dev gets the revision of the stable debt token implementation * @dev gets the revision of the stable debt token implementation
* @return the debt token implementation revision * @return the debt token implementation revision
**/ **/
function getRevision() internal virtual override pure returns (uint256) { function getRevision() internal pure virtual override returns (uint256) {
return DEBT_TOKEN_REVISION; return DEBT_TOKEN_REVISION;
} }
@ -42,7 +42,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @dev returns the average stable rate across all the stable rate debt * @dev returns the average stable rate across all the stable rate debt
* @return the average stable rate * @return the average stable rate
**/ **/
function getAverageStableRate() external virtual override view returns (uint256) { function getAverageStableRate() external view virtual override returns (uint256) {
return _avgStableRate; return _avgStableRate;
} }
@ -50,7 +50,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @dev returns the timestamp of the last user action * @dev returns the timestamp of the last user action
* @return the last update timestamp * @return the last update timestamp
**/ **/
function getUserLastUpdated(address user) external virtual override view returns (uint40) { function getUserLastUpdated(address user) external view virtual override returns (uint40) {
return _timestamps[user]; return _timestamps[user];
} }
@ -59,7 +59,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @param user the address of the user * @param user the address of the user
* @return the stable rate of user * @return the stable rate of user
**/ **/
function getUserStableRate(address user) external virtual override view returns (uint256) { function getUserStableRate(address user) external view virtual override returns (uint256) {
return _usersStableRate[user]; return _usersStableRate[user];
} }
@ -67,16 +67,14 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @dev calculates the current user debt balance * @dev calculates the current user debt balance
* @return the accumulated debt of the user * @return the accumulated debt of the user
**/ **/
function balanceOf(address account) public virtual override view returns (uint256) { function balanceOf(address account) public view virtual override returns (uint256) {
uint256 accountBalance = super.balanceOf(account); uint256 accountBalance = super.balanceOf(account);
uint256 stableRate = _usersStableRate[account]; uint256 stableRate = _usersStableRate[account];
if (accountBalance == 0) { if (accountBalance == 0) {
return 0; return 0;
} }
uint256 cumulatedInterest = MathUtils.calculateCompoundedInterest( uint256 cumulatedInterest =
stableRate, MathUtils.calculateCompoundedInterest(stableRate, _timestamps[account]);
_timestamps[account]
);
return accountBalance.rayMul(cumulatedInterest); return accountBalance.rayMul(cumulatedInterest);
} }
@ -248,8 +246,8 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
**/ **/
function getSupplyData() function getSupplyData()
public public
override
view view
override
returns ( returns (
uint256, uint256,
uint256, uint256,
@ -264,7 +262,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
/** /**
* @dev returns the the total supply and the average stable rate * @dev returns the the total supply and the average stable rate
**/ **/
function getTotalSupplyAndAvgRate() public override view returns (uint256, uint256) { function getTotalSupplyAndAvgRate() public view override returns (uint256, uint256) {
uint256 avgRate = _avgStableRate; uint256 avgRate = _avgStableRate;
return (_calcTotalSupply(avgRate), avgRate); return (_calcTotalSupply(avgRate), avgRate);
} }
@ -272,14 +270,14 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
/** /**
* @dev returns the total supply * @dev returns the total supply
**/ **/
function totalSupply() public override view returns (uint256) { function totalSupply() public view override returns (uint256) {
return _calcTotalSupply(_avgStableRate); return _calcTotalSupply(_avgStableRate);
} }
/** /**
* @dev returns the timestamp at which the total supply was updated * @dev returns the timestamp at which the total supply was updated
**/ **/
function getTotalSupplyLastUpdated() public override view returns (uint40) { function getTotalSupplyLastUpdated() public view override returns (uint40) {
return _totalSupplyTimestamp; return _totalSupplyTimestamp;
} }
@ -288,7 +286,7 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @param user the user * @param user the user
* @return The debt balance of the user since the last burn/mint action * @return The debt balance of the user since the last burn/mint action
**/ **/
function principalBalanceOf(address user) external virtual override view returns (uint256) { function principalBalanceOf(address user) external view virtual override returns (uint256) {
return super.balanceOf(user); return super.balanceOf(user);
} }
@ -297,17 +295,15 @@ contract StableDebtToken is IStableDebtToken, DebtTokenBase {
* @param avgRate the average rate at which calculate the total supply * @param avgRate the average rate at which calculate the total supply
* @return The debt balance of the user since the last burn/mint action * @return The debt balance of the user since the last burn/mint action
**/ **/
function _calcTotalSupply(uint256 avgRate) internal virtual view returns (uint256) { function _calcTotalSupply(uint256 avgRate) internal view virtual returns (uint256) {
uint256 principalSupply = super.totalSupply(); uint256 principalSupply = super.totalSupply();
if (principalSupply == 0) { if (principalSupply == 0) {
return 0; return 0;
} }
uint256 cumulatedInterest = MathUtils.calculateCompoundedInterest( uint256 cumulatedInterest =
avgRate, MathUtils.calculateCompoundedInterest(avgRate, _totalSupplyTimestamp);
_totalSupplyTimestamp
);
return principalSupply.rayMul(cumulatedInterest); return principalSupply.rayMul(cumulatedInterest);
} }

View File

@ -1,5 +1,5 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {DebtTokenBase} from './base/DebtTokenBase.sol'; import {DebtTokenBase} from './base/DebtTokenBase.sol';
import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol';
@ -28,7 +28,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
* @dev gets the revision of the stable debt token implementation * @dev gets the revision of the stable debt token implementation
* @return the debt token implementation revision * @return the debt token implementation revision
**/ **/
function getRevision() internal virtual override pure returns (uint256) { function getRevision() internal pure virtual override returns (uint256) {
return DEBT_TOKEN_REVISION; return DEBT_TOKEN_REVISION;
} }
@ -36,7 +36,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
* @dev calculates the accumulated debt balance of the user * @dev calculates the accumulated debt balance of the user
* @return the debt balance of the user * @return the debt balance of the user
**/ **/
function balanceOf(address user) public virtual override view returns (uint256) { function balanceOf(address user) public view virtual override returns (uint256) {
uint256 scaledBalance = super.balanceOf(user); uint256 scaledBalance = super.balanceOf(user);
if (scaledBalance == 0) { if (scaledBalance == 0) {
@ -98,7 +98,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
* @dev Returns the principal debt balance of the user from * @dev Returns the principal debt balance of the user from
* @return The debt balance of the user since the last burn/mint action * @return The debt balance of the user since the last burn/mint action
**/ **/
function scaledBalanceOf(address user) public virtual override view returns (uint256) { function scaledBalanceOf(address user) public view virtual override returns (uint256) {
return super.balanceOf(user); return super.balanceOf(user);
} }
@ -106,7 +106,7 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
* @dev Returns the total supply of the variable debt token. Represents the total debt accrued by the users * @dev Returns the total supply of the variable debt token. Represents the total debt accrued by the users
* @return the total supply * @return the total supply
**/ **/
function totalSupply() public virtual override view returns (uint256) { function totalSupply() public view virtual override returns (uint256) {
return return
super.totalSupply().rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS)); super.totalSupply().rayMul(POOL.getReserveNormalizedVariableDebt(UNDERLYING_ASSET_ADDRESS));
} }
@ -115,7 +115,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(borrows/index)
* @return the scaled total supply * @return the scaled total supply
**/ **/
function scaledTotalSupply() public virtual override view returns (uint256) { function scaledTotalSupply() public view virtual override returns (uint256) {
return super.totalSupply(); return super.totalSupply();
} }
@ -127,8 +127,8 @@ contract VariableDebtToken is DebtTokenBase, IVariableDebtToken {
**/ **/
function getScaledUserBalanceAndSupply(address user) function getScaledUserBalanceAndSupply(address user)
external external
override
view view
override
returns (uint256, uint256) returns (uint256, uint256)
{ {
return (super.balanceOf(user), super.totalSupply()); return (super.balanceOf(user), super.totalSupply());

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0 // SPDX-License-Identifier: agpl-3.0
pragma solidity ^0.6.8; pragma solidity 0.6.12;
import {ILendingPool} from '../../interfaces/ILendingPool.sol'; import {ILendingPool} from '../../../interfaces/ILendingPool.sol';
import { import {
VersionedInitializable VersionedInitializable
} from '../../libraries/aave-upgradeability/VersionedInitializable.sol'; } from '../../libraries/aave-upgradeability/VersionedInitializable.sol';
@ -100,9 +100,9 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable {
function allowance(address owner, address spender) function allowance(address owner, address spender)
public public
view
virtual virtual
override override
view
returns (uint256) returns (uint256)
{ {
owner; owner;
@ -154,10 +154,8 @@ abstract contract DebtTokenBase is IncentivizedERC20, VersionedInitializable {
address delegatee, address delegatee,
uint256 amount uint256 amount
) internal { ) internal {
uint256 newAllowance = _borrowAllowances[delegator][delegatee].sub( uint256 newAllowance =
amount, _borrowAllowances[delegator][delegatee].sub(amount, Errors.BORROW_ALLOWANCE_NOT_ENOUGH);
Errors.BORROW_ALLOWANCE_NOT_ENOUGH
);
_borrowAllowances[delegator][delegatee] = newAllowance; _borrowAllowances[delegator][delegatee] = newAllowance;

View File

@ -1,7 +1,7 @@
// SPDX-License-Identifier: agpl-3.0 // 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 {IERC20} from '../../../dependencies/openzeppelin/contracts/IERC20.sol';
import {IScaledBalanceToken} from './IScaledBalanceToken.sol'; import {IScaledBalanceToken} from './IScaledBalanceToken.sol';
interface IAToken is IERC20, IScaledBalanceToken { interface IAToken is IERC20, IScaledBalanceToken {

View File

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

View File

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

View File

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

View File

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

View File

@ -162,8 +162,8 @@ export const deployAaveLibraries = async (
// libPath example: contracts/libraries/logic/GenericLogic.sol // libPath example: contracts/libraries/logic/GenericLogic.sol
// libName example: GenericLogic // libName example: GenericLogic
return { return {
['__$5201a97c05ba6aa659e2f36a933dd51801$__']: validationLogic.address, ['__$de8c0cf1a7d7c36c802af9a64fb9d86036$__']: validationLogic.address,
['__$d3b4366daeb9cadc7528af6145b50b2183$__']: reserveLogic.address, ['__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__']: reserveLogic.address,
}; };
}; };

292
package-lock.json generated
View File

@ -6422,14 +6422,12 @@
"scryptsy": { "scryptsy": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-2.1.0.tgz",
"integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w==", "integrity": "sha512-1CdSqHQowJBnMAFyPEBRfqag/YP9OF394FV+4YREIJX4ljD7OxvQRDayyoyyCk+senRjSkP6VnUNQmVQqB6g7w=="
"optional": true
}, },
"semver": { "semver": {
"version": "6.3.0", "version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw=="
"optional": true
} }
} }
}, },
@ -6449,7 +6447,6 @@
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
"integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
"optional": true,
"requires": { "requires": {
"ms": "2.0.0" "ms": "2.0.0"
} }
@ -6457,8 +6454,7 @@
"ms": { "ms": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
"integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
"optional": true
} }
} }
}, },
@ -7634,8 +7630,7 @@
"bignumber.js": { "bignumber.js": {
"version": "9.0.1", "version": "9.0.1",
"resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz",
"integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA=="
"optional": true
}, },
"binary-extensions": { "binary-extensions": {
"version": "1.13.1", "version": "1.13.1",
@ -7675,7 +7670,6 @@
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
"integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==", "integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
"optional": true,
"requires": { "requires": {
"readable-stream": "^2.3.5", "readable-stream": "^2.3.5",
"safe-buffer": "^5.1.1" "safe-buffer": "^5.1.1"
@ -7684,14 +7678,12 @@
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
"optional": true
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.7", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"optional": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
"inherits": "~2.0.3", "inherits": "~2.0.3",
@ -7705,8 +7697,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"optional": true
} }
} }
}, },
@ -7714,7 +7705,6 @@
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"optional": true,
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
}, },
@ -7722,8 +7712,7 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"optional": true
} }
} }
} }
@ -7959,7 +7948,6 @@
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
"integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
"optional": true,
"requires": { "requires": {
"buffer-alloc-unsafe": "^1.1.0", "buffer-alloc-unsafe": "^1.1.0",
"buffer-fill": "^1.0.0" "buffer-fill": "^1.0.0"
@ -7968,14 +7956,12 @@
"buffer-alloc-unsafe": { "buffer-alloc-unsafe": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
"integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==", "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg=="
"optional": true
}, },
"buffer-crc32": { "buffer-crc32": {
"version": "0.2.13", "version": "0.2.13",
"resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz",
"integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI="
"optional": true
}, },
"buffer-equal": { "buffer-equal": {
"version": "1.0.0", "version": "1.0.0",
@ -7985,8 +7971,7 @@
"buffer-fill": { "buffer-fill": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
"integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=", "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw="
"optional": true
}, },
"buffer-from": { "buffer-from": {
"version": "1.1.1", "version": "1.1.1",
@ -8320,8 +8305,7 @@
"commander": { "commander": {
"version": "2.20.3", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
"optional": true
}, },
"component-emitter": { "component-emitter": {
"version": "1.3.0", "version": "1.3.0",
@ -8603,8 +8587,7 @@
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
"optional": true
} }
} }
}, },
@ -8622,7 +8605,6 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz", "resolved": "https://registry.npmjs.org/decompress-tar/-/decompress-tar-4.1.1.tgz",
"integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==", "integrity": "sha512-JdJMaCrGpB5fESVyxwpCx4Jdj2AagLmv3y58Qy4GE6HMVjWz1FeVQk1Ct4Kye7PftcdOo/7U7UKzYBJgqnGeUQ==",
"optional": true,
"requires": { "requires": {
"file-type": "^5.2.0", "file-type": "^5.2.0",
"is-stream": "^1.1.0", "is-stream": "^1.1.0",
@ -8633,7 +8615,6 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz", "resolved": "https://registry.npmjs.org/decompress-tarbz2/-/decompress-tarbz2-4.1.1.tgz",
"integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==", "integrity": "sha512-s88xLzf1r81ICXLAVQVzaN6ZmX4A6U4z2nMbOwobxkLoIIfjVMBg7TeguTUXkKeXni795B6y5rnvDw7rxhAq9A==",
"optional": true,
"requires": { "requires": {
"decompress-tar": "^4.1.0", "decompress-tar": "^4.1.0",
"file-type": "^6.1.0", "file-type": "^6.1.0",
@ -8645,8 +8626,7 @@
"file-type": { "file-type": {
"version": "6.2.0", "version": "6.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-6.2.0.tgz",
"integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg==", "integrity": "sha512-YPcTBDV+2Tm0VqjybVd32MHdlEGAtuxS3VAYsumFokDSMG+ROT5wawGlnHDoz7bfMcMDt9hxuXvXwoKUx2fkOg=="
"optional": true
} }
} }
}, },
@ -8654,7 +8634,6 @@
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz", "resolved": "https://registry.npmjs.org/decompress-targz/-/decompress-targz-4.1.1.tgz",
"integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==", "integrity": "sha512-4z81Znfr6chWnRDNfFNqLwPvm4db3WuZkqV+UgXQzSngG3CEKdBkw5jrv3axjjL96glyiiKjsxJG3X6WBZwX3w==",
"optional": true,
"requires": { "requires": {
"decompress-tar": "^4.1.1", "decompress-tar": "^4.1.1",
"file-type": "^5.2.0", "file-type": "^5.2.0",
@ -8665,7 +8644,6 @@
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz", "resolved": "https://registry.npmjs.org/decompress-unzip/-/decompress-unzip-4.0.1.tgz",
"integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=", "integrity": "sha1-3qrM39FK6vhVePczroIQ+bSEj2k=",
"optional": true,
"requires": { "requires": {
"file-type": "^3.8.0", "file-type": "^3.8.0",
"get-stream": "^2.2.0", "get-stream": "^2.2.0",
@ -8676,14 +8654,12 @@
"file-type": { "file-type": {
"version": "3.9.0", "version": "3.9.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-3.9.0.tgz",
"integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek=", "integrity": "sha1-JXoHg4TR24CHvESdEH1SpSZyuek="
"optional": true
}, },
"get-stream": { "get-stream": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-2.3.1.tgz",
"integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=", "integrity": "sha1-Xzj5PzRgCWZu4BUKBUFn+Rvdld4=",
"optional": true,
"requires": { "requires": {
"object-assign": "^4.0.1", "object-assign": "^4.0.1",
"pinkie-promise": "^2.0.0" "pinkie-promise": "^2.0.0"
@ -8692,8 +8668,7 @@
"pify": { "pify": {
"version": "2.3.0", "version": "2.3.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
"optional": true
} }
} }
}, },
@ -9529,6 +9504,14 @@
"prr": "~1.0.1", "prr": "~1.0.1",
"semver": "~5.4.1", "semver": "~5.4.1",
"xtend": "~4.0.0" "xtend": "~4.0.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
}
} }
}, },
"merkle-patricia-tree": { "merkle-patricia-tree": {
@ -9918,6 +9901,14 @@
"prr": "~1.0.1", "prr": "~1.0.1",
"semver": "~5.4.1", "semver": "~5.4.1",
"xtend": "~4.0.0" "xtend": "~4.0.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
}
} }
}, },
"merkle-patricia-tree": { "merkle-patricia-tree": {
@ -10209,6 +10200,14 @@
"prr": "~1.0.1", "prr": "~1.0.1",
"semver": "~5.4.1", "semver": "~5.4.1",
"xtend": "~4.0.0" "xtend": "~4.0.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
}
} }
}, },
"merkle-patricia-tree": { "merkle-patricia-tree": {
@ -10460,6 +10459,14 @@
"prr": "~1.0.1", "prr": "~1.0.1",
"semver": "~5.4.1", "semver": "~5.4.1",
"xtend": "~4.0.0" "xtend": "~4.0.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
}
} }
}, },
"merkle-patricia-tree": { "merkle-patricia-tree": {
@ -10841,7 +10848,6 @@
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz",
"integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=",
"optional": true,
"requires": { "requires": {
"pend": "~1.2.0" "pend": "~1.2.0"
} }
@ -10870,8 +10876,7 @@
"file-type": { "file-type": {
"version": "5.2.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz", "resolved": "https://registry.npmjs.org/file-type/-/file-type-5.2.0.tgz",
"integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY=", "integrity": "sha1-LdvqfHP/42No365J3DOMBYwritY="
"optional": true
}, },
"file-uri-to-path": { "file-uri-to-path": {
"version": "1.0.0", "version": "1.0.0",
@ -11081,8 +11086,7 @@
"fs-constants": { "fs-constants": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
"integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
"optional": true
}, },
"fs-extra": { "fs-extra": {
"version": "7.0.1", "version": "7.0.1",
@ -11510,7 +11514,6 @@
"version": "3.8.0", "version": "3.8.0",
"resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz", "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.8.0.tgz",
"integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==", "integrity": "sha512-k5ke5avRZbtl9Tqx/SA7CbY3NF6Ro+Sj9cZxezFzuBlLDmyqPiL8hJJ+EmzD8Ig4LUDByHJ3/iPOVoRixs/hmw==",
"optional": true,
"requires": { "requires": {
"bindings": "^1.5.0", "bindings": "^1.5.0",
"bip66": "^1.1.5", "bip66": "^1.1.5",
@ -11708,9 +11711,6 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
"integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
"requires": {
"kind-of": "^6.0.0"
},
"dependencies": { "dependencies": {
"kind-of": { "kind-of": {
"version": "3.2.2", "version": "3.2.2",
@ -11755,9 +11755,6 @@
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
"integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
"requires": {
"kind-of": "^6.0.0"
},
"dependencies": { "dependencies": {
"kind-of": { "kind-of": {
"version": "3.2.2", "version": "3.2.2",
@ -11780,8 +11777,7 @@
"integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
"requires": { "requires": {
"is-accessor-descriptor": "^1.0.0", "is-accessor-descriptor": "^1.0.0",
"is-data-descriptor": "^1.0.0", "is-data-descriptor": "^1.0.0"
"kind-of": "^6.0.2"
}, },
"dependencies": { "dependencies": {
"kind-of": { "kind-of": {
@ -11847,8 +11843,7 @@
"is-natural-number": { "is-natural-number": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz", "resolved": "https://registry.npmjs.org/is-natural-number/-/is-natural-number-4.0.1.tgz",
"integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg=", "integrity": "sha1-q5124dtM7VHjXeDHLr7PCfc0zeg="
"optional": true
}, },
"is-negated-glob": { "is-negated-glob": {
"version": "1.0.0", "version": "1.0.0",
@ -12236,7 +12231,6 @@
"integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==", "integrity": "sha512-I6Heg70nfF+e5Y3/qfthJFexhRw/Gi3bIymCoXAlijZdAcLaPuWSJs3KXyTYf23ID6g0o2QF62Yh+grOXY3Rig==",
"requires": { "requires": {
"inherits": "^2.0.1", "inherits": "^2.0.1",
"readable-stream": "^2.0.5",
"xtend": "^4.0.0" "xtend": "^4.0.0"
}, },
"dependencies": { "dependencies": {
@ -12421,44 +12415,32 @@
"xtend": "^4.0.1" "xtend": "^4.0.1"
}, },
"dependencies": { "dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=",
"dev": true
},
"object-keys": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz",
"integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=",
"dev": true
},
"readable-stream": { "readable-stream": {
"version": "1.0.34", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"dev": true, "dev": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
"inherits": "~2.0.1", "inherits": "~2.0.3",
"isarray": "0.0.1", "isarray": "~1.0.0",
"string_decoder": "~0.10.x" "process-nextick-args": "~2.0.0",
"safe-buffer": "~5.1.1",
"string_decoder": "~1.1.1",
"util-deprecate": "~1.0.1"
} }
}, },
"string_decoder": { "safe-buffer": {
"version": "0.10.31", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"dev": true "dev": true
}, },
"xtend": { "xtend": {
"version": "2.1.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
"integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
"dev": true, "dev": true
"requires": {
"object-keys": "~0.4.0"
}
} }
} }
}, },
@ -12623,7 +12605,6 @@
"version": "1.3.0", "version": "1.3.0",
"resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz",
"integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==",
"optional": true,
"requires": { "requires": {
"pify": "^3.0.0" "pify": "^3.0.0"
}, },
@ -12631,8 +12612,7 @@
"pify": { "pify": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
"integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY="
"optional": true
} }
} }
}, },
@ -12737,10 +12717,13 @@
} }
}, },
"async": { "async": {
"version": "1.5.2", "version": "2.6.3",
"resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz",
"integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==",
"dev": true "dev": true,
"requires": {
"lodash": "^4.17.14"
}
}, },
"ethereumjs-util": { "ethereumjs-util": {
"version": "5.2.1", "version": "5.2.1",
@ -13197,12 +13180,35 @@
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.1" "es-abstract": "^1.18.0-next.1"
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"object-keys": { "object-keys": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
"integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
"dev": true
}, },
"object-visit": { "object-visit": {
"version": "1.0.1", "version": "1.0.1",
@ -13545,8 +13551,7 @@
"pend": { "pend": {
"version": "1.2.0", "version": "1.2.0",
"resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz",
"integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=", "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA="
"optional": true
}, },
"performance-now": { "performance-now": {
"version": "2.1.0", "version": "2.1.0",
@ -14210,7 +14215,6 @@
"version": "1.2.1", "version": "1.2.1",
"resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz", "resolved": "https://registry.npmjs.org/scryptsy/-/scryptsy-1.2.1.tgz",
"integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=", "integrity": "sha1-oyJfpLJST4AnAHYeKFW987LZIWM=",
"optional": true,
"requires": { "requires": {
"pbkdf2": "^3.0.3" "pbkdf2": "^3.0.3"
} }
@ -14236,7 +14240,6 @@
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz", "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.6.tgz",
"integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==", "integrity": "sha512-e1QtP3YL5tWww8uKaOCQ18UxIT2laNBXHjV/S2WYCiK4udiv8lkG89KRIoCjUagnAmCBurjF4zEVX2ByBbnCjQ==",
"optional": true,
"requires": { "requires": {
"commander": "^2.8.1" "commander": "^2.8.1"
} }
@ -14247,12 +14250,6 @@
"integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==", "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==",
"dev": true "dev": true
}, },
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
},
"semver-greatest-satisfied-range": { "semver-greatest-satisfied-range": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz", "resolved": "https://registry.npmjs.org/semver-greatest-satisfied-range/-/semver-greatest-satisfied-range-1.1.0.tgz",
@ -14709,6 +14706,28 @@
"requires": { "requires": {
"define-properties": "^1.1.3", "define-properties": "^1.1.3",
"es-abstract": "^1.18.0-next.0" "es-abstract": "^1.18.0-next.0"
},
"dependencies": {
"es-abstract": {
"version": "1.18.0-next.1",
"resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz",
"integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==",
"dev": true,
"requires": {
"es-to-primitive": "^1.2.1",
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.1",
"is-callable": "^1.2.2",
"is-negative-zero": "^2.0.0",
"is-regex": "^1.1.1",
"object-inspect": "^1.8.0",
"object-keys": "^1.1.1",
"object.assign": "^4.1.1",
"string.prototype.trimend": "^1.0.1",
"string.prototype.trimstart": "^1.0.1"
}
}
} }
}, },
"string.prototype.trimend": { "string.prototype.trimend": {
@ -14735,6 +14754,13 @@
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
},
"dependencies": {
"safe-buffer": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
}
} }
}, },
"strip-ansi": { "strip-ansi": {
@ -14757,7 +14783,6 @@
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz",
"integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==", "integrity": "sha512-JOCxOeKLm2CAS73y/U4ZeZPTkE+gNVCzKt7Eox84Iej1LT/2pTWYpZKJuxwQpvX1LiZb1xokNR7RLfuBAa7T3g==",
"optional": true,
"requires": { "requires": {
"is-natural-number": "^4.0.1" "is-natural-number": "^4.0.1"
} }
@ -14962,7 +14987,6 @@
"version": "1.6.2", "version": "1.6.2",
"resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz",
"integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==", "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
"optional": true,
"requires": { "requires": {
"bl": "^1.0.0", "bl": "^1.0.0",
"buffer-alloc": "^1.2.0", "buffer-alloc": "^1.2.0",
@ -14976,14 +15000,12 @@
"isarray": { "isarray": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE="
"optional": true
}, },
"readable-stream": { "readable-stream": {
"version": "2.3.7", "version": "2.3.7",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
"integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
"optional": true,
"requires": { "requires": {
"core-util-is": "~1.0.0", "core-util-is": "~1.0.0",
"inherits": "~2.0.3", "inherits": "~2.0.3",
@ -14997,14 +15019,12 @@
"safe-buffer": { "safe-buffer": {
"version": "5.1.2", "version": "5.1.2",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
"optional": true
}, },
"string_decoder": { "string_decoder": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"optional": true,
"requires": { "requires": {
"safe-buffer": "~5.1.0" "safe-buffer": "~5.1.0"
} }
@ -15101,8 +15121,7 @@
"to-buffer": { "to-buffer": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz", "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
"integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg==", "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg=="
"optional": true
}, },
"to-fast-properties": { "to-fast-properties": {
"version": "1.0.3", "version": "1.0.3",
@ -15268,7 +15287,6 @@
"version": "1.4.3", "version": "1.4.3",
"resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz",
"integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==",
"optional": true,
"requires": { "requires": {
"buffer": "^5.2.1", "buffer": "^5.2.1",
"through": "^2.3.8" "through": "^2.3.8"
@ -15775,20 +15793,17 @@
"@types/node": { "@types/node": {
"version": "10.17.28", "version": "10.17.28",
"resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.28.tgz",
"integrity": "sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ==", "integrity": "sha512-dzjES1Egb4c1a89C7lKwQh8pwjYmlOAG9dW1pBgxEk57tMrLnssOfEthz8kdkNaBd7lIqQx7APm5+mZ619IiCQ=="
"optional": true
}, },
"aes-js": { "aes-js": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz",
"integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0=", "integrity": "sha1-4h3xCtbCBTKVvLuNq0Cwnb6ofk0="
"optional": true
}, },
"elliptic": { "elliptic": {
"version": "6.3.3", "version": "6.3.3",
"resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz",
"integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=",
"optional": true,
"requires": { "requires": {
"bn.js": "^4.4.0", "bn.js": "^4.4.0",
"brorand": "^1.0.1", "brorand": "^1.0.1",
@ -15817,7 +15832,6 @@
"version": "1.1.3", "version": "1.1.3",
"resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz",
"integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==",
"optional": true,
"requires": { "requires": {
"inherits": "^2.0.3", "inherits": "^2.0.3",
"minimalistic-assert": "^1.0.0" "minimalistic-assert": "^1.0.0"
@ -15826,26 +15840,22 @@
"js-sha3": { "js-sha3": {
"version": "0.5.7", "version": "0.5.7",
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz",
"integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=", "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc="
"optional": true
}, },
"scrypt-js": { "scrypt-js": {
"version": "2.0.3", "version": "2.0.3",
"resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz", "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-2.0.3.tgz",
"integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q=", "integrity": "sha1-uwBAvgMEPamgEqLOqfyfhSz8h9Q="
"optional": true
}, },
"setimmediate": { "setimmediate": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz",
"integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=", "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48="
"optional": true
}, },
"uuid": { "uuid": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz",
"integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=", "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w="
"optional": true
} }
} }
}, },
@ -15938,9 +15948,9 @@
}, },
"dependencies": { "dependencies": {
"bn.js": { "bn.js": {
"version": "4.11.8", "version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true, "dev": true,
"optional": true "optional": true
} }
@ -16296,6 +16306,14 @@
"prr": "~1.0.1", "prr": "~1.0.1",
"semver": "~5.4.1", "semver": "~5.4.1",
"xtend": "~4.0.0" "xtend": "~4.0.0"
},
"dependencies": {
"semver": {
"version": "5.4.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz",
"integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==",
"dev": true
}
} }
}, },
"merkle-patricia-tree": { "merkle-patricia-tree": {
@ -16457,9 +16475,9 @@
}, },
"dependencies": { "dependencies": {
"bn.js": { "bn.js": {
"version": "4.11.8", "version": "4.11.9",
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz",
"integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==", "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==",
"dev": true, "dev": true,
"optional": true "optional": true
}, },
@ -16613,8 +16631,7 @@
"xmlhttprequest": { "xmlhttprequest": {
"version": "1.8.0", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz", "resolved": "https://registry.npmjs.org/xmlhttprequest/-/xmlhttprequest-1.8.0.tgz",
"integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw=", "integrity": "sha1-Z/4HXFwk/vOfnWX197f+dRcZaPw="
"optional": true
}, },
"xtend": { "xtend": {
"version": "4.0.2", "version": "4.0.2",
@ -16670,7 +16687,6 @@
"version": "2.10.0", "version": "2.10.0",
"resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz",
"integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=",
"optional": true,
"requires": { "requires": {
"buffer-crc32": "~0.2.3", "buffer-crc32": "~0.2.3",
"fd-slicer": "~1.1.0" "fd-slicer": "~1.1.0"

View File

@ -1,4 +1,4 @@
pragma solidity ^0.6.8; pragma solidity 0.6.12;
pragma experimental ABIEncoderV2; pragma experimental ABIEncoderV2;
import { 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 {StableDebtToken} from '../../contracts/tokenization/StableDebtToken.sol';
import {IncentivizedERC20} from '../../contracts/tokenization/IncentivizedERC20.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; pragma experimental ABIEncoderV2;
import {UserConfiguration} from '../../contracts/libraries/configuration/UserConfiguration.sol'; import {UserConfiguration} from '../../contracts/libraries/configuration/UserConfiguration.sol';