mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge feat/modifier-to-function fixes
This commit is contained in:
commit
0150ba70e7
|
@ -1,4 +1,4 @@
|
||||||
import {usePlugin, BuidlerConfig} from '@nomiclabs/buidler/config';
|
import {usePlugin} from '@nomiclabs/buidler/config';
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
import {accounts} from './test-wallets.js';
|
import {accounts} from './test-wallets.js';
|
||||||
import {eEthereumNetwork} from './helpers/types';
|
import {eEthereumNetwork} from './helpers/types';
|
||||||
|
|
|
@ -60,12 +60,11 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
/**
|
/**
|
||||||
* @dev only lending pools configurator can use functions affected by this modifier
|
* @dev only lending pools configurator can use functions affected by this modifier
|
||||||
**/
|
**/
|
||||||
modifier onlyLendingPoolConfigurator {
|
function onlyLendingPoolConfigurator() internal view {
|
||||||
require(
|
require(
|
||||||
_addressesProvider.getLendingPoolConfigurator() == msg.sender,
|
_addressesProvider.getLendingPoolConfigurator() == msg.sender,
|
||||||
Errors.CALLER_NOT_LENDING_POOL_CONFIGURATOR
|
Errors.CALLER_NOT_LENDING_POOL_CONFIGURATOR
|
||||||
);
|
);
|
||||||
_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -814,7 +813,8 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
address stableDebtAddress,
|
address stableDebtAddress,
|
||||||
address variableDebtAddress,
|
address variableDebtAddress,
|
||||||
address interestRateStrategyAddress
|
address interestRateStrategyAddress
|
||||||
) external override onlyLendingPoolConfigurator {
|
) external override {
|
||||||
|
onlyLendingPoolConfigurator();
|
||||||
_reserves[asset].init(
|
_reserves[asset].init(
|
||||||
aTokenAddress,
|
aTokenAddress,
|
||||||
stableDebtAddress,
|
stableDebtAddress,
|
||||||
|
@ -833,16 +833,13 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
|
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
|
||||||
external
|
external
|
||||||
override
|
override
|
||||||
onlyLendingPoolConfigurator
|
|
||||||
{
|
{
|
||||||
|
onlyLendingPoolConfigurator();
|
||||||
_reserves[asset].interestRateStrategyAddress = rateStrategyAddress;
|
_reserves[asset].interestRateStrategyAddress = rateStrategyAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
function setConfiguration(address asset, uint256 configuration)
|
function setConfiguration(address asset, uint256 configuration) external override {
|
||||||
external
|
onlyLendingPoolConfigurator();
|
||||||
override
|
|
||||||
onlyLendingPoolConfigurator
|
|
||||||
{
|
|
||||||
_reserves[asset].configuration.data = configuration;
|
_reserves[asset].configuration.data = configuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1021,13 +1018,12 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @dev Returns to normal state.
|
* @dev Set the _pause state
|
||||||
*
|
* @param val the boolean value to set the current pause state of LendingPool
|
||||||
* Requirements:
|
|
||||||
*
|
|
||||||
* - The contract must be paused.
|
|
||||||
*/
|
*/
|
||||||
function setPause(bool val) external override onlyLendingPoolConfigurator {
|
function setPause(bool val) external override {
|
||||||
|
onlyLendingPoolConfigurator();
|
||||||
|
|
||||||
_paused = val;
|
_paused = val;
|
||||||
if (_paused) {
|
if (_paused) {
|
||||||
emit Paused();
|
emit Paused();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user