From 01f7bde0dcb469cdbd8c9d4eabe3abdbab139c93 Mon Sep 17 00:00:00 2001 From: Eric Lau Date: Wed, 10 Jun 2026 15:32:53 -0400 Subject: [PATCH] Clarify Hardhat 3 ethers vs viem requirements --- content/upgrades-plugins/hardhat-upgrades.mdx | 2 +- content/upgrades-plugins/migrate-from-hardhat-2.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/upgrades-plugins/hardhat-upgrades.mdx b/content/upgrades-plugins/hardhat-upgrades.mdx index 9ecdbc89..1c044b26 100644 --- a/content/upgrades-plugins/hardhat-upgrades.mdx +++ b/content/upgrades-plugins/hardhat-upgrades.mdx @@ -20,7 +20,7 @@ $ npm install --save-dev @nomicfoundation/hardhat-ethers ethers # peer dependenc ``` -Hardhat 3 supports both ethers and viem. This plugin uses `@nomicfoundation/hardhat-ethers` internally and loads it automatically. If your project uses viem, install `@nomicfoundation/hardhat-viem` and add it to your config alongside this plugin. +Hardhat 3 supports both ethers and viem. This plugin uses `@nomicfoundation/hardhat-ethers` internally and loads it automatically. If your project uses viem, install `@nomicfoundation/hardhat-viem` and add it to your config alongside this plugin: your own scripts and tests can use viem, while the plugin's functions take ethers contract factories from `connection.ethers` and return ethers contracts. Register the `@openzeppelin/hardhat-upgrades` plugin in your [`hardhat.config.ts`](https://hardhat.org/config/): diff --git a/content/upgrades-plugins/migrate-from-hardhat-2.mdx b/content/upgrades-plugins/migrate-from-hardhat-2.mdx index 01aea1e8..ebfde92d 100644 --- a/content/upgrades-plugins/migrate-from-hardhat-2.mdx +++ b/content/upgrades-plugins/migrate-from-hardhat-2.mdx @@ -22,7 +22,7 @@ npm install --save-dev hardhat @nomicfoundation/hardhat-ethers ``` -**Using viem?** You can install both `@nomicfoundation/hardhat-ethers` and `@nomicfoundation/hardhat-viem`. The upgrades plugin uses ethers internally; your own scripts and tests can still use viem. +**Using viem?** You can install both `@nomicfoundation/hardhat-ethers` and `@nomicfoundation/hardhat-viem`. The upgrades plugin uses ethers internally; your own scripts and tests can still use viem. Note that the plugin's functions take ethers contract factories and return ethers contracts, so use `connection.ethers` when calling them. ## Migration