---
eip: 1538
label: ERC-1538
title: Transparent Contract Standard
status: Withdrawn
type: Standards Track
category: ERC
created: 2018-10-31
official: https://eips.ethereum.org/EIPS/eip-1538
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1538.md
canonical: https://eips.huatuo.xyz/eip-1538/
lang: en
tldr: An early upgradeable-proxy pattern that routes each function to its own delegate contract and logs every change with events; withdrawn in favour of the Diamond standard.
tags: [proxy, upgradeability, delegatecall, contract-size]
---

# ERC-1538: Transparent Contract Standard

> This standard provides a contract architecture that makes upgradeable contracts flexible, unlimited in size, and transparent.

**TL;DR:** An early upgradeable-proxy pattern that routes each function to its own delegate contract and logs every change with events; withdrawn in favour of the Diamond standard.

## What problem does it solve?

Immutable contracts cannot be fixed or improved, while typical upgradeable contracts can be changed silently by their owners. Contracts are also limited to 24 KB of code, which large systems quickly hit.

ERC-1538, the "Transparent Contract Standard", tried to find a middle ground: a single, permanent contract address whose functions can be added, replaced or removed, with every change documented on-chain in a standard format so anyone can audit the contract's history. Because functions can live in many separate contracts, total code size is practically unlimited.

## How it works

- The **transparent contract** keeps a mapping from function selector to **delegate contract**. Its fallback function looks up `msg.sig` and runs the matching code with `delegatecall`, so delegates operate on the transparent contract's storage. Unknown selectors revert.
- Functions written directly in the transparent contract are **unchangeable functions**; they can never be replaced.
- All changes go through `updateContract(address delegate, string functionSignatures, string commitMessage)`. The signatures are concatenated, e.g. `"approve(address,uint256)balanceOf(address)"`. Passing `address(0)` as `delegate` removes those functions.
- Each changed function emits `FunctionUpdate(functionId, oldDelegate, newDelegate, functionSignature)`, and each call emits one `CommitMessage(message)` explaining why, much like a version-control log.
- An optional `ERC1538Query` interface lists all functions and their delegates.
- Ownership and authorisation for upgrades are left to the implementer. Source code of the contract and all delegates must be publicly verified.

## Sample code

The core routing idea in current Solidity:

```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract RoutingProxy {
    mapping(bytes4 => address) internal delegates;

    event FunctionUpdate(bytes4 indexed functionId, address indexed oldDelegate,
                         address indexed newDelegate, string functionSignature);
    event CommitMessage(string message);

    fallback() external payable {
        address delegate = delegates[msg.sig];
        require(delegate != address(0), "Function does not exist.");
        assembly {
            calldatacopy(0, 0, calldatasize())
            let ok := delegatecall(gas(), delegate, 0, calldatasize(), 0, 0)
            returndatacopy(0, 0, returndatasize())
            switch ok
            case 0 { revert(0, returndatasize()) }
            default { return(0, returndatasize()) }
        }
    }
}
```

Adding functions from a script:

```ts
await transparent.updateContract(
  erc721Delegate,
  "balanceOf(address)ownerOf(uint256)transferFrom(address,address,uint256)",
  "Adding ERC-721 functions",
);
```

## Things to know

- Status: **Withdrawn**. The author replaced it with [ERC-2535 Diamonds](/eip-2535/), which keeps the per-function routing and change events but uses selector arrays and a standard `diamondCut` function.
- For simpler single-implementation proxies, see the storage slots standardised in [ERC-1967](/eip-1967/).
- Whoever controls `updateContract` can add a function that does anything with the contract's storage and funds; transparency makes this visible, not impossible.
- Delegates share one storage space, so storage layout must be managed carefully to avoid collisions.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1538
