mirror of
				https://github.com/Instadapp/aave-protocol-v2.git
				synced 2024-07-29 21:47:30 +00:00 
			
		
		
		
	added function to update the aToken instance
This commit is contained in:
		
							parent
							
								
									fb5377a63e
								
							
						
					
					
						commit
						734d125cd7
					
				| 
						 | 
				
			
			@ -180,7 +180,6 @@ contract LendingPoolConfigurator is VersionedInitializable {
 | 
			
		|||
    uint8 _underlyingAssetDecimals,
 | 
			
		||||
    address _interestRateStrategyAddress
 | 
			
		||||
  ) public onlyLendingPoolManager {
 | 
			
		||||
 | 
			
		||||
    InitializableAdminUpgradeabilityProxy aTokenProxy = new InitializableAdminUpgradeabilityProxy();
 | 
			
		||||
 | 
			
		||||
    bytes memory params = abi.encodeWithSignature(
 | 
			
		||||
| 
						 | 
				
			
			@ -212,6 +211,25 @@ contract LendingPoolConfigurator is VersionedInitializable {
 | 
			
		|||
    emit ReserveInitialized(_reserve, address(aTokenProxy), _interestRateStrategyAddress);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function updateAToken(address _reserve, address _implementation) external onlyLendingPoolManager {
 | 
			
		||||
    (address aTokenAddress, , ) = pool.getReserveTokensAddresses(_reserve);
 | 
			
		||||
 | 
			
		||||
    uint8 decimals = IERC20Detailed(aTokenAddress).decimals();
 | 
			
		||||
 | 
			
		||||
    InitializableAdminUpgradeabilityProxy aTokenProxy = InitializableAdminUpgradeabilityProxy(
 | 
			
		||||
      payable(aTokenAddress)
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    bytes memory params = abi.encodeWithSignature(
 | 
			
		||||
      'initialize(uint8,string,string)',
 | 
			
		||||
      decimals,
 | 
			
		||||
      IERC20Detailed(aTokenAddress).name(),
 | 
			
		||||
      IERC20Detailed(aTokenAddress).symbol()
 | 
			
		||||
    );
 | 
			
		||||
 | 
			
		||||
    aTokenProxy.upgradeToAndCall(_implementation, params);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /**
 | 
			
		||||
   * @dev enables borrowing on a reserve
 | 
			
		||||
   * @param _reserve the address of the reserve
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user