Skip to content

Add Hardhat Upgrades docs for Hardhat 3 - #147

Merged
ericglau merged 14 commits into
OpenZeppelin:mainfrom
ericglau:hardhat3
Jun 3, 2026
Merged

Add Hardhat Upgrades docs for Hardhat 3#147
ericglau merged 14 commits into
OpenZeppelin:mainfrom
ericglau:hardhat3

Conversation

@ericglau

@ericglau ericglau commented Apr 22, 2026

Copy link
Copy Markdown
Member

Summary

Adds Hardhat 3 documentation for the Hardhat Upgrades plugin (@openzeppelin/hardhat-upgrades 4.0.0, to be released). The existing Hardhat 2 docs are preserved as legacy under /upgrades-plugins/hardhat-2/* with an "Outdated Version" banner. Pre-existing URLs (/upgrades-plugins/hardhat-upgrades, /upgrades-plugins/api-hardhat-upgrades) remain live and now describe Hardhat 3 — no redirects. Also adds a migration guide to /upgrades-plugins/migrate-from-hardhat-2 and adds nav entries.

Type of Change

  • New documentation
  • Documentation update/revision
  • Restructure/reorganize content
  • Update API documentation

Related Issues

OpenZeppelin/openzeppelin-upgrades#1191
OpenZeppelin/openzeppelin-upgrades#1241
OpenZeppelin/openzeppelin-foundry-upgrades#121

Checklist

Additional Notes

  • Only the Hardhat-specific pages are versioned to support both Hardhat 3 and 2. Other pages in the Upgrades section (e.g. Foundry and core) remain unversioned since the latest versions of those are intended to remain backwards compatible.

@ericglau ericglau changed the title Hardhat3 Add Hardhat Upgrades docs for Hardhat 3 Apr 22, 2026
@ericglau
ericglau marked this pull request as ready for review April 23, 2026 20:30
@OpenZeppelin OpenZeppelin deleted a comment from netlify Bot Apr 23, 2026
@ericglau
ericglau requested a review from a team April 24, 2026 18:05
@ericglau

ericglau commented May 8, 2026

Copy link
Copy Markdown
Member Author

Hardhat 3 documentation structure and coverage

This PR updates the Upgrades Plugins docs for the Hardhat 3 release.

The documentation is organized around three user paths:

  1. New Hardhat 3 users land on the current Hardhat Upgrades pages:

    • Using with Hardhat
    • OpenZeppelin Hardhat Upgrades API
  2. Existing Hardhat 2 users get a dedicated migration path:

    • Migrating from Hardhat 2
    • the previous release's Hardhat 2 usage/API pages under hardhat-2/
  3. Users writing Solidity tests in Hardhat 3 get a section explaining the @openzeppelin/foundry-upgrades integration, including the required FOUNDRY_OUT, npmFilesToBuild, FFI, and filesystem-permission setup.

Coverage goals

The main goal is to make the Hardhat 3 path feel like the default path for new users, while keeping the Hardhat 2 path easy to find for existing projects. The current pages explain the new Hardhat 3 setup model: explicit plugin registration, creating an upgradesApi or defenderApi object to access the Upgrades API functions, and sharing a Hardhat network connection across related operations.

The migration guide is meant to be practical rather than exhaustive: it highlights the user-visible breaking changes and gives before/after examples for config, imports, scripts, tasks, tests, and source code verification. The Solidity-test section is included as an optional path for users who want to use Hardhat 3 Solidity tests with @openzeppelin/foundry-upgrades, without making it look required for normal Hardhat Upgrades usage.

Defender documentation remains in place, with Hardhat 3 users directed back to the new factory/connection pattern where needed.

Assumptions to sanity-check

  1. The split between current Hardhat 3 pages, archived Hardhat 2 pages, and a dedicated migration guide is the right layout.
  2. The migration guide covers the main user-visible breaking changes: ESM/config plugin registration, explicit factory imports, async API creation, shared network connections, and peer dependency changes.
  3. The Solidity-test section includes the right amount of setup detail without making Solidity tests look required for normal Hardhat Upgrades usage.
  4. The docs make it clear enough that Hardhat 2 users should stay on the previous release's Hardhat 2 docs, while new Hardhat 3 users should follow the current pages.
  5. There are no missing user-facing concepts that should block the Hardhat 3 full release.

Relevant files:

  • content/upgrades-plugins/hardhat-upgrades.mdx
  • content/upgrades-plugins/api-hardhat-upgrades.mdx
  • content/upgrades-plugins/migrate-from-hardhat-2.mdx
  • content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx
  • content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx
  • content/upgrades-plugins/defender-deploy.mdx
  • src/navigation/ethereum-evm.json

@ericglau
ericglau requested review from a team and stevep0z as code owners May 26, 2026 21:02
@netlify

netlify Bot commented May 26, 2026

Copy link
Copy Markdown

Deploy Preview for openzeppelin-docs-v2 ready!

Name Link
🔨 Latest commit 13eb8f7
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/6a1838bd51f09a0008ce1f0a
😎 Deploy Preview https://deploy-preview-147--openzeppelin-docs-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@stevep0z stevep0z left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Nice work on all of this @ericglau and team.

@ericglau
ericglau merged commit 670a0a0 into OpenZeppelin:main Jun 3, 2026
5 checks passed
@ericglau
ericglau deleted the hardhat3 branch June 3, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants