# PoolAddressesProviderRegistry

**🔹Constructor**

* **`constructor(address owner)`** Initializes the contract and assigns the initial `owner` who has admin rights.

***

**🔹View Functions (read-only)**

* **`getAddressesProviderAddressById(uint256 id) → address`** Returns the provider’s address linked to a given market ID. If no provider exists for that ID, it returns the zero address.
* **`getAddressesProviderIdByAddress(address provider) → uint256`** Returns the ID assigned to a specific provider address. If the provider is not registered, it returns `0`.
* **`getAddressesProvidersList() → address[]`** Returns the full list of currently registered providers.
* **`owner() → address`** Returns the address of the current contract owner.

***

**🔹State-Changing Functions (write operations)**

* **`registerAddressesProvider(address provider, uint256 id)`** Registers a new provider.
  * The provider must not already be registered.
  * The ID must be unique (not used by another provider). Only callable by the contract owner.
* **`unregisterAddressesProvider(address provider)`** Removes a provider from the registry, freeing its ID. Only callable by the contract owner.
* **`transferOwnership(address newOwner)`** Transfers ownership rights from the current owner to a `newOwner`. Only callable by the current owner.
* **`renounceOwnership()`** The current owner gives up ownership permanently. After this, no one will have special admin rights. This action cannot be undone.

***

**🔹Events**

* **`AddressesProviderRegistered(address provider, uint256 id)`** Triggered when a provider is registered.
* **`AddressesProviderUnregistered(address provider, uint256 id)`** Triggered when a provider is removed from the registry.
* **`OwnershipTransferred(address previousOwner, address newOwner)`** Triggered when ownership is transferred to a new account.

Copy

```
[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "owner",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "addressesProvider", "type": "address" },
      { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }
    ],
    "name": "AddressesProviderRegistered",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "addressesProvider", "type": "address" },
      { "indexed": true, "internalType": "uint256", "name": "id", "type": "uint256" }
    ],
    "name": "AddressesProviderUnregistered",
    "type": "event"
  },
  {
    "anonymous": false,
    "inputs": [
      { "indexed": true, "internalType": "address", "name": "previousOwner", "type": "address" },
      { "indexed": true, "internalType": "address", "name": "newOwner", "type": "address" }
    ],
    "name": "OwnershipTransferred",
    "type": "event"
  },
  {
    "inputs": [{ "internalType": "uint256", "name": "id", "type": "uint256" }],
    "name": "getAddressesProviderAddressById",
    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [{ "internalType": "address", "name": "addressesProvider", "type": "address" }],
    "name": "getAddressesProviderIdByAddress",
    "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "getAddressesProvidersList",
    "outputs": [{ "internalType": "address[]", "name": "", "type": "address[]" }],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "owner",
    "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
    "stateMutability": "view",
    "type": "function"
  },
  {
    "inputs": [
      { "internalType": "address", "name": "provider", "type": "address" },
      { "internalType": "uint256", "name": "id", "type": "uint256" }
    ],
    "name": "registerAddressesProvider",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "renounceOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [{ "internalType": "address", "name": "newOwner", "type": "address" }],
    "name": "transferOwnership",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [{ "internalType": "address", "name": "provider", "type": "address" }],
    "name": "unregisterAddressesProvider",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  }
]



```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://colend.gitbook.io/home/abi/pooladdressesproviderregistry.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
