mirror of
				https://github.com/Instadapp/aave-protocol-v2.git
				synced 2024-07-29 21:47:30 +00:00 
			
		
		
		
	Change modifier to function to save code size
This commit is contained in:
		
							parent
							
								
									227c0b4962
								
							
						
					
					
						commit
						bfc46daadd
					
				| 
						 | 
				
			
			@ -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;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user