upgrade-solidity-contracts

Upgrade Solidity smart contracts using OpenZeppelin proxy patterns.

Updated Oct 17, 2025
One-click install
npx skills add https://github.com/iamcapote/emptyrepo --skill upgrade-solidity-contracts-iamcapote
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: upgrade-solidity-contracts
Source: https://github.com/iamcapote/emptyrepo/tree/main/skills/allied/openzeppelin-skills/skills/upgrade-solidity-contracts
Command: npx skills add https://github.com/iamcapote/emptyrepo --skill upgrade-solidity-contracts-iamcapote

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Upgrading Solidity contracts can be error-prone without guidance on proxy patterns, storage layouts, and initializer usage; this Skill consolidates best practices for safe upgrades using OpenZeppelin's proxy architectures.

Core Features & Use Cases

  • Upgradeable via UUPS, Transparent, or Beacon proxies: enable flexible upgradeability across contract deployments.
  • Initializer pattern adoption: replace constructors with initializer functions to support proxy-based deployment.
  • Tooling and workflow integration: leverages Hardhat and Foundry upgrade plugins to validate and deploy upgrades.
  • Storage layout & ERC-7201 awareness: applies namespace-based storage layouts to preserve state across upgrades.
  • Upgrade safety validation: enforces checks to prevent unsafe upgrades and ensure compatibility.

Quick Start

Use this Skill to guide upgrading a Solidity contract by applying OpenZeppelin upgradeable patterns to your project.

Frequently Asked Questions about upgrade-solidity-contracts

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade Solidity contracts safely using OpenZeppelin proxies?

To upgrade Solidity contracts safely, apply OpenZeppelin proxy patterns like UUPS, Transparent, or Beacon proxies. This approach replaces constructors with initializers and enforces storage layout compatibility to preserve state across upgrades.

What is the difference between UUPS and Transparent proxy patterns for Solidity?

UUPS and Transparent proxies are OpenZeppelin patterns for Solidity upgradeability. UUPS places upgrade logic in the implementation contract, while Transparent proxies keep logic in the proxy contract, affecting gas costs and upgrade safety validation.

How do I handle storage layout when upgrading Solidity smart contracts?

Handling storage layout during Solidity upgrades requires applying namespace-based storage patterns like ERC-7201. This prevents new state variables from corrupting existing slots and maintains storage compatibility across proxy upgrades.

Does this OpenZeppelin upgrade pattern work with both Hardhat and Foundry?

Yes, OpenZeppelin upgrade patterns integrate with both Hardhat and Foundry workflows. The tooling leverages their respective upgrade plugins to validate storage compatibility and safely deploy proxy-based contract upgrades.

Why do constructors need to be replaced with initializers in upgradeable Solidity contracts?

Constructors must be replaced with initializer functions in upgradeable Solidity contracts because proxy patterns bypass constructor logic during deployment. Initializers ensure setup logic executes correctly when the proxy is initialized.

What are the limitations of using proxy patterns for Solidity contract upgrades?

Limitations of Solidity proxy patterns include strict storage layout constraints requiring namespace handling and the risk of unsafe upgrades. Upgrade safety validation is mandatory to prevent state corruption and enforce upgrade-restriction awareness.