PoolAddressesProvider

Main registry of addresses part of or connected to the protocol, including permissioned roles

Acts as factory of proxies and admin of those, so with right to change its implementations Owned by the ParaSpace Governance

_marketId

string _marketId

_addresses

mapping(bytes32 => address) _addresses

_marketplaces

mapping(bytes32 => struct DataTypes.Marketplace) _marketplaces

POOL

bytes32 POOL

POOL_CONFIGURATOR

bytes32 POOL_CONFIGURATOR

PRICE_ORACLE

bytes32 PRICE_ORACLE

ACL_MANAGER

bytes32 ACL_MANAGER

ACL_ADMIN

bytes32 ACL_ADMIN

PRICE_ORACLE_SENTINEL

bytes32 PRICE_ORACLE_SENTINEL

DATA_PROVIDER

bytes32 DATA_PROVIDER

WETH

bytes32 WETH

constructor

constructor(string marketId, address owner) public

Constructor.

Parameters

getMarketId

function getMarketId() external view returns (string)

Returns the id of the ParaSpace market to which this contract points to.

Return Values

setMarketId

function setMarketId(string newMarketId) external

Associates an id with a specific PoolAddressesProvider.

This can be used to create an onchain registry of PoolAddressesProviders to identify and validate multiple ParaSpace markets.

Parameters

getAddress

function getAddress(bytes32 id) public view returns (address)

Returns an address by its identifier.

The returned address might be an EOA or a contract, potentially proxied It returns ZERO if there is no registered address with the given id

Parameters

Return Values

setAddress

function setAddress(bytes32 id, address newAddress) external

Sets an address for an id replacing the address saved in the addresses map.

IMPORTANT Use this function carefully, as it will do a hard replacement

Parameters

setAddressAsProxy

function setAddressAsProxy(bytes32 id, address newImplementationAddress) external

General function to update the implementation of a proxy registered with certain id. If there is no proxy registered, it will instantiate one and set as implementation the newImplementationAddress.

IMPORTANT Use this function carefully, only for ids that don't have an explicit setter function, in order to avoid unexpected consequences

Parameters

getPool

function getPool() external view returns (address)

Returns the address of the Pool proxy.

Return Values

updatePoolImpl

function updatePoolImpl(struct IParaProxy.ProxyImplementation[] implementationParams, address _init, bytes _calldata) external

Updates the implementation of the Pool, or creates a proxy setting the new pool implementation when the function is called for the first time.

Parameters

getPoolConfigurator

function getPoolConfigurator() external view returns (address)

Returns the address of the PoolConfigurator proxy.

Return Values

setPoolConfiguratorImpl

function setPoolConfiguratorImpl(address newPoolConfiguratorImpl) external

Updates the implementation of the PoolConfigurator, or creates a proxy setting the new PoolConfigurator implementation when the function is called for the first time.

Parameters

getPriceOracle

function getPriceOracle() external view returns (address)

Returns the address of the price oracle.

Return Values

setPriceOracle

function setPriceOracle(address newPriceOracle) external

Updates the address of the price oracle.

Parameters

getACLManager

function getACLManager() external view returns (address)

Returns the address of the ACL manager.

Return Values

setACLManager

function setACLManager(address newAclManager) external

Updates the address of the ACL manager.

Parameters

getACLAdmin

function getACLAdmin() external view returns (address)

Returns the address of the ACL admin.

Return Values

setACLAdmin

function setACLAdmin(address newAclAdmin) external

Updates the address of the ACL admin.

Parameters

getPriceOracleSentinel

function getPriceOracleSentinel() external view returns (address)

Returns the address of the price oracle sentinel.

Return Values

setPriceOracleSentinel

function setPriceOracleSentinel(address newPriceOracleSentinel) external

Updates the address of the price oracle sentinel.

Parameters

getPoolDataProvider

function getPoolDataProvider() external view returns (address)

Returns the address of the data provider.

Return Values

getWETH

function getWETH() external view returns (address)

Returns the address of the Wrapped ETH.

Return Values

getMarketplace

function getMarketplace(bytes32 id) external view returns (struct DataTypes.Marketplace)

Returns the info of the marketplace.

Return Values

setProtocolDataProvider

function setProtocolDataProvider(address newDataProvider) external

Updates the address of the data provider.

Parameters

setWETH

function setWETH(address newWETH) external

Updates the address of the WETH.

Parameters

setMarketplace

function setMarketplace(bytes32 id, address marketplace, address adapter, address operator, bool paused) external

Updates the info of the marketplace.

Parameters

_updateImpl

function _updateImpl(bytes32 id, address newAddress) internal

Internal function to update the implementation of a specific proxied component of the protocol.

If there is no proxy registered with the given identifier, it creates the proxy setting newAddress as implementation and calls the initialize() function on the proxy If there is already a proxy registered, it just updates the implementation to newAddress and calls the initialize() function via upgradeToAndCall() in the proxy

Parameters

_updateParaProxyImpl

function _updateParaProxyImpl(bytes32 id, struct IParaProxy.ProxyImplementation[] implementationParams, address _init, bytes _calldata) internal

Internal function to update the implementation of a specific proxied component of the protocol that uses ParaProxy.

_If there is no proxy registered with the given identifier, it creates the proxy setting newAddress as implementation and calls the calldata on the init If there is already a proxy registered, it just updates the implementation using the implementationParams

Parameters

_setMarketId

function _setMarketId(string newMarketId) internal

Updates the identifier of the ParaSpace market.

Parameters

_getProxyImplementation

function _getProxyImplementation(bytes32 id) internal returns (address)

Returns the the implementation contract of the proxy contract by its identifier.

It returns ZERO if there is no registered address with the given id It reverts if the registered address with the given id is not InitializableImmutableAdminUpgradeabilityProxy

Parameters

Return Values