IR Solutions

Upgradeable Smart Contracts: Proxy Patterns, Risks & Best Practices

11 min read
muhammad saif

Written by

muhammad saif

Blockchain Developer

A Blockchain Developer specializing in decentralized applications, smart contracts, Web3, and secure blockchain solutions. He explores how blockchain technology can improve transparency, security, and business efficiency across modern industries. Through practical insights, he helps businesses understand and adopt scalable decentralized technologies.

Stay connected

Follow IR Solutions

Upgradeable Smart Contracts: Proxy Patterns, Risks & Best Practices
Article Content
  1. What Is an Upgradeable Smart Contract?
  2. How the Proxy Pattern Makes Smart Contracts Upgradeable
  3. Main Upgradeable Smart Contract Proxy Patterns
  4. Transparent Proxy Pattern
  5. UUPS Proxy Pattern
  6. Beacon Proxy Pattern
  7. Diamond Proxy Pattern (EIP-2535)
  8. Transparent vs UUPS vs Beacon vs Diamond
  9. Which Upgrade Pattern Should You Choose?
  10. Storage Layout: The Risk That Can Break an Upgrade
  11. Constructors, Initializers and Reinitializers
  12. Security Risks of Upgradeable Smart Contracts
  13. How to Secure Upgrade Authority
  14. Best Practices for Building Upgradeable Smart Contracts
  15. How to Test a Smart Contract Upgrade Before Mainnet
  16. Safe Smart Contract Upgrade Workflow
  17. When Should You Use an Upgradeable Smart Contract?
  18. When Should You Prefer an Immutable Contract?
  19. Upgradeable Smart Contract Checklist
  20. Conclusion
  21. Frequently Asked Questions

Key Takeaways

  • Upgradeable smart contracts keep one stable address while the logic behind it can be swapped later.
  • A proxy holds all state and uses delegatecall to run code from a separate implementation contract.
  • UUPS and Transparent suit most projects, while Beacon and Diamond solve more specialized problems well.
  • Storage changes can corrupt balances, so preserve the existing layout and validate every upgrade.
  • Initializers replace constructors, and implementation contracts should always lock out direct initialization by attackers.
  • Whoever controls upgrades controls the system, so use multisigs, timelocks and clear emergency procedures together.
  • Upgradeability is a deliberate trade-off, and small stable contracts are often safer left fully immutable.

Upgradeable smart contracts let teams fix bugs, patch security holes and add features without changing the user-facing address. Once deployed, contract bytecode stays fixed, a key limit in how smart contracts work on the blockchain. Upgradeability solves this by keeping state in one contract and moving replaceable logic into another contract.

Ethereum's developer documentation names proxy-based upgrades as a main way to change behavior while keeping stored data. This flexibility helps long-lived products, yet it also adds new risks around storage, initialization and admin access. A single careless upgrade can corrupt balances, lock funds or hand control to an attacker overnight.

Next, you will learn how a delegatecall proxy routes every call into replaceable logic contracts. You will then compare Transparent, UUPS, Beacon and Diamond patterns and see where each fits. Finally, you will get storage rules, testing steps, governance controls and a ready launch checklist.

What Is an Upgradeable Smart Contract?

An upgradeable smart contract keeps one permanent address while the logic behind that address can be replaced later. The deployed bytecode is never rewritten, because the system simply points the stable address toward new code. State lives in one contract, while business logic lives in a separate implementation contract that can change. Users keep interacting with the same address, so balances, approvals and history stay exactly where they were.  Upgradeability differs from mutability, since old code still exists on chain and only the active reference changes.

Why Make a Smart Contract Upgradeable?

Teams choose smart contract upgradeability to patch vulnerabilities, fix bugs, add features and adapt protocol rules over time. Still, not every contract needs it, so settle this early within a clear smart contract development process during architecture.

How the Proxy Pattern Makes Smart Contracts Upgradeable

The smart contract proxy pattern splits one application into two cooperating contracts with very different jobs.

proxy contract

Proxy Contract

The proxy contract is the permanent address that users, wallets and other protocols call every single day. It holds all persistent state, including balances and settings, while forwarding each incoming call to separate logic code.

Implementation Contract

The implementation contract holds the application logic, such as token transfer rules, minting limits and fee calculations. Users rarely call it directly, because the proxy borrows its code and runs that code against the proxy storage.

How delegatecall Works

User → Proxy → delegatecall → Implementation

In a delegatecall proxy, the proxy borrows implementation code and executes it using its own storage and balance. So the code comes from the implementation, but every read and write lands inside the proxy smart contract itself.

What Happens During an Upgrade?

  • Current state: User → Proxy → Implementation V1
  • Upgrade: Deploy Implementation V2 → Update implementation reference
  • After upgrade: User → Proxy → Implementation V2

During an upgrade, the team deploys Implementation V2 and updates the implementation reference stored inside the proxy. Future calls then delegate to V2, while the proxy address and all existing state remain the same.

Main Upgradeable Smart Contract Proxy Patterns

Every upgradeable proxy follows the same core idea, but each pattern places the upgrade logic somewhere different. Before reading each pattern in depth, use this overview to see where control lives and what you give up.

Pattern

Where Upgrade Logic Lives

Best Fit

Main Trade-Off

Transparent Proxy

Proxy and admin layer

Established applications

Higher proxy complexity

UUPS Proxy

Implementation

Flexible, lightweight systems

Upgrade logic must remain safe

Beacon Proxy

Beacon contract

Many related proxy instances

Shared upgrade dependency

Diamond Proxy

Diamond and facets

Large modular systems

Greater architectural complexity

Transparent Proxy Pattern

The Transparent proxy pattern is one of the oldest Solidity proxy pattern designs and is still widely used today.

How Transparent Proxies Work

A Transparent proxy checks who is calling before deciding exactly what to do with each incoming transaction. Admin calls reach upgrade functions inside the proxy, while every other call is delegated straight to the current implementation.

ProxyAdmin and Admin Separation

OpenZeppelin uses a separate ProxyAdmin contract as the only account ever allowed to upgrade a Transparent proxy. Because that admin can never call implementation functions, clashes between admin and user functions cannot confuse users or admins.

Advantages of Transparent Proxies

Upgrade logic stays in the proxy, so it doesn't depend on the implementation retaining UUPS upgrade functions. However, faulty implementation code can still disrupt the system. The pattern is mature, widely audited and fully supported by OpenZeppelin Upgrades plugins for Hardhat and Foundry.

Limitations and Security Considerations

Every call pays a small extra gas cost, because the proxy must first check whether the caller is admin. Teams must also protect the ProxyAdmin owner carefully, since that single account controls every future upgrade.

When a Transparent Proxy Makes Sense

Choose a Transparent proxy when you want a proven setup and prefer upgrade logic kept away from business code. It suits established applications where slightly higher gas matters less than predictable and clear admin separation.

UUPS Proxy Pattern

The UUPS proxy pattern is now the default choice in OpenZeppelin upgradeable contracts for many new projects.

uups proxy pattern

How UUPS Proxies Work

A UUPS proxy is a slim ERC-1967 proxy that only stores the implementation address and forwards every incoming call. The actual upgrade function itself lives inside the implementation, following the ERC-1822 universal upgradeable proxy standard design.

How UUPS Differs From Transparent Proxy

With UUPS, upgrade logic sits in the implementation, so the proxy stays smaller and noticeably cheaper to deploy. The cost is that each new implementation must carry correct upgrade code, shifting security responsibility onto the developers.

_authorizeUpgrade() and Upgrade Access Control

Every UUPS implementation must override _authorizeUpgrade() to decide who may trigger an upgrade to new implementation code. Developers usually protect it with onlyOwner or a dedicated upgrader role, because an empty check lets literally anyone upgrade.

Advantages of UUPS

UUPS proxies are generally cheaper to deploy because upgrade logic lives in the implementation rather than the proxy. Runtime gas costs depend on the implementation and call path, so benchmark both patterns before choosing based on gas savings. Teams can also customize upgrade rules or even remove upgradeability entirely once the protocol becomes fully stable and mature.

UUPS Risks

The main UUPS risks include broken authorization, a faulty implementation, storage incompatibility and missed or repeated initialization steps. Deploying a version without working upgrade code can permanently freeze the contract, leaving future bugs impossible to fix.

Beacon Proxy Pattern

A beacon proxy is useful when many proxy instances need to share the same implementation and receive upgrades through a single beacon.

How Beacon Proxies Work

Proxy A ─┐

Proxy B ─┼→ UpgradeableBeacon → Implementation

Proxy C ─┘

Each Beacon proxy asks a shared UpgradeableBeacon contract for the current implementation address before delegating any incoming call. When the beacon owner points it at new code, every connected proxy starts using that new code immediately.

Why Use a Beacon?

Beacons fit factories that deploy hundreds of vaults, wallets or token instances all sharing the same logic. Instead of upgrading each proxy separately, the team updates one beacon and saves significant time, effort and gas.

Beacon Proxy Risks

The biggest strength is also the biggest danger, because one beacon upgrade changes every linked proxy at once. A compromised beacon owner or a buggy implementation can therefore damage every single instance in one moment.

Diamond Proxy Pattern (EIP-2535)

The Diamond proxy takes modularity much further, so treat it as its own architecture rather than another UUPS variant.

How Diamond Proxies and Facets Work

The Diamond standard EIP-2535 lets one proxy, called a diamond, use many separate implementation contracts called facets. Each facet handles one area, such as trading, governance or rewards, while all facets share the same diamond storage.

Function Selector Routing

The diamond keeps a mapping from each function selector to the facet address that should handle that function. When a call arrives, the fallback function looks up the selector and delegates the call to that facet.

Advantages of Modular Upgradeability

Teams can add, replace or remove individual functions through diamondCut without redeploying the whole system each time a change ships. This also helps very large protocols stay under the contract size limit that blocks huge single implementations.

Complexity and Security Trade-Offs

More facets mean more selectors, more shared storage and more chances for an unnoticed storage collision or clash. Audits take longer, tooling support is thinner and onboarding new developers becomes noticeably harder as the system grows.

When Diamond Architecture Is Appropriate

Consider a Diamond only when a protocol is genuinely large, modular and supported by an experienced engineering team. For most products, a UUPS or Transparent proxy delivers enough flexibility with far fewer moving parts to audit.

Transparent vs UUPS vs Beacon vs Diamond

Each pattern solves a slightly different problem, so compare them on control, scope and complexity before choosing.

Factor

Transparent

UUPS

Beacon

Diamond

Upgrade logic

Proxy and admin

Implementation

Beacon

Diamond

Implementations

One per proxy

One per proxy

Shared

Multiple facets

Complexity

Medium

Medium

Medium

High

Multiple instance upgrades

No

No

Yes

Architecture dependent

Main security concern

Admin control

Upgrade authorization

Shared beacon authority

Selector and storage complexity

Typical use

General upgradeability

Lightweight modern proxies

Factories and many instances

Large modular systems

Which Upgrade Pattern Should You Choose?

It directly explains the purpose of the bullets that follow the comparison table and makes the section flow naturally.

  • Proven default: Pick Transparent when you want admin separation and mature tooling without writing any upgrade logic yourself.
  • Lean contracts: Pick UUPS when lower gas matters and your team can safely maintain upgrade code in every version.
  • Many instances: Pick Beacon when a factory deploys many copies that must always run the same logic together.
  • Huge systems: Pick Diamond only when modular facets truly solve size or organization problems that simpler proxies cannot.

Storage Layout: The Risk That Can Break an Upgrade

Because delegatecall runs implementation code against proxy storage, every storage layout upgrade must keep old data readable.

upgradeable contract security

How Proxy Storage Works

Solidity assigns state variables to numbered storage slots based on their declaration order inside the source contract. The proxy keeps those slots, so each new implementation must read the same variables from the same positions.

What Is a Storage Collision?

A smart contract storage collision happens when two variables point to the same slot but expect different data. The contract then reads an owner address as a balance, or overwrites critical values without any warning.

Why Changing Variable Order Is Dangerous

V1

slot 0 → owner

slot 1 → balance

Unsafe V2

slot 0 → newVariable

slot 1 → owner

slot 2 → balance

In the unsafe V2, newVariable now reads slot 0, which still holds the old owner address from V1. Owner reads the old balance and balance reads space, so the stored state is badly misinterpreted.

Safely Adding New State Variables

For traditional storage layouts, add new variables after existing ones without changing their order or types. When using storage gaps or ERC-7201 namespaced storage, follow the rules for that storage strategy. Always validate compatibility before deploying an upgrade. OpenZeppelin Upgrades plugins compare layouts automatically and block deployments that would break the existing proxy storage structure.

Inheritance and Storage Layout Changes

Parent contracts claim storage slots first, so adding a variable to a parent can shift the storage layout of child contracts. OpenZeppelin's upgradeable contract guide explains how storage gaps and ERC-7201 namespaced storage help manage these changes without breaking existing state.

ERC-1967 Storage Slots

An ERC-1967 proxy stores its implementation, admin and beacon addresses in fixed slots derived from specific hashed strings. These random-looking positions keep proxy data far away from normal variables, preventing any collisions with implementation storage.

Constructors, Initializers and Reinitializers

Setup code behaves very differently behind a proxy, which is why initialization mistakes cause so many real incidents.

Why Constructors Do Not Initialize Proxy Storage

A constructor runs only once, inside the implementation, when that implementation contract is first deployed on chain. Its writes land in implementation storage, so the proxy never sees owners, names or settings that were set there.

Using Initializer Functions

Upgradeable contracts replace constructors with a normal public initialize function that the proxy calls right after deployment. Most teams pass the encoded initialize call during proxy creation, so setup and deployment happen together in one transaction.

Preventing Multiple Initialization

The initializer modifier from OpenZeppelin ensures that initialize can run only once for each proxy instance. Without it, an attacker could call initialize again later, reset the owner and quietly take control of the entire contract.

Initializing Inherited Contracts

Make sure all required parent contracts are initialized in the correct order. Some OpenZeppelin initializers already call their parent initializers, so check the inheritance chain to avoid initializing the same contract twice. Missing even one leaves ownership, pausing or admin access roles empty, which attackers may later discover and quietly exploit.

Reinitializers for New Upgrade Versions

When V2 needs fresh setup, such as a new fee variable, use the reinitializer modifier with a version number. Each version number runs only once, so upgrade setup stays controlled and cannot be replayed by anyone later.

Locking the Implementation Contract

Call _disableInitializers() inside the implementation constructor so nobody can ever initialize the bare implementation contract directly on chain. This blocks attackers from taking ownership of the logic contract, a weakness behind several serious and costly past exploits.

Security Risks of Upgradeable Smart Contracts

Upgradeable contract security covers more than code, because upgrades add new people, keys and processes to trust.

smart contract upgrade risks

Unauthorized Upgrades

If an attacker gains upgrade authority, they can swap in malicious logic and drain every asset the proxy holds. In practice, whoever controls upgrades controls the entire system, regardless of how safe the current code looks.

Storage Collisions and State Corruption

A careless layout change can corrupt balances, ownership, roles and permissions without triggering any visible error at all. The storage layout section above explains these mechanics, so treat every variable change as a carefully reviewed decision.

Uninitialized Proxy or Implementation Contracts

An uninitialized proxy or implementation lets anyone call initialize first and become the owner of that contract. From there, an attacker may trigger upgrades, change settings or even destroy logic that other proxies depend upon.

Unsafe Implementation Contracts

A perfectly built proxy cannot protect users from a vulnerable new implementation introduced during a rushed upgrade. Catch new reentrancy bugs or missing checks early by applying regression, fuzz and fork testing methods before release.

Function Selector Clashes

Every function has a four-byte selector, and two different functions can occasionally share the same selector value. If a proxy and implementation clash, calls may hit the wrong function, especially in complex routing designs.

Upgrade Authority as a Single Point of Failure

When one private key controls upgrades, every user must trust that single key holder completely and permanently. A compromised private key or insider mistake could give an attacker control over future upgrades.

Governance Attacks

In token-governed protocols, attackers may borrow or buy voting power and then pass a malicious upgrade proposal. Flash loan voting and low turnout have both enabled real attacks, so governance needs its own careful safeguards.

Breaking Integrations During an Upgrade

Changing function signatures, events or return values can silently break frontends, indexers and other dependent protocols overnight. Keep the ABI and interfaces backward compatible where possible, and warn integration partners well before any breaking change ships.

Upgradeable Contract Complexity

Upgrade mechanisms introduce extra code, permissions and security risks that auditors must review. Poorly designed proxies can create vulnerabilities that remain unnoticed until an upgrade or attack exposes them.

How to Secure Upgrade Authority

Since upgrade power equals system control, protecting that power deserves as much attention as protecting the code.

Avoid Single EOA Upgrade Control

A single externally owned account should rarely hold unrestricted upgrade rights for a live production protocol holding value. Use one wallet only during early testing, then move authority to stronger controls well before real user funds arrive.

Use Multisig Approval

A multisig such as Safe requires several independent signers to approve every upgrade before it can execute on-chain. A three-of-five setup means attackers must compromise multiple people and devices, not just one stolen laptop.

Add a Timelock Where Appropriate

A timelock delays an approved upgrade for a predefined period before final execution. This gives users and security teams time to review the change before it takes effect. This window lets users review the change, exit positions if they disagree and spot malicious proposals early.

Use Role-Based Access Control

Separate roles for upgrading, pausing and configuration so no single account holds every sensitive permission at once. OpenZeppelin AccessControl makes this setup fairly simple, and each role can belong to a different multisig or governance contract.

Consider Onchain Governance for Decentralized Protocols

Fully decentralized protocols often route upgrades through token voting, with a Governor contract feeding into a timelock. This spreads control across the community, though it needs quorum rules and protection against borrowed or flash-loaned voting power.

Define Emergency Upgrade Procedures

Timelocks slow down attackers, but they also slow down urgent fixes while an active exploit is draining funds. Many teams therefore pair a timelock with a narrow emergency pause role held by a separate security multisig.

If your team needs help designing secure upgrade permissions or reviewing proxy architecture, hire smart contract developers with experience in upgradeable contract systems.

Best Practices for Building Upgradeable Smart Contracts

These smart contract upgrade best practices turn the earlier risks into daily habits your team can follow consistently.

  • Proven libraries: Use established OpenZeppelin upgradeable contracts and proxy implementations instead of building custom proxy logic.
  • Storage discipline: Preserve existing storage layouts and validate compatibility before every upgrade.
  • Protected initializers: Guard initialization, check parent initializer calls and lock implementation contracts.
  • Secure upgrade access: Limit permissions, use multisigs and add timelocks where appropriate.
  • Verified deployments: Verify implementation code and record contract addresses, approvals and deployment transactions.
  • Active monitoring: Track upgrades, permission changes and unexpected contract activity.
  • Independent audits: Review security-sensitive upgrades and use this smart contract audit preparation checklist before external audits.

How to Test a Smart Contract Upgrade Before Mainnet

Testing an upgrade means testing the transition itself, not only the new code sitting quietly in isolation.

Test the Existing Implementation First

Before writing V2, confirm that V1 passes its full test suite and that you understand its current behavior. Capture key balances, roles and settings, because these values become your baseline for comparing results after upgrading.

Deploy the New Implementation

Deploy V2 on a local network or testnet first, without connecting it to any production proxy just yet. Use the same compiler version and optimizer settings planned for mainnet, so the bytecode matches what you ship.

Validate Storage Layout Compatibility

Run the OpenZeppelin Upgrades validation or a storage layout diff tool against V1 and V2 before going further. Any reordered, removed or retyped variable should stop the process until someone reviews and fixes the layout.

Run the Upgrade on a Local or Forked Environment

Fork mainnet with Foundry or Hardhat so you can upgrade the real proxy against real state without any risk. This reveals problems that clean test deployments hide, such as unusual balances, old approvals or forgotten admin settings.

Verify Existing State Is Preserved

After the forked upgrade, compare every stored balance, owner, role and configuration value against your earlier recorded baseline. Even one changed value suggests a storage problem, so investigate immediately before anyone schedules the real mainnet upgrade.

Test New Functionality

Now exercise every new function, event and parameter that V2 introduces under both normal and unusual conditions. Check that new features work correctly with old state, because older data may not match assumptions written for V2.

Run Regression Tests

Rerun the complete V1 test suite against the upgraded proxy to confirm that nothing previously working has broken. Regression failures often reveal changed defaults, renamed events or altered math that reviewers missed while reading the diff.

Run Fuzz and Invariant Tests

Fuzz tests throw random inputs at V2, while invariant tests confirm rules like total supply always matching balances. You can go deeper on both techniques through these smart contract testing practices before deployment for production teams.

Test Upgrade Authorization

Confirm that only the intended multisig, timelock or role can upgrade, and that every other account gets rejected. Also test that V2 still contains working upgrade logic, especially with UUPS, so future upgrades remain possible.

Test Initialization and Reinitialization

Check that initialize cannot run again and that any reinitializer executes exactly once with the expected values. Try calling setup functions from random accounts too, since leftover open initializers are a common and serious audit finding.

Simulate the Production Upgrade Transaction

Before signing, simulate the exact multisig or governance transaction using tools such as Tenderly or a mainnet fork. Confirm that the target proxy, new implementation address and calldata all match the reviewed and approved plan exactly.

Safe Smart Contract Upgrade Workflow

The flow below turns everything above into one repeatable release process your team can follow every single time. It fits naturally inside the wider journey from idea to mainnet for smart contracts, covering planning, building and deployment.

smart contract upgradeability

When Should You Use an Upgradeable Smart Contract?

Upgradeability usually makes sense for systems that must keep evolving or respond quickly when new threats appear.

  • DeFi protocols: Long-lived lending, trading and staking systems often need security patches and new features over many years.
  • Tokenized assets: RWA tokenization platforms must follow changing regulations, so their compliance logic usually needs room to change safely.
  • Evolving apps: Products that are still finding their market benefit from shipping improvements without forcing users to migrate.
  • Complex protocols: Large systems with many moving parts carry more bug risk, so a controlled fix path adds real value.

When Should You Prefer an Immutable Contract?

An immutable contract can be the better choice when the rules are unlikely to change and minimizing administrative control matters more than future flexibility.

  • Stable logic: Small contracts with simple, well-tested behavior rarely need changes after their initial launch on mainnet.
  • Minimal trust: Users of some protocols want strong guarantees that nobody can ever alter the rules they agreed to.
  • No admin: Some products must prove that no administrator, team or key holder can ever change contract behavior.
  • Added risk: When upgrade machinery adds more attack surface than it removes, keeping the contract immutable is the safer path.

Upgradeable Smart Contract Checklist

Run through these five areas before every release to confirm that nothing important has slipped through review.

  • Architecture: The proxy pattern was chosen on purpose, upgrade authority is documented and a clear storage strategy exists.
  • Implementation: Upgrade-safe libraries are used, initializers are protected, storage layout is preserved and the implementation is locked.
  • Testing: The upgrade passed end-to-end, storage was checked, regression and authorization tests passed and fork tests ran.
  • Governance: No unnecessary single-key control remains, a multisig is configured and timelock and emergency steps are documented.
  • Deployment: The implementation is verified, the upgrade transaction is reviewed, the new address is recorded and monitoring is live.

Conclusion

Upgradeable smart contracts give long-term protocols a practical way to fix bugs, improve features, and respond to new security threats without changing the user-facing address. However, that flexibility comes with added responsibility around proxy design, storage layouts, initialization, testing, and upgrade authority. Choose the simplest proxy pattern that fits your system, preserve storage compatibility, protect upgrade permissions with appropriate governance, and test every upgrade before deployment. For broader planning, the [smart contract development process] helps connect architecture, development, testing, and deployment. 

Frequently Asked Questions

What is an upgradeable smart contract?

An upgradeable smart contract keeps a stable address and stored data while its logic can be replaced later. It usually works through a proxy that forwards calls to a separate implementation contract holding the business rules.

How does a proxy smart contract work?

A proxy smart contract stores all data and forwards every user call to an implementation contract using delegatecall. The implementation code then runs inside the proxy context, so all reads and writes affect proxy storage directly.

What is delegatecall in an upgradeable smart contract?

Delegatecall is an EVM instruction that runs another contract's code while keeping the caller's storage, balance and context. Proxies use it so implementation logic updates proxy storage, which lets the logic change while data stays.

What is the difference between UUPS and Transparent proxies?

UUPS keeps upgrade logic in the implementation, making its proxy smaller and generally cheaper to deploy. Transparent proxies keep upgrade logic in the proxy and use a separate admin layer. Both offer upgradeability, but they differ in cost, architecture and security responsibilities.

What is an ERC-1967 proxy?

An ERC-1967 proxy follows a standard that defines fixed storage slots for the implementation, admin and beacon addresses. These slots come from hashed strings, so they never collide with normal variables in the implementation contract.

Are upgradeable smart contracts safe?

Upgradeable smart contracts can be safe when built with established libraries, protected initializers and shared upgrade control. However, they add storage, initialization and governance risks, so careful testing and independent audits remain essential before every upgrade.

Can an upgradeable smart contract lose its stored data?

An upgrade does not delete stored data, because state lives in the proxy and not in the implementation. However, a bad storage layout change can make old data unreadable or wrong, which feels like losing it.

Can you add new variables to an upgradeable contract?

Yes. With traditional storage layouts, append new variables after existing ones. Storage gaps and ERC-7201 namespaced storage allow other controlled changes, but every upgrade must pass storage compatibility checks.

Should I use UUPS or Transparent proxy?

Choose UUPS when you want a smaller proxy, lower deployment costs and flexible upgrade rules. Transparent proxies are useful when you prefer separate admin controls and upgrade logic kept outside the implementation.

Can smart contracts be upgraded after deployment?

Standard smart contracts cannot change their deployed bytecode once it is published on the blockchain network. Contracts built with an upgradeable proxy from the start can switch to new logic while keeping their address and data.

Get In Touch
With us

Phone
Select Region

Let’s Build the
Future of Technology
Together

pakistan flag

Pakistan (Global Delivery Center)

Office 10, 3rd Floor, Al-Rehmat Plaza G11 Markaz, Islamabad, Pakistan


+92 (335) 5438999
america flag

United States (Regional Office)

INTERACTIVE ROBUST SOLUTIONS LLC 5900 Balcones Drive STE 100 Austin, TX, 78731, USA


+1 (737) 3326312
turkey flag

Türkiye (Regional Office)

Cumhuriyet, İncirli Dedee Cd. floor41 Şişli/İstanbul, Türkiye


+90 (531) 3193533
uae flag

UAE (Regional Office)

Al Jawhara Building 3rd Floor 301 Office 17 1A St - Al Mankhool - Dubai - United Arab Emirates


+971 55 690 2261
telegramwhatsapp