mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
feat: added isContract() check on rebalanceStableBorrowRate()
This commit is contained in:
parent
4b12f1916c
commit
0a58e714bf
|
@ -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();
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue
Block a user