# Upgradeable Proxy Contract

Indirection is an established and fundamental tool used in building software.

In computer programming, indirection (also known as “dereferencing”) is the ability to reference something using a name, reference, or container, instead of the value itself. The most common form of indirection is the act of manipulating a value through its memory address. One example of indirection is the domain name system, which enables names such as “en.wikipedia.org” to be used in place of network address such as “208.80.154.224.”

The Ethereum blockchain network and proxy contracts both use indirection, to facilitate building software on the Ethereum blockchain network.

A proxy contract is a type of smart contract that acts as an intermediary smart contract that delegates calls to another smart contract known as the “implementation contract”. In cases where a proxy contract is used, interaction with the underlying implementation contract must be done through the proxy contract.

The proxy contract stores the address of the implementation contract so when a user interacts with the proxy contract, the proxy contract delegates the call to the implementation contract, which then executes the requested function and returns the result to the proxy contract, which in turn, returns the result to the user.

<figure><img src="/files/y5DPyGOTCKaHtr3UVZy8" alt=""><figcaption><p>Version 1: The Upgradeable Proxy Contract directs to Implementation Contract A</p></figcaption></figure>

The above diagram shows the first version where the Upgradeable Proxy Contract directs to Implementation Contract A.&#x20;

<figure><img src="/files/luHsThLuPS6dkXJ570QI" alt=""><figcaption><p>Version 2: The Upgradeable Proxy Contract directs to Implementation Contract B</p></figcaption></figure>

The above diagram shows the second version where the Upgradeable Proxy Contract now directs to Implementation Contract B.&#x20;

Some of the benefits of using proxy contracts include the ability:

1. to upgrade the implementation contract without changing the proxy contract blockchain address, which allows rollback to previous versions of implementation contracts, and implementation contract upgrades could be executed without users having to change the smart contract blockchain address they intend to interact with, because the proxy contract would still have the same blockchain address; and
2. to deploy a new implementation contract which uses less gas instead of deploying an entirely new implementation contract, minimizing the need to update references to the implementation contract’s blockchain address in decentralized applications.

Open Zeppelin is a good concrete example to start with.

{% content-ref url="/pages/7LKVLI1pTP4D8EP5Y8gq" %}
[Open Zeppelin](/documentation/concept-glossary/smart-contracts/upgradeable-proxy-contract/open-zeppelin.md)
{% endcontent-ref %}


---

# 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://docs.chainargos.com/documentation/concept-glossary/smart-contracts/upgradeable-proxy-contract.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.
