Added isContract to check asset at LendingPool.initResetve function

This commit is contained in:
David Racero 2020-11-10 17:50:13 +01:00
parent 74ab2fd126
commit 743eb6ec29
2 changed files with 3 additions and 0 deletions

View File

@ -25,6 +25,7 @@ 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';
/** /**
* @title LendingPool contract * @title LendingPool contract
@ -744,6 +745,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
address variableDebtAddress, address variableDebtAddress,
address interestRateStrategyAddress address interestRateStrategyAddress
) external override { ) external override {
require(Address.isContract(asset), Errors.LP_NOT_CONTRACT);
_onlyLendingPoolConfigurator(); _onlyLendingPoolConfigurator();
_reserves[asset].init( _reserves[asset].init(
aTokenAddress, aTokenAddress,

View File

@ -97,6 +97,7 @@ library Errors {
string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = '73'; string public constant VL_INCONSISTENT_FLASHLOAN_PARAMS = '73';
string public constant LP_INCONSISTENT_PARAMS_LENGTH = '74'; string public constant LP_INCONSISTENT_PARAMS_LENGTH = '74';
string public constant UL_INVALID_INDEX = '77'; string public constant UL_INVALID_INDEX = '77';
string public constant LP_NOT_CONTRACT = '78';
enum CollateralManagerErrors { enum CollateralManagerErrors {
NO_ERROR, NO_ERROR,