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
_addresses
_marketplaces
POOL
POOL_CONFIGURATOR
PRICE_ORACLE
ACL_MANAGER
ACL_ADMIN
PRICE_ORACLE_SENTINEL
DATA_PROVIDER
WETH
constructor
Constructor.
Parameters
Name | Type | Description |
---|---|---|
marketId | string | The identifier of the market. |
owner | address | The owner address of this contract. |
getMarketId
Returns the id of the ParaSpace market to which this contract points to.
Return Values
Name | Type | Description |
---|---|---|
[0] | string | The market id |
setMarketId
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
Name | Type | Description |
---|---|---|
newMarketId | string | The market id |
getAddress
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the registered for the specified id |
setAddress
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id |
newAddress | address | The address to set |
setAddressAsProxy
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id |
newImplementationAddress | address | The address of the new implementation |
getPool
Returns the address of the Pool proxy.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The Pool proxy address |
updatePoolImpl
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
Name | Type | Description |
---|---|---|
implementationParams | struct IParaProxy.ProxyImplementation[] | Contains the implementation addresses and function selectors |
_init | address | The address of the contract or implementation to execute _calldata |
_calldata | bytes | A function call, including function selector and arguments _calldata is executed with delegatecall on _init |
getPoolConfigurator
Returns the address of the PoolConfigurator proxy.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The PoolConfigurator proxy address |
setPoolConfiguratorImpl
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
Name | Type | Description |
---|---|---|
newPoolConfiguratorImpl | address | The new PoolConfigurator implementation |
getPriceOracle
Returns the address of the price oracle.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the PriceOracle |
setPriceOracle
Updates the address of the price oracle.
Parameters
Name | Type | Description |
---|---|---|
newPriceOracle | address | The address of the new PriceOracle |
getACLManager
Returns the address of the ACL manager.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the ACLManager |
setACLManager
Updates the address of the ACL manager.
Parameters
Name | Type | Description |
---|---|---|
newAclManager | address | The address of the new ACLManager |
getACLAdmin
Returns the address of the ACL admin.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the ACL admin |
setACLAdmin
Updates the address of the ACL admin.
Parameters
Name | Type | Description |
---|---|---|
newAclAdmin | address | The address of the new ACL admin |
getPriceOracleSentinel
Returns the address of the price oracle sentinel.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the PriceOracleSentinel |
setPriceOracleSentinel
Updates the address of the price oracle sentinel.
Parameters
Name | Type | Description |
---|---|---|
newPriceOracleSentinel | address | The address of the new PriceOracleSentinel |
getPoolDataProvider
Returns the address of the data provider.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the DataProvider |
getWETH
Returns the address of the Wrapped ETH.
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the Wrapped ETH |
getMarketplace
Returns the info of the marketplace.
Return Values
Name | Type | Description |
---|---|---|
[0] | struct DataTypes.Marketplace | The info of the marketplace |
setProtocolDataProvider
Updates the address of the data provider.
Parameters
Name | Type | Description |
---|---|---|
newDataProvider | address | The address of the new DataProvider |
setWETH
Updates the address of the WETH.
Parameters
Name | Type | Description |
---|---|---|
newWETH | address | The address of the new WETH |
setMarketplace
Updates the info of the marketplace.
Parameters
Name | Type | Description |
---|---|---|
id | bytes32 | |
marketplace | address | The address of the marketplace @param adapter The contract which handles marketplace logic |
adapter | address | |
operator | address | The contract which operates users' tokens |
paused | bool |
_updateImpl
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id of the proxy to be updated |
newAddress | address | The address of the new implementation |
_updateParaProxyImpl
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id of the proxy to be updated |
implementationParams | struct IParaProxy.ProxyImplementation[] | Contains the implementation addresses and function selectors |
_init | address | The address of the contract or implementation to execute _calldata |
_calldata | bytes | A function call, including function selector and arguments _calldata is executed with delegatecall on _init |
_setMarketId
Updates the identifier of the ParaSpace market.
Parameters
Name | Type | Description |
---|---|---|
newMarketId | string | The new id of the market |
_getProxyImplementation
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
Name | Type | Description |
---|---|---|
id | bytes32 | The id |
Return Values
Name | Type | Description |
---|---|---|
[0] | address | The address of the implementation contract |