Skip to content

docs: fix Hardhat upgrades require destructuring braces - #261

Closed
ninglinLiu wants to merge 1 commit into
OpenZeppelin:mainfrom
ninglinLiu:fix/hardhat-require-destructuring
Closed

ninglinLiu wants to merge 1 commit into
OpenZeppelin:mainfrom
ninglinLiu:fix/hardhat-require-destructuring

Conversation

@ninglinLiu

Copy link
Copy Markdown

Summary

Several Hardhat 2 / legacy upgradeable examples used invalid JavaScript:

const  ethers, upgrades  = require("hardhat");

instead of:

const { ethers, upgrades } = require("hardhat");

Fixed in:

  • content/upgrades-plugins/hardhat-2/hardhat-upgrades.mdx
  • content/upgrades-plugins/hardhat-2/api-hardhat-upgrades.mdx
  • content/upgrades-plugins/migrate-from-cli.mdx
  • content/contracts/3.x/upgradeable.mdx
  • content/contracts/4.x/upgradeable.mdx

Related issue on the legacy site tracker: OpenZeppelin/docs.openzeppelin.com#457

This PR was prepared with AI assistance and reviewed/tested by the author.

Several Hardhat 2 / legacy upgradeable examples used invalid syntax
`const  ethers, upgrades  = require("hardhat")` instead of
`const { ethers, upgrades } = require("hardhat")`.

Related: OpenZeppelin/docs.openzeppelin.com#457
@netlify

netlify Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for openzeppelin-docs-v2 ready!

Name Link
🔨 Latest commit 80096b1
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-docs-v2/deploys/6ae39a09ce495af5ec21c0be
😎 Deploy Preview https://deploy-preview-261--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.

@son-oz son-oz closed this Oct 29, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants