# Pool Proxy

***

**🔹 Fallback**

* **fallback() payable** A generic handler that forwards all calls (that don’t match any defined function) to the current implementation contract using `delegatecall`. This is how the proxy “forwards” function calls to the logic contract.

***

**🔹 Functions**

* **admin() → address** Returns the admin address of the proxy. ⚠️ Only callable by the admin, otherwise the call is forwarded to the implementation.
* **implementation() → address** Returns the address of the current implementation contract. ⚠️ Only callable by the admin.
* **initialize(address \_logic, bytes \_data)** (payable) Sets the initial implementation (`_logic`) and optionally calls an initialization function on it with the provided `_data`. This is usually used right after deployment.
* **upgradeTo(address newImplementation)** Upgrades the proxy to a new implementation contract. Only the admin can call this.
* **upgradeToAndCall(address newImplementation, bytes data)** (payable) Upgrades to a new implementation **and** immediately calls a function on it (using `data`). This is useful for initializing the new implementation in the same transaction.

```
[
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "admin",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "constructor"
  },
  {
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "internalType": "address",
        "name": "implementation",
        "type": "address"
      }
    ],
    "name": "Upgraded",
    "type": "event"
  },
  {
    "stateMutability": "payable",
    "type": "fallback"
  },
  {
    "inputs": [],
    "name": "admin",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [],
    "name": "implementation",
    "outputs": [
      {
        "internalType": "address",
        "name": "",
        "type": "address"
      }
    ],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "_logic",
        "type": "address"
      },
      {
        "internalType": "bytes",
        "name": "_data",
        "type": "bytes"
      }
    ],
    "name": "initialize",
    "outputs": [],
    "stateMutability": "payable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newImplementation",
        "type": "address"
      }
    ],
    "name": "upgradeTo",
    "outputs": [],
    "stateMutability": "nonpayable",
    "type": "function"
  },
  {
    "inputs": [
      {
        "internalType": "address",
        "name": "newImplementation",
        "type": "address"
      },
      {
        "internalType": "bytes",
        "name": "data",
        "type": "bytes"
      }
    ],
    "name": "upgradeToAndCall",
    "outputs": [],
    "stateMutability": "payable",
    "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/pool-proxy.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.
