From 396ce873a0f80371ad145593386161576d69532f Mon Sep 17 00:00:00 2001 From: miguelmtzinf Date: Tue, 27 Jul 2021 18:50:53 +0200 Subject: [PATCH] feat: Rename LendingPoolAddressesProvider to PoolAddressesProvider --- contracts/adapters/BaseUniswapAdapter.sol | 4 ++-- contracts/adapters/FlashLiquidationAdapter.sol | 4 ++-- .../adapters/UniswapLiquiditySwapAdapter.sol | 4 ++-- contracts/adapters/UniswapRepayAdapter.sol | 4 ++-- contracts/deployments/ATokensAndRatesHelper.sol | 6 +++--- .../flashloan/base/FlashLoanReceiverBase.sol | 6 +++--- .../flashloan/interfaces/IFlashLoanReceiver.sol | 4 ++-- contracts/interfaces/ILendingPool.sol | 6 +++--- .../ILendingPoolAddressesProviderRegistry.sol | 4 ++-- ...esProvider.sol => IPoolAddressesProvider.sol} | 4 ++-- contracts/misc/AaveProtocolDataProvider.sol | 6 +++--- contracts/misc/UiPoolDataProvider.sol | 4 ++-- contracts/misc/WETHGateway.sol | 2 +- contracts/misc/WalletBalanceProvider.sol | 4 ++-- .../misc/interfaces/IUiPoolDataProvider.sol | 4 ++-- .../mocks/flashloan/MockFlashLoanReceiver.sol | 6 +++--- .../LendingPoolAddressesProviderRegistry.sol | 16 ++++++++-------- ...sesProvider.sol => PoolAddressesProvider.sol} | 8 ++++---- .../DefaultReserveInterestRateStrategy.sol | 8 ++++---- contracts/protocol/lendingpool/LendingPool.sol | 16 ++++++++-------- .../lendingpool/LendingPoolConfigurator.sol | 6 +++--- .../protocol/lendingpool/LendingPoolStorage.sol | 4 ++-- helpers/contracts-deployments.ts | 8 ++++---- helpers/contracts-getters.ts | 8 ++++---- helpers/init-helpers.ts | 6 +++--- helpers/types.ts | 2 +- .../LendingPoolHarnessForVariableDebtToken.sol | 6 +++--- tasks/deployments/add-market-to-registry.ts | 6 +++--- .../deploy-UniswapLiquiditySwapAdapter.ts | 2 +- tasks/deployments/deploy-UniswapRepayAdapter.ts | 2 +- tasks/dev/2_address_provider_registry.ts | 4 ++-- tasks/dev/3_lending_pool.ts | 4 ++-- tasks/dev/4_oracles.ts | 4 ++-- tasks/dev/5_initialize.ts | 4 ++-- tasks/dev/6_wallet_balance_provider.ts | 2 +- tasks/full/1_address_provider.ts | 4 ++-- tasks/full/2_lending_pool.ts | 4 ++-- tasks/full/3_oracles.ts | 4 ++-- tasks/full/4_data-provider.ts | 4 ++-- tasks/full/6-initialize.ts | 4 ++-- tasks/helpers/deploy-new-asset.ts | 4 ++-- tasks/misc/print-config.ts | 4 ++-- tasks/verifications/1_general.ts | 6 +++--- tasks/verifications/2_tokens.ts | 4 ++-- test-suites/test-aave/__setup.spec.ts | 4 ++-- test-suites/test-aave/helpers/make-suite.ts | 10 +++++----- .../lending-pool-addresses-provider.spec.ts | 4 ++-- test-suites/test-amm/__setup.spec.ts | 4 ++-- test-suites/test-amm/helpers/make-suite.ts | 10 +++++----- .../lending-pool-addresses-provider.spec.ts | 4 ++-- 50 files changed, 131 insertions(+), 131 deletions(-) rename contracts/interfaces/{ILendingPoolAddressesProvider.sol => IPoolAddressesProvider.sol} (96%) rename contracts/protocol/configuration/{LendingPoolAddressesProvider.sol => PoolAddressesProvider.sol} (96%) diff --git a/contracts/adapters/BaseUniswapAdapter.sol b/contracts/adapters/BaseUniswapAdapter.sol index 5a866dba2..3a83584b3 100644 --- a/contracts/adapters/BaseUniswapAdapter.sol +++ b/contracts/adapters/BaseUniswapAdapter.sol @@ -8,7 +8,7 @@ import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {Ownable} from '../dependencies/openzeppelin/contracts/Ownable.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; import {IPriceOracleGetter} from '../interfaces/IPriceOracleGetter.sol'; @@ -38,7 +38,7 @@ abstract contract BaseUniswapAdapter is FlashLoanReceiverBase, IBaseUniswapAdapt IUniswapV2Router02 public immutable override UNISWAP_ROUTER; constructor( - ILendingPoolAddressesProvider addressesProvider, + IPoolAddressesProvider addressesProvider, IUniswapV2Router02 uniswapRouter, address wethAddress ) public FlashLoanReceiverBase(addressesProvider) { diff --git a/contracts/adapters/FlashLiquidationAdapter.sol b/contracts/adapters/FlashLiquidationAdapter.sol index d488ee7b0..4b4893fe1 100644 --- a/contracts/adapters/FlashLiquidationAdapter.sol +++ b/contracts/adapters/FlashLiquidationAdapter.sol @@ -3,7 +3,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; @@ -41,7 +41,7 @@ contract FlashLiquidationAdapter is BaseUniswapAdapter { } constructor( - ILendingPoolAddressesProvider addressesProvider, + IPoolAddressesProvider addressesProvider, IUniswapV2Router02 uniswapRouter, address wethAddress ) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {} diff --git a/contracts/adapters/UniswapLiquiditySwapAdapter.sol b/contracts/adapters/UniswapLiquiditySwapAdapter.sol index daac3547c..9b31a9e8e 100644 --- a/contracts/adapters/UniswapLiquiditySwapAdapter.sol +++ b/contracts/adapters/UniswapLiquiditySwapAdapter.sol @@ -3,7 +3,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; @@ -30,7 +30,7 @@ contract UniswapLiquiditySwapAdapter is BaseUniswapAdapter { } constructor( - ILendingPoolAddressesProvider addressesProvider, + IPoolAddressesProvider addressesProvider, IUniswapV2Router02 uniswapRouter, address wethAddress ) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {} diff --git a/contracts/adapters/UniswapRepayAdapter.sol b/contracts/adapters/UniswapRepayAdapter.sol index b1c95337d..815113f48 100644 --- a/contracts/adapters/UniswapRepayAdapter.sol +++ b/contracts/adapters/UniswapRepayAdapter.sol @@ -3,7 +3,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {BaseUniswapAdapter} from './BaseUniswapAdapter.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {IUniswapV2Router02} from '../interfaces/IUniswapV2Router02.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; @@ -23,7 +23,7 @@ contract UniswapRepayAdapter is BaseUniswapAdapter { } constructor( - ILendingPoolAddressesProvider addressesProvider, + IPoolAddressesProvider addressesProvider, IUniswapV2Router02 uniswapRouter, address wethAddress ) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {} diff --git a/contracts/deployments/ATokensAndRatesHelper.sol b/contracts/deployments/ATokensAndRatesHelper.sol index 15a5e81a6..41a97d035 100644 --- a/contracts/deployments/ATokensAndRatesHelper.sol +++ b/contracts/deployments/ATokensAndRatesHelper.sol @@ -4,8 +4,8 @@ pragma experimental ABIEncoderV2; import {LendingPool} from '../protocol/lendingpool/LendingPool.sol'; import { - LendingPoolAddressesProvider -} from '../protocol/configuration/LendingPoolAddressesProvider.sol'; + PoolAddressesProvider +} from '../protocol/configuration/PoolAddressesProvider.sol'; import {LendingPoolConfigurator} from '../protocol/lendingpool/LendingPoolConfigurator.sol'; import {AToken} from '../protocol/tokenization/AToken.sol'; import { @@ -53,7 +53,7 @@ contract ATokensAndRatesHelper is Ownable { address(new AToken()), address( new DefaultReserveInterestRateStrategy( - LendingPoolAddressesProvider(addressesProvider), + PoolAddressesProvider(addressesProvider), inputParams[i].rates[0], inputParams[i].rates[1], inputParams[i].rates[2], diff --git a/contracts/flashloan/base/FlashLoanReceiverBase.sol b/contracts/flashloan/base/FlashLoanReceiverBase.sol index cab5e4db4..b138eb3e2 100644 --- a/contracts/flashloan/base/FlashLoanReceiverBase.sol +++ b/contracts/flashloan/base/FlashLoanReceiverBase.sol @@ -5,17 +5,17 @@ import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {IFlashLoanReceiver} from '../interfaces/IFlashLoanReceiver.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol'; abstract contract FlashLoanReceiverBase is IFlashLoanReceiver { using SafeERC20 for IERC20; using SafeMath for uint256; - ILendingPoolAddressesProvider public immutable override ADDRESSES_PROVIDER; + IPoolAddressesProvider public immutable override ADDRESSES_PROVIDER; ILendingPool public immutable override LENDING_POOL; - constructor(ILendingPoolAddressesProvider provider) public { + constructor(IPoolAddressesProvider provider) public { ADDRESSES_PROVIDER = provider; LENDING_POOL = ILendingPool(provider.getLendingPool()); } diff --git a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol index 7e1b11919..56ed01be8 100644 --- a/contracts/flashloan/interfaces/IFlashLoanReceiver.sol +++ b/contracts/flashloan/interfaces/IFlashLoanReceiver.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: agpl-3.0 pragma solidity 0.6.12; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol'; /** @@ -19,7 +19,7 @@ interface IFlashLoanReceiver { bytes calldata params ) external returns (bool); - function ADDRESSES_PROVIDER() external view returns (ILendingPoolAddressesProvider); + function ADDRESSES_PROVIDER() external view returns (IPoolAddressesProvider); function LENDING_POOL() external view returns (ILendingPool); } diff --git a/contracts/interfaces/ILendingPool.sol b/contracts/interfaces/ILendingPool.sol index 82bc7389b..2b464cfd7 100644 --- a/contracts/interfaces/ILendingPool.sol +++ b/contracts/interfaces/ILendingPool.sol @@ -2,7 +2,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import {ILendingPoolAddressesProvider} from './ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from './IPoolAddressesProvider.sol'; import {DataTypes} from '../protocol/libraries/types/DataTypes.sol'; interface ILendingPool { @@ -493,9 +493,9 @@ interface ILendingPool { function getReservesList() external view returns (address[] memory); /** - * @dev Returns the cached LendingPoolAddressesProvider connected to this contract + * @dev Returns the cached PoolAddressesProvider connected to this contract **/ - function getAddressesProvider() external view returns (ILendingPoolAddressesProvider); + function getAddressesProvider() external view returns (IPoolAddressesProvider); /** * @dev Set the _pause state of a reserve diff --git a/contracts/interfaces/ILendingPoolAddressesProviderRegistry.sol b/contracts/interfaces/ILendingPoolAddressesProviderRegistry.sol index 89f0c61e9..fc713c95f 100644 --- a/contracts/interfaces/ILendingPoolAddressesProviderRegistry.sol +++ b/contracts/interfaces/ILendingPoolAddressesProviderRegistry.sol @@ -3,9 +3,9 @@ pragma solidity 0.6.12; /** * @title LendingPoolAddressesProviderRegistry contract - * @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets + * @dev Main registry of PoolAddressesProvider of multiple Aave protocol's markets * - Used for indexing purposes of Aave protocol's markets - * - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with, + * - The id assigned to a PoolAddressesProvider refers to the market it is connected with, * for example with `0` for the Aave main market and `1` for the next created * @author Aave **/ diff --git a/contracts/interfaces/ILendingPoolAddressesProvider.sol b/contracts/interfaces/IPoolAddressesProvider.sol similarity index 96% rename from contracts/interfaces/ILendingPoolAddressesProvider.sol rename to contracts/interfaces/IPoolAddressesProvider.sol index 2eb16dcc2..fd12f4a77 100644 --- a/contracts/interfaces/ILendingPoolAddressesProvider.sol +++ b/contracts/interfaces/IPoolAddressesProvider.sol @@ -2,13 +2,13 @@ pragma solidity 0.6.12; /** - * @title LendingPoolAddressesProvider contract + * @title PoolAddressesProvider contract * @dev Main registry of addresses part of or connected to the protocol, including permissioned roles * - Acting also as factory of proxies and admin of those, so with right to change its implementations * - Owned by the Aave Governance * @author Aave **/ -interface ILendingPoolAddressesProvider { +interface IPoolAddressesProvider { event MarketIdSet(string newMarketId); event LendingPoolUpdated(address indexed newAddress); event ConfigurationAdminUpdated(address indexed newAddress); diff --git a/contracts/misc/AaveProtocolDataProvider.sol b/contracts/misc/AaveProtocolDataProvider.sol index 5afbac050..0fbbf3274 100644 --- a/contracts/misc/AaveProtocolDataProvider.sol +++ b/contracts/misc/AaveProtocolDataProvider.sol @@ -3,7 +3,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {IStableDebtToken} from '../interfaces/IStableDebtToken.sol'; import {IVariableDebtToken} from '../interfaces/IVariableDebtToken.sol'; @@ -23,9 +23,9 @@ contract AaveProtocolDataProvider { address tokenAddress; } - ILendingPoolAddressesProvider public immutable ADDRESSES_PROVIDER; + IPoolAddressesProvider public immutable ADDRESSES_PROVIDER; - constructor(ILendingPoolAddressesProvider addressesProvider) public { + constructor(IPoolAddressesProvider addressesProvider) public { ADDRESSES_PROVIDER = addressesProvider; } diff --git a/contracts/misc/UiPoolDataProvider.sol b/contracts/misc/UiPoolDataProvider.sol index 8c5621e71..0d07adac4 100644 --- a/contracts/misc/UiPoolDataProvider.sol +++ b/contracts/misc/UiPoolDataProvider.sol @@ -3,7 +3,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import {IERC20Detailed} from '../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {IAaveIncentivesController} from '../interfaces/IAaveIncentivesController.sol'; import {IUiPoolDataProvider} from './interfaces/IUiPoolDataProvider.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol'; @@ -51,7 +51,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider { ); } - function getReservesData(ILendingPoolAddressesProvider provider, address user) + function getReservesData(IPoolAddressesProvider provider, address user) external view override diff --git a/contracts/misc/WETHGateway.sol b/contracts/misc/WETHGateway.sol index 39ecf909f..a2fb98e8c 100644 --- a/contracts/misc/WETHGateway.sol +++ b/contracts/misc/WETHGateway.sol @@ -20,7 +20,7 @@ contract WETHGateway is IWETHGateway, Ownable { IWETH internal immutable WETH; /** - * @dev Sets the WETH address and the LendingPoolAddressesProvider address. Infinite approves lending pool. + * @dev Sets the WETH address and the PoolAddressesProvider address. Infinite approves lending pool. * @param weth Address of the Wrapped Ether contract **/ constructor(address weth) public { diff --git a/contracts/misc/WalletBalanceProvider.sol b/contracts/misc/WalletBalanceProvider.sol index 22a6f55eb..4dee14b54 100644 --- a/contracts/misc/WalletBalanceProvider.sol +++ b/contracts/misc/WalletBalanceProvider.sol @@ -6,7 +6,7 @@ pragma experimental ABIEncoderV2; import {Address} from '../dependencies/openzeppelin/contracts/Address.sol'; import {IERC20} from '../dependencies/openzeppelin/contracts/IERC20.sol'; -import {ILendingPoolAddressesProvider} from '../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../interfaces/IPoolAddressesProvider.sol'; import {ILendingPool} from '../interfaces/ILendingPool.sol'; import {SafeERC20} from '../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {ReserveConfiguration} from '../protocol/libraries/configuration/ReserveConfiguration.sol'; @@ -81,7 +81,7 @@ contract WalletBalanceProvider { view returns (address[] memory, uint256[] memory) { - ILendingPool pool = ILendingPool(ILendingPoolAddressesProvider(provider).getLendingPool()); + ILendingPool pool = ILendingPool(IPoolAddressesProvider(provider).getLendingPool()); address[] memory reserves = pool.getReservesList(); address[] memory reservesWithEth = new address[](reserves.length + 1); diff --git a/contracts/misc/interfaces/IUiPoolDataProvider.sol b/contracts/misc/interfaces/IUiPoolDataProvider.sol index ac7d344a5..7ee1a2efe 100644 --- a/contracts/misc/interfaces/IUiPoolDataProvider.sol +++ b/contracts/misc/interfaces/IUiPoolDataProvider.sol @@ -2,7 +2,7 @@ pragma solidity 0.6.12; pragma experimental ABIEncoderV2; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {IAaveIncentivesController} from '../../interfaces/IAaveIncentivesController.sol'; interface IUiPoolDataProvider { @@ -71,7 +71,7 @@ interface IUiPoolDataProvider { uint256 sTokenincentivesUserIndex; } - function getReservesData(ILendingPoolAddressesProvider provider, address user) + function getReservesData(IPoolAddressesProvider provider, address user) external view returns ( diff --git a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol index 9bf297308..f5d01a467 100644 --- a/contracts/mocks/flashloan/MockFlashLoanReceiver.sol +++ b/contracts/mocks/flashloan/MockFlashLoanReceiver.sol @@ -7,12 +7,12 @@ import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {FlashLoanReceiverBase} from '../../flashloan/base/FlashLoanReceiverBase.sol'; import {MintableERC20} from '../tokens/MintableERC20.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; contract MockFlashLoanReceiver is FlashLoanReceiverBase { using SafeERC20 for IERC20; - ILendingPoolAddressesProvider internal _provider; + IPoolAddressesProvider internal _provider; event ExecutedWithFail(address[] _assets, uint256[] _amounts, uint256[] _premiums); event ExecutedWithSuccess(address[] _assets, uint256[] _amounts, uint256[] _premiums); @@ -21,7 +21,7 @@ contract MockFlashLoanReceiver is FlashLoanReceiverBase { uint256 _amountToApprove; bool _simulateEOA; - constructor(ILendingPoolAddressesProvider provider) public FlashLoanReceiverBase(provider) {} + constructor(IPoolAddressesProvider provider) public FlashLoanReceiverBase(provider) {} function setFailExecutionTransfer(bool fail) public { _failExecution = fail; diff --git a/contracts/protocol/configuration/LendingPoolAddressesProviderRegistry.sol b/contracts/protocol/configuration/LendingPoolAddressesProviderRegistry.sol index 20b11e0e5..0b98d414d 100644 --- a/contracts/protocol/configuration/LendingPoolAddressesProviderRegistry.sol +++ b/contracts/protocol/configuration/LendingPoolAddressesProviderRegistry.sol @@ -9,9 +9,9 @@ import {Errors} from '../libraries/helpers/Errors.sol'; /** * @title LendingPoolAddressesProviderRegistry contract - * @dev Main registry of LendingPoolAddressesProvider of multiple Aave protocol's markets + * @dev Main registry of PoolAddressesProvider of multiple Aave protocol's markets * - Used for indexing purposes of Aave protocol's markets - * - The id assigned to a LendingPoolAddressesProvider refers to the market it is connected with, + * - The id assigned to a PoolAddressesProvider refers to the market it is connected with, * for example with `0` for the Aave main market and `1` for the next created * @author Aave **/ @@ -41,8 +41,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP /** * @dev Registers an addresses provider - * @param provider The address of the new LendingPoolAddressesProvider - * @param id The id for the new LendingPoolAddressesProvider, referring to the market it belongs to + * @param provider The address of the new PoolAddressesProvider + * @param id The id for the new PoolAddressesProvider, referring to the market it belongs to **/ function registerAddressesProvider(address provider, uint256 id) external override onlyOwner { require(id != 0, Errors.LPAPR_INVALID_ADDRESSES_PROVIDER_ID); @@ -53,8 +53,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP } /** - * @dev Removes a LendingPoolAddressesProvider from the list of registered addresses provider - * @param provider The LendingPoolAddressesProvider address + * @dev Removes a PoolAddressesProvider from the list of registered addresses provider + * @param provider The PoolAddressesProvider address **/ function unregisterAddressesProvider(address provider) external override onlyOwner { require(_addressesProviders[provider] > 0, Errors.LPAPR_PROVIDER_NOT_REGISTERED); @@ -63,8 +63,8 @@ contract LendingPoolAddressesProviderRegistry is Ownable, ILendingPoolAddressesP } /** - * @dev Returns the id on a registered LendingPoolAddressesProvider - * @return The id or 0 if the LendingPoolAddressesProvider is not registered + * @dev Returns the id on a registered PoolAddressesProvider + * @return The id or 0 if the PoolAddressesProvider is not registered */ function getAddressesProviderIdByAddress(address addressesProvider) external diff --git a/contracts/protocol/configuration/LendingPoolAddressesProvider.sol b/contracts/protocol/configuration/PoolAddressesProvider.sol similarity index 96% rename from contracts/protocol/configuration/LendingPoolAddressesProvider.sol rename to contracts/protocol/configuration/PoolAddressesProvider.sol index 37b2ed8e6..75ff48a6a 100644 --- a/contracts/protocol/configuration/LendingPoolAddressesProvider.sol +++ b/contracts/protocol/configuration/PoolAddressesProvider.sol @@ -7,16 +7,16 @@ import {Ownable} from '../../dependencies/openzeppelin/contracts/Ownable.sol'; // prettier-ignore import {InitializableImmutableAdminUpgradeabilityProxy} from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; /** - * @title LendingPoolAddressesProvider contract + * @title PoolAddressesProvider contract * @dev Main registry of addresses part of or connected to the protocol, including permissioned roles * - Acting also as factory of proxies and admin of those, so with right to change its implementations * - Owned by the Aave Governance * @author Aave **/ -contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider { +contract PoolAddressesProvider is Ownable, IPoolAddressesProvider { string private _marketId; mapping(bytes32 => address) private _addresses; @@ -41,7 +41,7 @@ contract LendingPoolAddressesProvider is Ownable, ILendingPoolAddressesProvider } /** - * @dev Allows to set the market which this LendingPoolAddressesProvider represents + * @dev Allows to set the market which this PoolAddressesProvider represents * @param marketId The market id */ function setMarketId(string memory marketId) external override onlyOwner { diff --git a/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol b/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol index 7b321d0c1..023d1fb8f 100644 --- a/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol +++ b/contracts/protocol/lendingpool/DefaultReserveInterestRateStrategy.sol @@ -5,7 +5,7 @@ import {SafeMath} from '../../dependencies/openzeppelin/contracts/SafeMath.sol'; import {IReserveInterestRateStrategy} from '../../interfaces/IReserveInterestRateStrategy.sol'; import {WadRayMath} from '../libraries/math/WadRayMath.sol'; import {PercentageMath} from '../libraries/math/PercentageMath.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {ILendingRateOracle} from '../../interfaces/ILendingRateOracle.sol'; import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; @@ -15,7 +15,7 @@ import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; * @dev The model of interest rate is based on 2 slopes, one before the `OPTIMAL_UTILIZATION_RATE` * point of utilization and another from that one to 100% * - An instance of this same contract, can't be used across different Aave markets, due to the caching - * of the LendingPoolAddressesProvider + * of the PoolAddressesProvider * @author Aave **/ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy { @@ -37,7 +37,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy { uint256 public immutable EXCESS_UTILIZATION_RATE; - ILendingPoolAddressesProvider public immutable addressesProvider; + IPoolAddressesProvider public immutable addressesProvider; // Base variable borrow rate when Utilization rate = 0. Expressed in ray uint256 internal immutable _baseVariableBorrowRate; @@ -55,7 +55,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy { uint256 internal immutable _stableRateSlope2; constructor( - ILendingPoolAddressesProvider provider, + IPoolAddressesProvider provider, uint256 optimalUtilizationRate, uint256 baseVariableBorrowRate, uint256 variableRateSlope1, diff --git a/contracts/protocol/lendingpool/LendingPool.sol b/contracts/protocol/lendingpool/LendingPool.sol index b3108e3f8..fa13242ba 100644 --- a/contracts/protocol/lendingpool/LendingPool.sol +++ b/contracts/protocol/lendingpool/LendingPool.sol @@ -7,7 +7,7 @@ import {IERC20} from '../../dependencies/openzeppelin/contracts/IERC20.sol'; import {IERC20WithPermit} from '../../interfaces/IERC20WithPermit.sol'; import {SafeERC20} from '../../dependencies/openzeppelin/contracts/SafeERC20.sol'; import {Address} from '../../dependencies/openzeppelin/contracts/Address.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {IAToken} from '../../interfaces/IAToken.sol'; import {IVariableDebtToken} from '../../interfaces/IVariableDebtToken.sol'; import {IFlashLoanReceiver} from '../../flashloan/interfaces/IFlashLoanReceiver.sol'; @@ -39,9 +39,9 @@ import {LendingPoolStorage} from './LendingPoolStorage.sol'; * # Enable/disable their deposits as collateral rebalance stable rate borrow positions * # Liquidate positions * # Execute Flash Loans - * - To be covered by a proxy contract, owned by the LendingPoolAddressesProvider of the specific market + * - To be covered by a proxy contract, owned by the PoolAddressesProvider of the specific market * - All admin functions are callable by the LendingPoolConfigurator contract defined also in the - * LendingPoolAddressesProvider + * PoolAddressesProvider * @author Aave **/ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage { @@ -71,12 +71,12 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage /** * @dev Function is invoked by the proxy contract when the LendingPool contract is added to the - * LendingPoolAddressesProvider of the market. - * - Caching the address of the LendingPoolAddressesProvider in order to reduce gas consumption + * PoolAddressesProvider of the market. + * - Caching the address of the PoolAddressesProvider in order to reduce gas consumption * on subsequent operations - * @param provider The address of the LendingPoolAddressesProvider + * @param provider The address of the PoolAddressesProvider **/ - function initialize(ILendingPoolAddressesProvider provider) public initializer { + function initialize(IPoolAddressesProvider provider) public initializer { _addressesProvider = provider; _maxStableRateBorrowSizePercent = 2500; _flashLoanPremiumTotal = 9; @@ -575,7 +575,7 @@ contract LendingPool is VersionedInitializable, ILendingPool, LendingPoolStorage } ///@inheritdoc ILendingPool - function getAddressesProvider() external view override returns (ILendingPoolAddressesProvider) { + function getAddressesProvider() external view override returns (IPoolAddressesProvider) { return _addressesProvider; } diff --git a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol index 793679453..872b217cc 100644 --- a/contracts/protocol/lendingpool/LendingPoolConfigurator.sol +++ b/contracts/protocol/lendingpool/LendingPoolConfigurator.sol @@ -8,7 +8,7 @@ import { InitializableImmutableAdminUpgradeabilityProxy } from '../libraries/aave-upgradeability/InitializableImmutableAdminUpgradeabilityProxy.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {ILendingPool} from '../../interfaces/ILendingPool.sol'; import {IERC20Detailed} from '../../dependencies/openzeppelin/contracts/IERC20Detailed.sol'; import {Errors} from '../libraries/helpers/Errors.sol'; @@ -30,7 +30,7 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur using PercentageMath for uint256; using ReserveConfiguration for DataTypes.ReserveConfigurationMap; - ILendingPoolAddressesProvider internal _addressesProvider; + IPoolAddressesProvider internal _addressesProvider; ILendingPool internal _pool; mapping(address => bool) private _riskAdmins; @@ -71,7 +71,7 @@ contract LendingPoolConfigurator is VersionedInitializable, ILendingPoolConfigur return CONFIGURATOR_REVISION; } - function initialize(ILendingPoolAddressesProvider provider) public initializer { + function initialize(IPoolAddressesProvider provider) public initializer { _addressesProvider = provider; _pool = ILendingPool(_addressesProvider.getLendingPool()); } diff --git a/contracts/protocol/lendingpool/LendingPoolStorage.sol b/contracts/protocol/lendingpool/LendingPoolStorage.sol index c791e3cf2..3a25d3725 100644 --- a/contracts/protocol/lendingpool/LendingPoolStorage.sol +++ b/contracts/protocol/lendingpool/LendingPoolStorage.sol @@ -4,7 +4,7 @@ pragma solidity 0.6.12; import {UserConfiguration} from '../libraries/configuration/UserConfiguration.sol'; import {ReserveConfiguration} from '../libraries/configuration/ReserveConfiguration.sol'; import {ReserveLogic} from '../libraries/logic/ReserveLogic.sol'; -import {ILendingPoolAddressesProvider} from '../../interfaces/ILendingPoolAddressesProvider.sol'; +import {IPoolAddressesProvider} from '../../interfaces/IPoolAddressesProvider.sol'; import {DataTypes} from '../libraries/types/DataTypes.sol'; contract LendingPoolStorage { @@ -12,7 +12,7 @@ contract LendingPoolStorage { using ReserveConfiguration for DataTypes.ReserveConfigurationMap; using UserConfiguration for DataTypes.UserConfigurationMap; - ILendingPoolAddressesProvider internal _addressesProvider; + IPoolAddressesProvider internal _addressesProvider; mapping(address => DataTypes.ReserveData) internal _reserves; mapping(address => DataTypes.UserConfigurationMap) internal _usersConfig; diff --git a/helpers/contracts-deployments.ts b/helpers/contracts-deployments.ts index f1ad477ec..3d1bd94ab 100644 --- a/helpers/contracts-deployments.ts +++ b/helpers/contracts-deployments.ts @@ -24,7 +24,7 @@ import { DefaultReserveInterestRateStrategyFactory, DelegationAwareATokenFactory, InitializableAdminUpgradeabilityProxyFactory, - LendingPoolAddressesProviderFactory, + PoolAddressesProviderFactory, LendingPoolAddressesProviderRegistryFactory, LendingPoolCollateralManagerFactory, LendingPoolConfiguratorFactory, @@ -85,10 +85,10 @@ const readArtifact = async (id: string) => { return (DRE as HardhatRuntimeEnvironment).artifacts.readArtifact(id); }; -export const deployLendingPoolAddressesProvider = async (marketId: string, verify?: boolean) => +export const deployPoolAddressesProvider = async (marketId: string, verify?: boolean) => withSaveAndVerify( - await new LendingPoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), - eContractid.LendingPoolAddressesProvider, + await new PoolAddressesProviderFactory(await getFirstSigner()).deploy(marketId), + eContractid.PoolAddressesProvider, [marketId], verify ); diff --git a/helpers/contracts-getters.ts b/helpers/contracts-getters.ts index 89be0b9ff..50acad23a 100644 --- a/helpers/contracts-getters.ts +++ b/helpers/contracts-getters.ts @@ -6,7 +6,7 @@ import { DefaultReserveInterestRateStrategyFactory, GenericLogicFactory, InitializableAdminUpgradeabilityProxyFactory, - LendingPoolAddressesProviderFactory, + PoolAddressesProviderFactory, LendingPoolAddressesProviderRegistryFactory, LendingPoolCollateralManagerFactory, LendingPoolConfiguratorFactory, @@ -38,10 +38,10 @@ import { eContractid, PoolConfiguration, tEthereumAddress, TokenContractId } fro export const getFirstSigner = async () => (await getEthersSigners())[0]; -export const getLendingPoolAddressesProvider = async (address?: tEthereumAddress) => { - return await LendingPoolAddressesProviderFactory.connect( +export const getPoolAddressesProvider = async (address?: tEthereumAddress) => { + return await PoolAddressesProviderFactory.connect( address || - (await getDb().get(`${eContractid.LendingPoolAddressesProvider}.${DRE.network.name}`).value()) + (await getDb().get(`${eContractid.PoolAddressesProvider}.${DRE.network.name}`).value()) .address, await getFirstSigner() ); diff --git a/helpers/init-helpers.ts b/helpers/init-helpers.ts index dc731b178..b1264c6b4 100644 --- a/helpers/init-helpers.ts +++ b/helpers/init-helpers.ts @@ -13,7 +13,7 @@ import { getAToken, getATokensAndRatesHelper, getFirstSigner, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPoolConfiguratorProxy, getStableAndVariableTokensHelper, } from './contracts-getters'; @@ -61,7 +61,7 @@ export const initReservesByHelper = async ( let gasUsage = BigNumber.from('0'); const stableAndVariableDeployer = await getStableAndVariableTokensHelper(); - const addressProvider = await getLendingPoolAddressesProvider(); + const addressProvider = await getPoolAddressesProvider(); // CHUNK CONFIGURATION const initChunks = 4; @@ -272,7 +272,7 @@ export const configureReservesByHelper = async ( helpers: AaveProtocolDataProvider, admin: tEthereumAddress ) => { - const addressProvider = await getLendingPoolAddressesProvider(); + const addressProvider = await getPoolAddressesProvider(); const atokenAndRatesDeployer = await getATokensAndRatesHelper(); const tokens: string[] = []; const symbols: string[] = []; diff --git a/helpers/types.ts b/helpers/types.ts index 17d1f8af1..d978d4356 100644 --- a/helpers/types.ts +++ b/helpers/types.ts @@ -42,7 +42,7 @@ export enum AavePools { export enum eContractid { Example = 'Example', - LendingPoolAddressesProvider = 'LendingPoolAddressesProvider', + PoolAddressesProvider = 'PoolAddressesProvider', MintableERC20 = 'MintableERC20', MintableDelegationERC20 = 'MintableDelegationERC20', LendingPoolAddressesProviderRegistry = 'LendingPoolAddressesProviderRegistry', diff --git a/specs/harness/LendingPoolHarnessForVariableDebtToken.sol b/specs/harness/LendingPoolHarnessForVariableDebtToken.sol index 6ad68411d..cb2f11546 100644 --- a/specs/harness/LendingPoolHarnessForVariableDebtToken.sol +++ b/specs/harness/LendingPoolHarnessForVariableDebtToken.sol @@ -4,8 +4,8 @@ pragma experimental ABIEncoderV2; import {ILendingPool} from '../../contracts/interfaces/ILendingPool.sol'; import {LendingPool} from '../../contracts/protocol/lendingpool/LendingPool.sol'; import { - ILendingPoolAddressesProvider -} from '../../contracts/interfaces/ILendingPoolAddressesProvider.sol'; + IPoolAddressesProvider +} from '../../contracts/interfaces/IPoolAddressesProvider.sol'; import {DataTypes} from '../../contracts/protocol/libraries/types/DataTypes.sol'; /* @@ -197,7 +197,7 @@ contract LendingPoolHarnessForVariableDebtToken is ILendingPool { originalPool.finalizeTransfer(asset, from, to, amount, balanceFromAfter, balanceToBefore); } - function getAddressesProvider() external view override returns (ILendingPoolAddressesProvider) { + function getAddressesProvider() external view override returns (IPoolAddressesProvider) { return originalPool.getAddressesProvider(); } } diff --git a/tasks/deployments/add-market-to-registry.ts b/tasks/deployments/add-market-to-registry.ts index 0e1d4b68f..d63da76f5 100644 --- a/tasks/deployments/add-market-to-registry.ts +++ b/tasks/deployments/add-market-to-registry.ts @@ -5,7 +5,7 @@ import { ConfigNames, loadPoolConfig } from '../../helpers/configuration'; import { eNetwork } from '../../helpers/types'; import { getFirstSigner, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPoolAddressesProviderRegistry, } from '../../helpers/contracts-getters'; import { isAddress, parseEther } from 'ethers/lib/utils'; @@ -81,7 +81,7 @@ task('add-market-to-registry', 'Adds address provider to registry') await getLendingPoolAddressesProviderRegistry(providerRegistryAddress) ).connect(signer); - const addressesProviderInstance = await getLendingPoolAddressesProvider(addressesProvider); + const addressesProviderInstance = await getPoolAddressesProvider(addressesProvider); // 2. Set the provider at the Registry await waitForTx( @@ -91,6 +91,6 @@ task('add-market-to-registry', 'Adds address provider to registry') ) ); console.log( - `Added LendingPoolAddressesProvider with address "${addressesProviderInstance.address}" to registry located at ${addressesProviderRegistry.address}` + `Added PoolAddressesProvider with address "${addressesProviderInstance.address}" to registry located at ${addressesProviderRegistry.address}` ); }); diff --git a/tasks/deployments/deploy-UniswapLiquiditySwapAdapter.ts b/tasks/deployments/deploy-UniswapLiquiditySwapAdapter.ts index 70eb6ced7..2107cdf6a 100644 --- a/tasks/deployments/deploy-UniswapLiquiditySwapAdapter.ts +++ b/tasks/deployments/deploy-UniswapLiquiditySwapAdapter.ts @@ -8,7 +8,7 @@ import { eContractid } from '../../helpers/types'; const CONTRACT_NAME = 'UniswapLiquiditySwapAdapter'; task(`deploy-${CONTRACT_NAME}`, `Deploys the ${CONTRACT_NAME} contract`) - .addParam('provider', 'Address of the LendingPoolAddressesProvider') + .addParam('provider', 'Address of the PoolAddressesProvider') .addParam('router', 'Address of the uniswap router') .addParam('weth', 'Address of the weth token') .addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`) diff --git a/tasks/deployments/deploy-UniswapRepayAdapter.ts b/tasks/deployments/deploy-UniswapRepayAdapter.ts index e9e7b2443..9f2da9748 100644 --- a/tasks/deployments/deploy-UniswapRepayAdapter.ts +++ b/tasks/deployments/deploy-UniswapRepayAdapter.ts @@ -8,7 +8,7 @@ import { eContractid } from '../../helpers/types'; const CONTRACT_NAME = 'UniswapRepayAdapter'; task(`deploy-${CONTRACT_NAME}`, `Deploys the ${CONTRACT_NAME} contract`) - .addParam('provider', 'Address of the LendingPoolAddressesProvider') + .addParam('provider', 'Address of the PoolAddressesProvider') .addParam('router', 'Address of the uniswap router') .addParam('weth', 'Address of the weth token') .addFlag('verify', `Verify ${CONTRACT_NAME} contract via Etherscan API.`) diff --git a/tasks/dev/2_address_provider_registry.ts b/tasks/dev/2_address_provider_registry.ts index bfa201d44..ce3a44869 100644 --- a/tasks/dev/2_address_provider_registry.ts +++ b/tasks/dev/2_address_provider_registry.ts @@ -1,6 +1,6 @@ import { task } from 'hardhat/config'; import { - deployLendingPoolAddressesProvider, + deployPoolAddressesProvider, deployLendingPoolAddressesProviderRegistry, } from '../../helpers/contracts-deployments'; import { getEthersSigners } from '../../helpers/contracts-helpers'; @@ -17,7 +17,7 @@ task( const admin = await (await getEthersSigners())[0].getAddress(); - const addressesProvider = await deployLendingPoolAddressesProvider(AaveConfig.MarketId, verify); + const addressesProvider = await deployPoolAddressesProvider(AaveConfig.MarketId, verify); await waitForTx(await addressesProvider.setPoolAdmin(admin)); await waitForTx(await addressesProvider.setEmergencyAdmin(admin)); diff --git a/tasks/dev/3_lending_pool.ts b/tasks/dev/3_lending_pool.ts index 9936abfa8..ac7ffced0 100644 --- a/tasks/dev/3_lending_pool.ts +++ b/tasks/dev/3_lending_pool.ts @@ -8,7 +8,7 @@ import { import { eContractid } from '../../helpers/types'; import { waitForTx } from '../../helpers/misc-utils'; import { - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPool, getLendingPoolConfiguratorProxy, } from '../../helpers/contracts-getters'; @@ -19,7 +19,7 @@ task('dev:deploy-lending-pool', 'Deploy lending pool for dev enviroment') .setAction(async ({ verify }, localBRE) => { await localBRE.run('set-DRE'); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const lendingPoolImpl = await deployLendingPool(verify); diff --git a/tasks/dev/4_oracles.ts b/tasks/dev/4_oracles.ts index 23be80f28..28e3de753 100644 --- a/tasks/dev/4_oracles.ts +++ b/tasks/dev/4_oracles.ts @@ -15,7 +15,7 @@ import { getAllAggregatorsAddresses, getAllTokenAddresses } from '../../helpers/ import { ConfigNames, loadPoolConfig, getWethAddress } from '../../helpers/configuration'; import { getAllMockedTokens, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getPairsTokenAggregator, } from '../../helpers/contracts-getters'; import { ethers } from 'ethers'; @@ -41,7 +41,7 @@ task('dev:deploy-oracles', 'Deploy oracles for dev enviroment') prev[curr as keyof iAssetBase] = mockTokens[curr].address; return prev; }, defaultTokenList); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const admin = await addressesProvider.getPoolAdmin(); const fallbackOracle = await deployPriceOracle(verify); diff --git a/tasks/dev/5_initialize.ts b/tasks/dev/5_initialize.ts index f36a4e090..34b502a8d 100644 --- a/tasks/dev/5_initialize.ts +++ b/tasks/dev/5_initialize.ts @@ -22,7 +22,7 @@ import { getAllTokenAddresses } from '../../helpers/mock-helpers'; import { ZERO_ADDRESS } from '../../helpers/constants'; import { getAllMockedTokens, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getWETHGateway, } from '../../helpers/contracts-getters'; import { insertContractAddressInDb } from '../../helpers/contracts-helpers'; @@ -44,7 +44,7 @@ task('dev:initialize-lending-pool', 'Initialize lending pool configuration.') const mockTokens = await getAllMockedTokens(); const allTokenAddresses = getAllTokenAddresses(mockTokens); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const protoPoolReservesAddresses = <{ [symbol: string]: tEthereumAddress }>( filterMapBy(allTokenAddresses, (key: string) => !key.includes('UNI_')) diff --git a/tasks/dev/6_wallet_balance_provider.ts b/tasks/dev/6_wallet_balance_provider.ts index 1b444598d..5e640274c 100644 --- a/tasks/dev/6_wallet_balance_provider.ts +++ b/tasks/dev/6_wallet_balance_provider.ts @@ -1,7 +1,7 @@ import { task } from 'hardhat/config'; import { deployWalletBalancerProvider } from '../../helpers/contracts-deployments'; -import { getLendingPoolAddressesProvider } from '../../helpers/contracts-getters'; +import { getPoolAddressesProvider } from '../../helpers/contracts-getters'; task('dev:wallet-balance-provider', 'Initialize lending pool configuration.') .addFlag('verify', 'Verify contracts at Etherscan') diff --git a/tasks/full/1_address_provider.ts b/tasks/full/1_address_provider.ts index c863ae054..5699da4e1 100644 --- a/tasks/full/1_address_provider.ts +++ b/tasks/full/1_address_provider.ts @@ -1,5 +1,5 @@ import { task } from 'hardhat/config'; -import { deployLendingPoolAddressesProvider } from '../../helpers/contracts-deployments'; +import { deployPoolAddressesProvider } from '../../helpers/contracts-deployments'; import { notFalsyOrZeroAddress, waitForTx } from '../../helpers/misc-utils'; import { ConfigNames, @@ -23,7 +23,7 @@ task( const { MarketId } = poolConfig; // 1. Deploy address provider and set genesis manager - const addressesProvider = await deployLendingPoolAddressesProvider(MarketId, verify); + const addressesProvider = await deployPoolAddressesProvider(MarketId, verify); // 2. Add to registry or setup a new one if (!skipRegistry) { diff --git a/tasks/full/2_lending_pool.ts b/tasks/full/2_lending_pool.ts index e318846e2..abcd623a6 100644 --- a/tasks/full/2_lending_pool.ts +++ b/tasks/full/2_lending_pool.ts @@ -9,7 +9,7 @@ import { import { eContractid, eNetwork } from '../../helpers/types'; import { notFalsyOrZeroAddress, waitForTx } from '../../helpers/misc-utils'; import { - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPool, getLendingPoolConfiguratorProxy, } from '../../helpers/contracts-getters'; @@ -24,7 +24,7 @@ task('full:deploy-lending-pool', 'Deploy lending pool for dev enviroment') await DRE.run('set-DRE'); const network = DRE.network.name; const poolConfig = loadPoolConfig(pool); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const { LendingPool, LendingPoolConfigurator } = poolConfig; diff --git a/tasks/full/3_oracles.ts b/tasks/full/3_oracles.ts index dfc6f2479..90ad4016c 100644 --- a/tasks/full/3_oracles.ts +++ b/tasks/full/3_oracles.ts @@ -13,7 +13,7 @@ import { } from '../../helpers/configuration'; import { getAaveOracle, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingRateOracle, getPairsTokenAggregator, } from '../../helpers/contracts-getters'; @@ -35,7 +35,7 @@ task('full:deploy-oracles', 'Deploy oracles for dev enviroment') ChainlinkAggregator, } = poolConfig as ICommonConfiguration; const lendingRateOracles = getLendingRateOracles(poolConfig); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const admin = await getGenesisPoolAdmin(poolConfig); const aaveOracleAddress = getParamPerNetwork(poolConfig.AaveOracle, network); const lendingRateOracleAddress = getParamPerNetwork(poolConfig.LendingRateOracle, network); diff --git a/tasks/full/4_data-provider.ts b/tasks/full/4_data-provider.ts index af03779f1..b12d8aa9a 100644 --- a/tasks/full/4_data-provider.ts +++ b/tasks/full/4_data-provider.ts @@ -1,7 +1,7 @@ import { task } from 'hardhat/config'; import { deployAaveProtocolDataProvider } from '../../helpers/contracts-deployments'; import { exit } from 'process'; -import { getLendingPoolAddressesProvider } from '../../helpers/contracts-getters'; +import { getPoolAddressesProvider } from '../../helpers/contracts-getters'; task('full:data-provider', 'Initialize lending pool configuration.') .addFlag('verify', 'Verify contracts at Etherscan') @@ -9,7 +9,7 @@ task('full:data-provider', 'Initialize lending pool configuration.') try { await localBRE.run('set-DRE'); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); await deployAaveProtocolDataProvider(addressesProvider.address, verify); } catch (err) { diff --git a/tasks/full/6-initialize.ts b/tasks/full/6-initialize.ts index bfe2925e0..b7d682c3d 100644 --- a/tasks/full/6-initialize.ts +++ b/tasks/full/6-initialize.ts @@ -19,7 +19,7 @@ import { initReservesByHelper, configureReservesByHelper } from '../../helpers/i import { exit } from 'process'; import { getAaveProtocolDataProvider, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, } from '../../helpers/contracts-getters'; import { ZERO_ADDRESS } from '../../helpers/constants'; @@ -45,7 +45,7 @@ task('full:initialize-lending-pool', 'Initialize lending pool configuration.') const reserveAssets = await getParamPerNetwork(ReserveAssets, network); const incentivesController = await getParamPerNetwork(IncentivesController, network); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const testHelpers = await getAaveProtocolDataProvider(); diff --git a/tasks/helpers/deploy-new-asset.ts b/tasks/helpers/deploy-new-asset.ts index 718b63720..fe23f4878 100644 --- a/tasks/helpers/deploy-new-asset.ts +++ b/tasks/helpers/deploy-new-asset.ts @@ -4,7 +4,7 @@ import { getTreasuryAddress } from '../../helpers/configuration'; import * as marketConfigs from '../../markets/aave'; import * as reserveConfigs from '../../markets/aave/reservesConfigs'; import { chooseATokenDeployment } from '../../helpers/init-helpers'; -import { getLendingPoolAddressesProvider } from './../../helpers/contracts-getters'; +import { getPoolAddressesProvider } from './../../helpers/contracts-getters'; import { deployDefaultReserveInterestRateStrategy, deployStableDebtToken, @@ -43,7 +43,7 @@ WRONG RESERVE ASSET SETUP: const reserveAssetAddress = marketConfigs.AaveConfig.ReserveAssets[localBRE.network.name][symbol]; const deployCustomAToken = chooseATokenDeployment(strategyParams.aTokenImpl); - const addressProvider = await getLendingPoolAddressesProvider( + const addressProvider = await getPoolAddressesProvider( LENDING_POOL_ADDRESS_PROVIDER[network] ); const poolAddress = await addressProvider.getLendingPool(); diff --git a/tasks/misc/print-config.ts b/tasks/misc/print-config.ts index fe3925d31..d3436e5fd 100644 --- a/tasks/misc/print-config.ts +++ b/tasks/misc/print-config.ts @@ -2,7 +2,7 @@ import { task } from 'hardhat/config'; import { ConfigNames, loadPoolConfig } from '../../helpers/configuration'; import { getAaveProtocolDataProvider, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPoolAddressesProviderRegistry, } from '../../helpers/contracts-getters'; import { getParamPerNetwork } from '../../helpers/contracts-helpers'; @@ -26,7 +26,7 @@ task('print-config', 'Inits the DRE, to have access to all the plugins') const providers = await providerRegistry.getAddressesProvidersList(); - const addressesProvider = await getLendingPoolAddressesProvider(providers[0]); // Checks first provider + const addressesProvider = await getPoolAddressesProvider(providers[0]); // Checks first provider console.log('Addresses Providers', providers.join(', ')); console.log('Market Id: ', await addressesProvider.getMarketId()); diff --git a/tasks/verifications/1_general.ts b/tasks/verifications/1_general.ts index b2b3bcb7e..60643d240 100644 --- a/tasks/verifications/1_general.ts +++ b/tasks/verifications/1_general.ts @@ -12,7 +12,7 @@ import { getAaveProtocolDataProvider, getAddressById, getLendingPool, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getLendingPoolAddressesProviderRegistry, getLendingPoolCollateralManager, getLendingPoolCollateralManagerImpl, @@ -47,7 +47,7 @@ task('verify:general', 'Verify contracts at Etherscan') const treasuryAddress = await getTreasuryAddress(poolConfig); const registryAddress = getParamPerNetwork(ProviderRegistry, network); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const addressesProviderRegistry = notFalsyOrZeroAddress(registryAddress) ? await getLendingPoolAddressesProviderRegistry(registryAddress) : await getLendingPoolAddressesProviderRegistry(); @@ -93,7 +93,7 @@ task('verify:general', 'Verify contracts at Etherscan') // Address Provider console.log('\n- Verifying address provider...\n'); - await verifyContract(eContractid.LendingPoolAddressesProvider, addressesProvider, [MarketId]); + await verifyContract(eContractid.PoolAddressesProvider, addressesProvider, [MarketId]); // Address Provider Registry console.log('\n- Verifying address provider registry...\n'); diff --git a/tasks/verifications/2_tokens.ts b/tasks/verifications/2_tokens.ts index eacc7f921..5d316e9fb 100644 --- a/tasks/verifications/2_tokens.ts +++ b/tasks/verifications/2_tokens.ts @@ -11,7 +11,7 @@ import { getAToken, getFirstSigner, getInterestRateStrategy, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getProxy, getStableDebtToken, getVariableDebtToken, @@ -29,7 +29,7 @@ task('verify:tokens', 'Deploy oracles for dev enviroment') const { ReserveAssets, ReservesConfig } = poolConfig as ICommonConfiguration; const treasuryAddress = await getTreasuryAddress(poolConfig); - const addressesProvider = await getLendingPoolAddressesProvider(); + const addressesProvider = await getPoolAddressesProvider(); const lendingPoolProxy = LendingPoolFactory.connect( await addressesProvider.getLendingPool(), await getFirstSigner() diff --git a/test-suites/test-aave/__setup.spec.ts b/test-suites/test-aave/__setup.spec.ts index ba58252ed..68dcecb15 100644 --- a/test-suites/test-aave/__setup.spec.ts +++ b/test-suites/test-aave/__setup.spec.ts @@ -7,7 +7,7 @@ import { getEthersSignersAddresses, } from '../../helpers/contracts-helpers'; import { - deployLendingPoolAddressesProvider, + deployPoolAddressesProvider, deployMintableERC20, deployLendingPoolAddressesProviderRegistry, deployLendingPoolConfigurator, @@ -99,7 +99,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const mockTokens = await deployAllMockTokens(deployer); console.log('Deployed mocks'); - const addressesProvider = await deployLendingPoolAddressesProvider(AaveConfig.MarketId); + const addressesProvider = await deployPoolAddressesProvider(AaveConfig.MarketId); await waitForTx(await addressesProvider.setPoolAdmin(aaveAdmin)); //setting users[1] as emergency admin, which is in position 2 in the DRE addresses list diff --git a/test-suites/test-aave/helpers/make-suite.ts b/test-suites/test-aave/helpers/make-suite.ts index 15150cd15..07d846a99 100644 --- a/test-suites/test-aave/helpers/make-suite.ts +++ b/test-suites/test-aave/helpers/make-suite.ts @@ -2,7 +2,7 @@ import { evmRevert, evmSnapshot, DRE } from '../../../helpers/misc-utils'; import { Signer } from 'ethers'; import { getLendingPool, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getAaveProtocolDataProvider, getAToken, getMintableERC20, @@ -29,7 +29,7 @@ import chai from 'chai'; import bignumberChai from 'chai-bignumber'; import { almostEqual } from './almost-equal'; import { PriceOracle } from '../../../types/PriceOracle'; -import { LendingPoolAddressesProvider } from '../../../types/LendingPoolAddressesProvider'; +import { PoolAddressesProvider } from '../../../types/PoolAddressesProvider'; import { LendingPoolAddressesProviderRegistry } from '../../../types/LendingPoolAddressesProviderRegistry'; import { getEthersSigners } from '../../../helpers/contracts-helpers'; import { UniswapLiquiditySwapAdapter } from '../../../types/UniswapLiquiditySwapAdapter'; @@ -70,7 +70,7 @@ export interface TestEnv { aUsdc: AToken; usdc: MintableERC20; aave: MintableERC20; - addressesProvider: LendingPoolAddressesProvider; + addressesProvider: PoolAddressesProvider; uniswapLiquiditySwapAdapter: UniswapLiquiditySwapAdapter; uniswapRepayAdapter: UniswapRepayAdapter; registry: LendingPoolAddressesProviderRegistry; @@ -102,7 +102,7 @@ const testEnv: TestEnv = { aUsdc: {} as AToken, usdc: {} as MintableERC20, aave: {} as MintableERC20, - addressesProvider: {} as LendingPoolAddressesProvider, + addressesProvider: {} as PoolAddressesProvider, uniswapLiquiditySwapAdapter: {} as UniswapLiquiditySwapAdapter, uniswapRepayAdapter: {} as UniswapRepayAdapter, flashLiquidationAdapter: {} as FlashLiquidationAdapter, @@ -131,7 +131,7 @@ export async function initializeMakeSuite() { testEnv.configurator = await getLendingPoolConfiguratorProxy(); - testEnv.addressesProvider = await getLendingPoolAddressesProvider(); + testEnv.addressesProvider = await getPoolAddressesProvider(); if (process.env.FORK) { testEnv.registry = await getLendingPoolAddressesProviderRegistry( diff --git a/test-suites/test-aave/lending-pool-addresses-provider.spec.ts b/test-suites/test-aave/lending-pool-addresses-provider.spec.ts index 0f7630f9c..8bdce1169 100644 --- a/test-suites/test-aave/lending-pool-addresses-provider.spec.ts +++ b/test-suites/test-aave/lending-pool-addresses-provider.spec.ts @@ -9,8 +9,8 @@ import { deployLendingPool } from '../../helpers/contracts-deployments'; const { utils } = ethers; -makeSuite('LendingPoolAddressesProvider', (testEnv: TestEnv) => { - it('Test the accessibility of the LendingPoolAddressesProvider', async () => { +makeSuite('PoolAddressesProvider', (testEnv: TestEnv) => { + it('Test the accessibility of the PoolAddressesProvider', async () => { const { addressesProvider, users } = testEnv; const mockAddress = createRandomAddress(); const { INVALID_OWNER_REVERT_MSG } = ProtocolErrors; diff --git a/test-suites/test-amm/__setup.spec.ts b/test-suites/test-amm/__setup.spec.ts index db75799f7..73f537b1c 100644 --- a/test-suites/test-amm/__setup.spec.ts +++ b/test-suites/test-amm/__setup.spec.ts @@ -7,7 +7,7 @@ import { getEthersSignersAddresses, } from '../../helpers/contracts-helpers'; import { - deployLendingPoolAddressesProvider, + deployPoolAddressesProvider, deployMintableERC20, deployLendingPoolAddressesProviderRegistry, deployLendingPoolConfigurator, @@ -98,7 +98,7 @@ const buildTestEnv = async (deployer: Signer, secondaryWallet: Signer) => { const mockTokens = await deployAllMockTokens(deployer); - const addressesProvider = await deployLendingPoolAddressesProvider(AmmConfig.MarketId); + const addressesProvider = await deployPoolAddressesProvider(AmmConfig.MarketId); await waitForTx(await addressesProvider.setPoolAdmin(aaveAdmin)); //setting users[1] as emergency admin, which is in position 2 in the DRE addresses list diff --git a/test-suites/test-amm/helpers/make-suite.ts b/test-suites/test-amm/helpers/make-suite.ts index 9ddbb7f16..a17dd7bb9 100644 --- a/test-suites/test-amm/helpers/make-suite.ts +++ b/test-suites/test-amm/helpers/make-suite.ts @@ -2,7 +2,7 @@ import { evmRevert, evmSnapshot, DRE } from '../../../helpers/misc-utils'; import { Signer } from 'ethers'; import { getLendingPool, - getLendingPoolAddressesProvider, + getPoolAddressesProvider, getAaveProtocolDataProvider, getAToken, getMintableERC20, @@ -27,7 +27,7 @@ import chai from 'chai'; import bignumberChai from 'chai-bignumber'; import { almostEqual } from './almost-equal'; import { PriceOracle } from '../../../types/PriceOracle'; -import { LendingPoolAddressesProvider } from '../../../types/LendingPoolAddressesProvider'; +import { PoolAddressesProvider } from '../../../types/PoolAddressesProvider'; import { LendingPoolAddressesProviderRegistry } from '../../../types/LendingPoolAddressesProviderRegistry'; import { getEthersSigners } from '../../../helpers/contracts-helpers'; import { UniswapLiquiditySwapAdapter } from '../../../types/UniswapLiquiditySwapAdapter'; @@ -62,7 +62,7 @@ export interface TestEnv { aDai: AToken; usdc: MintableERC20; aave: MintableERC20; - addressesProvider: LendingPoolAddressesProvider; + addressesProvider: PoolAddressesProvider; uniswapLiquiditySwapAdapter: UniswapLiquiditySwapAdapter; uniswapRepayAdapter: UniswapRepayAdapter; registry: LendingPoolAddressesProviderRegistry; @@ -88,7 +88,7 @@ const testEnv: TestEnv = { aDai: {} as AToken, usdc: {} as MintableERC20, aave: {} as MintableERC20, - addressesProvider: {} as LendingPoolAddressesProvider, + addressesProvider: {} as PoolAddressesProvider, uniswapLiquiditySwapAdapter: {} as UniswapLiquiditySwapAdapter, uniswapRepayAdapter: {} as UniswapRepayAdapter, flashLiquidationAdapter: {} as FlashLiquidationAdapter, @@ -114,7 +114,7 @@ export async function initializeMakeSuite() { testEnv.configurator = await getLendingPoolConfiguratorProxy(); - testEnv.addressesProvider = await getLendingPoolAddressesProvider(); + testEnv.addressesProvider = await getPoolAddressesProvider(); if (process.env.FORK) { testEnv.registry = await getLendingPoolAddressesProviderRegistry( diff --git a/test-suites/test-amm/lending-pool-addresses-provider.spec.ts b/test-suites/test-amm/lending-pool-addresses-provider.spec.ts index 0f7630f9c..8bdce1169 100644 --- a/test-suites/test-amm/lending-pool-addresses-provider.spec.ts +++ b/test-suites/test-amm/lending-pool-addresses-provider.spec.ts @@ -9,8 +9,8 @@ import { deployLendingPool } from '../../helpers/contracts-deployments'; const { utils } = ethers; -makeSuite('LendingPoolAddressesProvider', (testEnv: TestEnv) => { - it('Test the accessibility of the LendingPoolAddressesProvider', async () => { +makeSuite('PoolAddressesProvider', (testEnv: TestEnv) => { + it('Test the accessibility of the PoolAddressesProvider', async () => { const { addressesProvider, users } = testEnv; const mockAddress = createRandomAddress(); const { INVALID_OWNER_REVERT_MSG } = ProtocolErrors;