# Storage Upgradeable Proxy

The Storage Upgradeable Proxy is based on reading the target from a slot from a Storage. This means multiple proxies can read from the same slot and can all be upgraded at once by changing that Storage slot.

{% hint style="info" %}
The Storage mentioned here is not the internal storage of the contract but a separate contract capable of storing and reading storage slots. This means data is stored elsewhere than the proxy contract itself and can be updated independently of it.
{% endhint %}

{% code title="StorageUpgradeableProxy.sol" overflow="wrap" lineNumbers="true" %}

```solidity
contract StorageUpgradeableProxy is ProxyOwnable, Proxy {
  bytes32 internal constant _STORAGE_SLOT =
    bytes32(uint256(keccak256("proxy.storage")) - 1);

  bytes32 internal constant _SLOT_SLOT =
    bytes32(uint256(keccak256("proxy.storage.slot")) - 1);

  event Upgraded(address indexed _newStorage, bytes32 indexed _newSlot);

  constructor(
    address _owner,
    address _storage,
    bytes32 _slot,
    bytes memory _initialCall
  );

  function upgradeTo(
    address _newStorage,
    bytes32 _newSlot,
    bytes memory _oldImplementationData,
    bytes memory _newImplementationData
  ) external;

  function implementation()
    public
    view
    override
    returns (address _implementation);

  function proxyType() public pure override returns (uint256 _type);

  function _setImplementation(address _newStorage, bytes32 _newSlot) internal;
}
```

{% endcode %}


---

# 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.phase.cash/proxies/storage-upgradeable-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.
