PoolAddressesProviderRegistry

Main registry of PoolAddressesProvider of ParaSpace markets.

Used for indexing purposes of ParaSpace protocol's markets. The id assigned to a PoolAddressesProvider refers to the market it is connected with, for example with 1 for the ParaSpace main market and 2 for the next created.

_addressesProviderToId

mapping(address => uint256) _addressesProviderToId

_idToAddressesProvider

mapping(uint256 => address) _idToAddressesProvider

_addressesProvidersList

address[] _addressesProvidersList

_addressesProvidersIndexes

mapping(address => uint256) _addressesProvidersIndexes

constructor

constructor(address owner) public

Constructor.

Parameters

NameTypeDescription

owner

address

The owner address of this contract.

getAddressesProvidersList

function getAddressesProvidersList() external view returns (address[])

Returns the list of registered addresses providers

Return Values

NameTypeDescription

[0]

address[]

The list of addresses providers

registerAddressesProvider

function registerAddressesProvider(address provider, uint256 id) external

Registers an addresses provider

The PoolAddressesProvider must not already be registered in the registry The id must not be used by an already registered PoolAddressesProvider

Parameters

NameTypeDescription

provider

address

The address of the new PoolAddressesProvider

id

uint256

The id for the new PoolAddressesProvider, referring to the market it belongs to

unregisterAddressesProvider

function unregisterAddressesProvider(address provider) external

Removes an addresses provider from the list of registered addresses providers

Parameters

NameTypeDescription

provider

address

The PoolAddressesProvider address

getAddressesProviderIdByAddress

function getAddressesProviderIdByAddress(address addressesProvider) external view returns (uint256)

Returns the id of a registered PoolAddressesProvider

Parameters

NameTypeDescription

addressesProvider

address

The address of the PoolAddressesProvider

Return Values

NameTypeDescription

[0]

uint256

The id of the PoolAddressesProvider or 0 if is not registered

getAddressesProviderAddressById

function getAddressesProviderAddressById(uint256 id) external view returns (address)

Returns the address of a registered PoolAddressesProvider

Parameters

NameTypeDescription

id

uint256

The id of the market

Return Values

NameTypeDescription

[0]

address

The address of the PoolAddressesProvider with the given id or zero address if it is not registered

_addToAddressesProvidersList

function _addToAddressesProvidersList(address provider) internal

Adds the addresses provider address to the list.

Parameters

NameTypeDescription

provider

address

The address of the PoolAddressesProvider

_removeFromAddressesProvidersList

function _removeFromAddressesProvidersList(address provider) internal

Removes the addresses provider address from the list.

Parameters

NameTypeDescription

provider

address

The address of the PoolAddressesProvider