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
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
[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
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
id
bytes32
The id
Return Values
[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
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
id
bytes32
The id
newImplementationAddress
address
The address of the new implementation
getPool
Returns the address of the Pool proxy.
Return Values
[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
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
[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
newPoolConfiguratorImpl
address
The new PoolConfigurator implementation
getPriceOracle
Returns the address of the price oracle.
Return Values
[0]
address
The address of the PriceOracle
setPriceOracle
Updates the address of the price oracle.
Parameters
newPriceOracle
address
The address of the new PriceOracle
getACLManager
Returns the address of the ACL manager.
Return Values
[0]
address
The address of the ACLManager
setACLManager
Updates the address of the ACL manager.
Parameters
newAclManager
address
The address of the new ACLManager
getACLAdmin
Returns the address of the ACL admin.
Return Values
[0]
address
The address of the ACL admin
setACLAdmin
Updates the address of the ACL admin.
Parameters
newAclAdmin
address
The address of the new ACL admin
getPriceOracleSentinel
Returns the address of the price oracle sentinel.
Return Values
[0]
address
The address of the PriceOracleSentinel
setPriceOracleSentinel
Updates the address of the price oracle sentinel.
Parameters
newPriceOracleSentinel
address
The address of the new PriceOracleSentinel
getPoolDataProvider
Returns the address of the data provider.
Return Values
[0]
address
The address of the DataProvider
getWETH
Returns the address of the Wrapped ETH.
Return Values
[0]
address
The address of the Wrapped ETH
getMarketplace
Returns the info of the marketplace.
Return Values
[0]
struct DataTypes.Marketplace
The info of the marketplace
setProtocolDataProvider
Updates the address of the data provider.
Parameters
newDataProvider
address
The address of the new DataProvider
setWETH
Updates the address of the WETH.
Parameters
newWETH
address
The address of the new WETH
setMarketplace
Updates the info of the marketplace.
Parameters
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
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
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
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
id
bytes32
The id
Return Values
[0]
address
The address of the implementation contract