Skip to content

Conversation

@themacexpert
Copy link
Contributor

Description

As part of the Moonbeam Docs overhaul, we are keeping the Hardhat page so it needed a few updates (in addition to what's here: #1289

This pull request updates the Hardhat documentation and code snippets to reflect best practices and compatibility with Hardhat 3 (current release: 3.0.17), Node.js 22, and modern ESM-based configuration. The changes clarify setup instructions, update code samples to match the latest Hardhat conventions, and improve security and usability by highlighting the encrypted secrets manager and plugin usage.

Hardhat 3 and Node.js 22 updates:

  • The guide now targets Hardhat 3 (v3.0.17) and requires Node.js 22.10.0 or later, emphasizing that only even-numbered LTS versions are supported. [1] [2] [3]
  • All code snippets and instructions have been updated to use ESM syntax (import/export default) and modern Hardhat configuration practices. [1] [2] [3] [4]

Project setup and configuration improvements:

  • Installation commands now use npm install --save-dev hardhat and npx hardhat init for project initialization, matching Hardhat 3 conventions.
  • The configuration file instructions now reflect ESM-first usage, plugin installation, and the encrypted secrets manager via @nomicfoundation/hardhat-keystore. [1] [2]
  • Network configuration examples use type: "http" and chainType: "l1" for Moonbeam networks, and secrets are referenced via configVariable.

Security and usability enhancements:

  • The documentation highlights the use of Hardhat's encrypted secrets manager and provides warnings about limitations in the Hardhat console task regarding secret prompts. [1] [2]
  • Users are instructed to use environment variables for secrets when running interactive tasks.

Code and snippet corrections:

  • All references to the config file now use "your Hardhat config file" instead of hardhat.config.js, supporting both JS and TS templates. [1] [2] F144d007L362R375, [3]
  • Deployment and interaction scripts have been updated for Hardhat 3, including correct file paths and ESM syntax. [1] [2] [3] [4]

Terminal output and snippet updates:

  • Terminal snippets now show updated Node.js and Hardhat versions, and reflect the correct output for compilation and deployment. [1] [2] [3] [4]

Hardhat 3 and Node.js 22 updates

  • Documentation now targets Hardhat 3 (v3.0.17) and Node.js 22.10.0+, updating all related instructions and terminal outputs. [1] [2] [3]

Project setup and configuration

  • Updated setup commands to use npm install --save-dev hardhat and npx hardhat init, and clarified prompts for Hardhat 3 Beta. [1] [2]
  • Configuration file examples now use ESM syntax, plugin imports, and the encrypted secrets manager (@nomicfoundation/hardhat-keystore). [1] [2]

Security and usability

  • Added documentation and warnings for using the encrypted secrets manager and environment variables, especially with the Hardhat console task. [1] [2]

Code and snippet corrections

  • All references to the config file are now generic ("your Hardhat config file"), and deployment/interact scripts use updated paths and ESM syntax. [1] [2] [3] [4] [5]

Terminal and output updates

  • Terminal snippets reflect updated Node.js and Hardhat versions, and show correct output for compilation and deployment steps. [1] [2] [3]

Checklist

  • Added a label 🏷️ to this PR
  • Ran my changes through Grammarly
  • Added a disclaimer if required
  • If pages were moved, opened a corresponding PR in moonbeam-mkdocs to update redirects

Translations

Does this PR update a page that also exists on the Chinese docs site? See mapping to confirm.

  • Yes
  • No

If Yes, complete the following:

  • Opened a PR on the Chinese docs repo for the corresponding page
  • Updated images, snippets, or variables if they were moved, renamed, or deleted

Link to the corresponding CN docs PR: <INSERT_LINK>

@themacexpert themacexpert requested a review from a team as a code owner December 3, 2025 19:58
Copilot AI review requested due to automatic review settings December 3, 2025 19:58
@themacexpert themacexpert added the A1 - Maintenance Major Pull request contains major updates to an existing page (i.e., adding a new section, reorgs, etc.) label Dec 3, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request comprehensively updates the Hardhat documentation to support Hardhat 3 (v3.0.17) and Node.js 22.10.0+, transitioning from CommonJS to ESM syntax and modernizing the development workflow. The changes ensure developers can follow current best practices with the latest versions of these tools while deploying smart contracts to Moonbeam networks.

Key changes:

  • Updates all references from Hardhat 2 to Hardhat 3 (v3.0.17) and Node.js from v20 to v22.10.0+
  • Migrates all code examples from CommonJS (require/module.exports) to ESM syntax (import/export default)
  • Introduces the @nomicfoundation/hardhat-keystore plugin for encrypted secrets management
  • Updates network configuration to use chainType: "l1" instead of "generic" for Moonbeam networks
  • Removes obsolete manual Hardhat patching instructions (fix now included in Hardhat 3)

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
builders/ethereum/dev-env/hardhat.md Main documentation file updated with Hardhat 3 syntax, keystore usage, and correct deployment paths
llms-full.txt Consolidated LLM training data updated with all Hardhat 3 changes
llms-files/llms-ethereum-toolkit.txt Ethereum toolkit LLM data synchronized with main documentation changes
llms-files/llms-dev-environments.txt Development environments LLM data synchronized with main documentation changes
.snippets/code/builders/ethereum/dev-env/hardhat/terminal/interact.md Terminal output updated to show Node.js v22.10.0
.snippets/code/builders/ethereum/dev-env/hardhat/terminal/hardhat-create.md Terminal output updated to show Hardhat v3.0.17 welcome message
.snippets/code/builders/ethereum/dev-env/hardhat/terminal/deploy-moonbase.md Deployment command updated with correct ignition modules path
.snippets/code/builders/ethereum/dev-env/hardhat/terminal/compile.md Compilation output updated to show Hardhat 3 format with solc 0.8.28 and cancun target

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@eshaben eshaben self-assigned this Dec 4, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A1 - Maintenance Major Pull request contains major updates to an existing page (i.e., adding a new section, reorgs, etc.) B0 - Needs Review Pull request is ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants