Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC-7546 proposes a modular contract architecture that uses proxy and Dictionary contracts to support function-level upgrades, factories and clones, and simultaneous upgrades.
This article explains the proposal with additional context and examples.
You can find my other EIP articles here.
Overview
Creating contracts that are both cloneable and upgradeable on the Ethereum Virtual Machine (EVM) has been a challenge. Existing proxy standards, such as the diamond pattern in ERC-2535, address some aspects of the problem but do not directly address every requirement. ERC-7546 proposes two main features to address these gaps.
An upgradeable contract architecture separates a proxy contract (Proxy) from an implementation contract (implementation). The implementation contains the contract logic, while the Proxy invokes that logic and retains the data.
By separating data held by the Proxy from logic supplied by the implementation, developers can upgrade the contract by deploying a new implementation and making the Proxy invoke it instead. For more detail, see the following article.
Understanding Smart Contract Upgrades
Function-level upgrades
Using the mechanism proposed in ERC-2535, calls to individual functions can be routed to implementation contracts. This allows a particular function to be upgraded independently, making it possible to improve only the relevant part of a contract. Splitting functions across implementation contracts also helps developers work within the EVM contract code size limit of 24,576 bytes (24.576 kB) per contract.
For more on ERC-2535, see the following article.
[ERC-2535] Understanding the Diamond Pattern
Factory and clone support with simultaneous upgrades
Drawing on the ERC-1967 beacon model, the proposal streamlines the process of cloning and upgrading Proxy contracts. This allows the contracts that hold individual state to invoke consistent logic. A conventional Proxy may focus on basic upgradeability or follow the ERC-1167 clone standard. The proposed architecture combines both capabilities in a compact Proxy.
For more on ERC-1967, see the following article.
[ERC-1967] Understanding Contract Upgrades
For more on ERC-1167, see the following article.
[ERC-1167] Gas-Efficient Contract Cloning
Motivation
Smart contract developers frequently encounter limitations of the Ethereum Virtual Machine (EVM), including maximum contract code size and stack depth. They must also continually address vulnerabilities in smart contract logic and compilers. Although developers may seek to minimize dependence on trusted third parties for upgrade management, introducing complex governance structures can substantially increase the DevOps workload.
The approach proposed by this standard aims to simplify contract architecture and make development more accessible and enjoyable. Separating DevOps concerns from business logic can make code clearer, facilitate audits, and support analysis using language models (LMs) tailored to particular infrastructure or application domains.
Use cases
Although many contract design patterns have been proposed, they do not address every combination of requirements. The Upgradeable Clone Standard (UCS) is designed to support a range of scenarios.
Terminology
- Contract-level upgradeability
- A proxy contract is associated with one implementation contract, which provides all the proxy's logic.
- Function-level upgradeability
- A proxy contract is associated with multiple implementation contracts, each responsible for particular functions.
- Factory
- A contract that can create proxy clones sharing common implementations.
- In an upgradeable architecture, the cloned proxies can be upgraded simultaneously.
Use cases
- Basic requirements
- When neither upgrades nor factories are needed, ordinary smart contract deployment is sufficient.
- Factory required, but upgrades not required
- ERC-1167 is suitable.
- Contract-level upgradeability required, but no factory
- ERC-1822 can be used.
For more on ERC-1822, see the following article.
[ERC-1822] Understanding the UUPS Upgrade Pattern
- Contract-level upgradeability and a factory required
- Use an ERC-1967 beacon.
- Function-level upgradeability required, but no factory
- ERC-2535 can be used.
- Function-level upgradeability and a factory required
- The Upgradeable Clone Standard (UCS) is designed for this combination.

Specification
An EVM contract account has four conceptual attributes (the account state commits to code and storage through their hashes and roots, respectively).
noncebalancecodestorage
The ERC-7546 architecture divides responsibilities among three types of contracts, which together behave as a single account.
Proxy contract
The Proxy retains the contract account's state (nonce, balance, and storage). By performing delegatecall to function contracts registered in the Dictionary, it separates state from logic while allowing them to operate together.
Dictionary contract
The Dictionary acts as a dispatcher by resolving function calls to the appropriate function contract based on the function selector. This facilitates function upgrades and dynamic address resolution. Moving the Dictionary outside the Proxy enables factory and clone support as well as simultaneous upgrades.
The following explanations clarify the terminology.
Routing by function selector
When a contract function is called, the Dictionary uses its selector (the first four bytes of calldata, analogous to a function identifier) to determine which function contract containing the logic should handle the call. The Proxy then delegates execution to that implementation.
Easier function upgrades
To upgrade a function to a new version, the Dictionary can be configured with its new implementation address. This allows the function logic to be updated without modifying existing Proxy contracts.
Dynamic address resolution
Even when a function's implementation address changes, calls through the Proxy can continue to work as long as the Dictionary points to the appropriate address.
Benefits of separating the Dictionary from the Proxy
- Factory and clone support
- Separating the Dictionary from the Proxy allows multiple Proxy contracts to share one Dictionary.
- This makes it straightforward to create additional Proxy clones.
- Simultaneous upgrade support
- Updating one Dictionary upgrades the behavior of all associated Proxy contracts at the same time, simplifying management.
Function (implementation) contract
An implementation contract contains executable logic for function calls. When invoked by the Proxy using delegatecall, it executes the logic defined in its code.
By separating account state, function dispatch, and logic implementation while respecting the fundamental attributes of an EVM contract account, the architecture improves modularity, upgradeability, and scalability.
Proxy contract
The Proxy passes the selector of the function to be executed to the Dictionary, obtains the corresponding function contract's address, and performs delegatecall to that address.
Storage and events
The Proxy stores the Dictionary contract's address in a designated storage slot. Following the slot derivation convention in ERC-1967, the formula below assigns a specific value such as 0x267691be3525af8a813d30db0c9e2bad08f63baecf6dceb85e2cf3676cff56f4.
bytes32(uint256(keccak256('erc7546.proxy.dictionary')) - 1)When the Dictionary address changes, the following event is emitted.
event DictionaryUpgraded(address dictionary);Dictionary contract
The Dictionary maintains a mapping between function selectors and function contract addresses. It uses this mapping to handle lookup requests from the Proxy.
Storage and events
The Dictionary maintains the mapping between function selectors and function contract addresses and emits an event when the mapping changes.
event ImplementationUpgraded(bytes4 functionSelector, address implementation);Functions
getImplementation
Returns the address of the function contract corresponding to a function selector.
function getImplementation(bytes4 functionSelector) external view returns(address implementation);setImplementation
Sets the mapping between a function selector and a function contract address.
function setImplementation(bytes4 functionSelector, address implementation) external;supportsInterface
The proposal recommends implementing supportsInterface(bytes4 interfaceID), defined by ERC-165, to report interfaces supported by the contracts represented in the mapping.
For more on ERC-165, see the following article.
[ERC-165] Checking Whether a Contract Supports an Interface
supportsInterfaces
Returns a list of registered interface IDs.
function supportsInterfaces() public view returns (bytes4[] memory);Function (implementation) contract
A function contract supplies the logic the Proxy executes using delegatecall. Its address is registered in the Dictionary together with the relevant function selector.
For application data, execution uses the Proxy's storage through delegatecall rather than the implementation contract's own storage.
The Proxy shares its storage with multiple function implementations. For example, if independent implementations assign variables sequentially from slot 0 using the compiler's default layout, their storage can collide.
For more on storage slots, see the following article.
https://chaldene.net/solidity-private-data
To prevent storage collisions, function implementations must manage their storage layouts carefully. Storage management has long been discussed both at the ERC level and at the programming language level, including Solidity, without a single universally adopted standard. This ERC does not mandate a particular storage management technique; developers are encouraged to select a suitable one. For example, they can use a storage layout pattern such as ERC-7201.
For more on ERC-7201, see the following article.
[ERC-7201] Efficient Storage Management Using Namespaces
A function contract must implement the function selectors under which it is registered in the Dictionary. Otherwise, the Proxy's delegatecall may fail or reach unintended fallback logic. The proposal recommends implementing ERC-165's supportsInterface(bytes4 interfaceID) so support for the intended interface can be checked when registering function contracts. Interface declarations do not by themselves prove that the implementations are correct.
Additional considerations
Comparison with ERC-2535
Both ERC-7546 and ERC-2535 provide function-level upgradeability, but they take different approaches. ERC-2535 maintains the mapping to implementation contracts (called facets in that standard) within the proxy itself. ERC-7546 stores the mapping in an external Dictionary contract. Separating the mapping from the Proxy makes cloning contracts and upgrading them simultaneously easier, capabilities that are not straightforward to implement using the basic ERC-2535 architecture alone.

Comparison diagram and the beacon pattern
The Dictionary and Proxy are separate contracts to support factories, clones, and simultaneous upgrades. Rather than managing function implementation addresses within every Proxy, the architecture externalizes that responsibility into the Dictionary. This resembles the beacon proxy approach. If each Proxy maintains its own mapping, each mapping must be upgraded individually. Externalizing that mapping allows clones to share common implementations and be upgraded together.

Source: https://eips.ethereum.org/EIPS/eip-7546
The following diagram illustrates a beacon proxy architecture. A factory contract creates multiple proxy contracts, each of which resolves its implementation through a beacon contract.
Mapping function selectors to implementation addresses
Function-level upgradeability is achieved by querying the Dictionary's mapping of function selectors to implementation contract addresses and performing delegatecall to the returned implementation. With this approach, the Proxy behaves as though it implements the functions of all the registered implementation contracts. The pattern closely resembles the one described by the diamond standard.
Implementation
Implementation details are available in the reference implementation section of the proposal.
Security
Delegating implementation management
The proposed pattern requires consulting the Dictionary to resolve the function to execute. The Dictionary's administrator must therefore be trusted.
Connecting a Proxy to a Dictionary provided by an untrusted administrator is dangerous. The proposal recommends providing a way to switch to another Dictionary governed by a different administrator.
It is also possible to store the Dictionary address in the code itself, for example using Solidity's immutable or constant. However, when the Dictionary administrator differs from the Proxy administrator, the design must account for the possibility that control over implementation selection could be permanently lost.
Storage collisions
In this design pattern, multiple function implementations share the storage of a single Proxy contract. It is important to prevent storage collisions using an appropriate storage management approach.
Storage collisions can cause unexpected values to be written, potentially introducing vulnerabilities.
Function selector mismatches
The Dictionary returns a function implementation address based on the selector supplied by the Proxy.
If a selector registered in the Dictionary does not match a function implemented by the target contract, the intended execution can fail. To prevent unexpected behavior, the proposal recommends checking that the function implementation supports the selectors (interface) being registered when configuring addresses in the Dictionary.
Handling CALL and STATICCALL
The Proxy is primarily designed to respond to CALL and STATICCALL. If another contract invokes this Proxy using DELEGATECALL, the Proxy code runs in the caller's storage context and uses the Dictionary address stored there to request an implementation through getImplementation(bytes4 functionSelector).
If the caller's storage layout does not match the layout expected by the Proxy, DELEGATECALL may not produce the intended result. This does not inherently create a direct threat to the Proxy's own state, but developers should recognize that invoking the Proxy using DELEGATECALL can cause unexpected behavior in the calling context.
Citation
Shogo Ochiai (@shogochiai) shogo.ochiai@pm.me, Kai Hiroi (@KaiHiroi) kai.hiroi@pm.me, "ERC-7546: Upgradeable Clone for Scalable Contracts [DRAFT]," Ethereum Improvement Proposals, no. 7546, October 2023. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7546.
References
レビューありがとうございます! 内部変数アクセスはCALLなしにInternal library 関数として安価にアクセス可能です。…
Conclusion
ERC-7546 proposes a modular, upgradeable architecture using Proxy and Dictionary contracts. It combines function-level contract upgradeability with factory and clone support and simultaneous upgrades.


