feat: added isContract() check on rebalanceStableBorrowRate()

This commit is contained in:
emilio 2021-06-15 18:38:51 +02:00
parent 4b12f1916c
commit 0a58e714bf
2 changed files with 6 additions and 0 deletions

View File

@ -26,6 +26,7 @@ import {ReserveConfiguration} from '../libraries/configuration/ReserveConfigurat
import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol';
import {DataTypes} from '../libraries/types/DataTypes.sol';
import {LendingPoolStorage} from './LendingPoolStorage.sol';
import {Address} from '../../dependencies/openzeppelin/contracts/Address.sol';
/**
* @title LendingPool contract
@ -50,6 +51,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
using PercentageMath for uint256;
using SafeERC20 for IERC20;
using ReserveLogic for DataTypes.ReserveCache;
using Address for address;
uint256 public constant LENDINGPOOL_REVISION = 0x2;
@ -326,6 +328,9 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage
* @param user The address of the user to be rebalanced
**/
function rebalanceStableBorrowRate(address asset, address user) external override whenNotPaused {
require(!address(msg.sender).isContract(), Errors.LP_CALLER_NOT_EOA);
DataTypes.ReserveData storage reserve = _reserves[asset];
DataTypes.ReserveCache memory reserveCache = reserve.cache();

View File

@ -112,6 +112,7 @@ library Errors {
string public constant RL_ATOKEN_SUPPLY_NOT_ZERO = '88';
string public constant RL_STABLE_DEBT_NOT_ZERO = '89';
string public constant RL_VARIABLE_DEBT_SUPPLY_NOT_ZERO = '90';
string public constant LP_CALLER_NOT_EOA = '91';
enum CollateralManagerErrors {
NO_ERROR,