Skip to content

Commit

Permalink
feat: Rename LendingPoolAddressesProvider to PoolAddressesProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Jul 27, 2021
1 parent 680f2c7 commit 396ce87
Show file tree
Hide file tree
Showing 50 changed files with 131 additions and 131 deletions.
4 changes: 2 additions & 2 deletions contracts/adapters/BaseUniswapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions contracts/adapters/FlashLiquidationAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -41,7 +41,7 @@ contract FlashLiquidationAdapter is BaseUniswapAdapter {
}

constructor(
ILendingPoolAddressesProvider addressesProvider,
IPoolAddressesProvider addressesProvider,
IUniswapV2Router02 uniswapRouter,
address wethAddress
) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {}
Expand Down
4 changes: 2 additions & 2 deletions contracts/adapters/UniswapLiquiditySwapAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -30,7 +30,7 @@ contract UniswapLiquiditySwapAdapter is BaseUniswapAdapter {
}

constructor(
ILendingPoolAddressesProvider addressesProvider,
IPoolAddressesProvider addressesProvider,
IUniswapV2Router02 uniswapRouter,
address wethAddress
) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {}
Expand Down
4 changes: 2 additions & 2 deletions contracts/adapters/UniswapRepayAdapter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -23,7 +23,7 @@ contract UniswapRepayAdapter is BaseUniswapAdapter {
}

constructor(
ILendingPoolAddressesProvider addressesProvider,
IPoolAddressesProvider addressesProvider,
IUniswapV2Router02 uniswapRouter,
address wethAddress
) public BaseUniswapAdapter(addressesProvider, uniswapRouter, wethAddress) {}
Expand Down
6 changes: 3 additions & 3 deletions contracts/deployments/ATokensAndRatesHelper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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],
Expand Down
6 changes: 3 additions & 3 deletions contracts/flashloan/base/FlashLoanReceiverBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down
4 changes: 2 additions & 2 deletions contracts/flashloan/interfaces/IFlashLoanReceiver.sol
Original file line number Diff line number Diff line change
@@ -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';

/**
Expand All @@ -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);
}
6 changes: 3 additions & 3 deletions contracts/interfaces/ILendingPool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {

This comment has been minimized.

Copy link
@Casedonpoint

Casedonpoint Aug 27, 2023

Kc dirt

event MarketIdSet(string newMarketId);
event LendingPoolUpdated(address indexed newAddress);
event ConfigurationAdminUpdated(address indexed newAddress);
Expand Down
6 changes: 3 additions & 3 deletions contracts/misc/AaveProtocolDataProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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;
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/misc/UiPoolDataProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -51,7 +51,7 @@ contract UiPoolDataProvider is IUiPoolDataProvider {
);
}

function getReservesData(ILendingPoolAddressesProvider provider, address user)
function getReservesData(IPoolAddressesProvider provider, address user)
external
view
override
Expand Down
2 changes: 1 addition & 1 deletion contracts/misc/WETHGateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions contracts/misc/WalletBalanceProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions contracts/misc/interfaces/IUiPoolDataProvider.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -71,7 +71,7 @@ interface IUiPoolDataProvider {
uint256 sTokenincentivesUserIndex;
}

function getReservesData(ILendingPoolAddressesProvider provider, address user)
function getReservesData(IPoolAddressesProvider provider, address user)
external
view
returns (
Expand Down
6 changes: 3 additions & 3 deletions contracts/mocks/flashloan/MockFlashLoanReceiver.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
**/
Expand Down Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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 {
Expand All @@ -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;
Expand All @@ -55,7 +55,7 @@ contract DefaultReserveInterestRateStrategy is IReserveInterestRateStrategy {
uint256 internal immutable _stableRateSlope2;

constructor(
ILendingPoolAddressesProvider provider,
IPoolAddressesProvider provider,
uint256 optimalUtilizationRate,
uint256 baseVariableBorrowRate,
uint256 variableRateSlope1,
Expand Down
Loading

0 comments on commit 396ce87

Please sign in to comment.