mirror of
https://github.com/Instadapp/aave-protocol-v2.git
synced 2024-07-29 21:47:30 +00:00
Merge branch 'feat/modifier-to-function' into 'master'
Change modifier to function to save code size See merge request aave-tech/protocol-v2!47
This commit is contained in:
commit
191f65c7f0
|
@ -1,8 +1,7 @@
|
|||
import {usePlugin, BuidlerConfig} from '@nomiclabs/buidler/config';
|
||||
import {usePlugin} from '@nomiclabs/buidler/config';
|
||||
// @ts-ignore
|
||||
import {accounts} from './test-wallets.js';
|
||||
import {eEthereumNetwork} from './helpers/types';
|
||||
import { BUIDLEREVM_CHAINID, COVERAGE_CHAINID } from './helpers/constants';
|
||||
|
||||
usePlugin('@nomiclabs/buidler-ethers');
|
||||
usePlugin('buidler-typechain');
|
||||
|
@ -11,6 +10,8 @@ usePlugin('@nomiclabs/buidler-waffle');
|
|||
usePlugin('@nomiclabs/buidler-etherscan');
|
||||
//usePlugin('buidler-gas-reporter');
|
||||
|
||||
const BUIDLEREVM_CHAINID = 31337;
|
||||
const COVERAGE_CHAINID = 1337;
|
||||
const DEFAULT_BLOCK_GAS_LIMIT = 10000000;
|
||||
const DEFAULT_GAS_PRICE = 10;
|
||||
const HARDFORK = 'istanbul';
|
||||
|
|
|
@ -59,12 +59,11 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
|||
/**
|
||||
* @dev only lending pools configurator can use functions affected by this modifier
|
||||
**/
|
||||
modifier onlyLendingPoolConfigurator {
|
||||
function onlyLendingPoolConfigurator() internal view {
|
||||
require(
|
||||
_addressesProvider.getLendingPoolConfigurator() == msg.sender,
|
||||
Errors.CALLER_NOT_LENDING_POOL_CONFIGURATOR
|
||||
);
|
||||
_;
|
||||
}
|
||||
|
||||
uint256 public constant UINT_MAX_VALUE = uint256(-1);
|
||||
|
@ -431,7 +430,6 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
|||
uint256 purchaseAmount,
|
||||
bool receiveAToken
|
||||
) external override {
|
||||
|
||||
address liquidationManager = _addressesProvider.getLendingPoolLiquidationManager();
|
||||
|
||||
//solium-disable-next-line
|
||||
|
@ -791,7 +789,8 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
|||
address stableDebtAddress,
|
||||
address variableDebtAddress,
|
||||
address interestRateStrategyAddress
|
||||
) external override onlyLendingPoolConfigurator {
|
||||
) external override {
|
||||
onlyLendingPoolConfigurator();
|
||||
_reserves[asset].init(
|
||||
aTokenAddress,
|
||||
stableDebtAddress,
|
||||
|
@ -810,16 +809,13 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
|||
function setReserveInterestRateStrategyAddress(address asset, address rateStrategyAddress)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
onlyLendingPoolConfigurator();
|
||||
_reserves[asset].interestRateStrategyAddress = rateStrategyAddress;
|
||||
}
|
||||
|
||||
function setConfiguration(address asset, uint256 configuration)
|
||||
external
|
||||
override
|
||||
onlyLendingPoolConfigurator
|
||||
{
|
||||
function setConfiguration(address asset, uint256 configuration) external override {
|
||||
onlyLendingPoolConfigurator();
|
||||
_reserves[asset].configuration.data = configuration;
|
||||
}
|
||||
|
||||
|
|
10681
package-lock.json
generated
10681
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user