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
|
// @ts-ignore
|
||||||
import {accounts} from './test-wallets.js';
|
import {accounts} from './test-wallets.js';
|
||||||
import {eEthereumNetwork} from './helpers/types';
|
import {eEthereumNetwork} from './helpers/types';
|
||||||
import { BUIDLEREVM_CHAINID, COVERAGE_CHAINID } from './helpers/constants';
|
|
||||||
|
|
||||||
usePlugin('@nomiclabs/buidler-ethers');
|
usePlugin('@nomiclabs/buidler-ethers');
|
||||||
usePlugin('buidler-typechain');
|
usePlugin('buidler-typechain');
|
||||||
|
@ -11,6 +10,8 @@ usePlugin('@nomiclabs/buidler-waffle');
|
||||||
usePlugin('@nomiclabs/buidler-etherscan');
|
usePlugin('@nomiclabs/buidler-etherscan');
|
||||||
//usePlugin('buidler-gas-reporter');
|
//usePlugin('buidler-gas-reporter');
|
||||||
|
|
||||||
|
const BUIDLEREVM_CHAINID = 31337;
|
||||||
|
const COVERAGE_CHAINID = 1337;
|
||||||
const DEFAULT_BLOCK_GAS_LIMIT = 10000000;
|
const DEFAULT_BLOCK_GAS_LIMIT = 10000000;
|
||||||
const DEFAULT_GAS_PRICE = 10;
|
const DEFAULT_GAS_PRICE = 10;
|
||||||
const HARDFORK = 'istanbul';
|
const HARDFORK = 'istanbul';
|
||||||
|
|
|
@ -59,12 +59,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
|
||||||
);
|
);
|
||||||
_;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint256 public constant UINT_MAX_VALUE = uint256(-1);
|
uint256 public constant UINT_MAX_VALUE = uint256(-1);
|
||||||
|
@ -431,7 +430,6 @@ contract LendingPool is VersionedInitializable, ILendingPool {
|
||||||
uint256 purchaseAmount,
|
uint256 purchaseAmount,
|
||||||
bool receiveAToken
|
bool receiveAToken
|
||||||
) external override {
|
) external override {
|
||||||
|
|
||||||
address liquidationManager = _addressesProvider.getLendingPoolLiquidationManager();
|
address liquidationManager = _addressesProvider.getLendingPoolLiquidationManager();
|
||||||
|
|
||||||
//solium-disable-next-line
|
//solium-disable-next-line
|
||||||
|
@ -791,7 +789,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,
|
||||||
|
@ -810,16 +809,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
10677
package-lock.json
generated
10677
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user