From f875462aafba1447e2ef4d8fbe03f8e6c899034b Mon Sep 17 00:00:00 2001 From: Miguel Angel Rojo <29736144+freemanzMrojo@users.noreply.github.com> Date: Sat, 21 Feb 2026 16:32:55 +0000 Subject: [PATCH] Refactor Hardhat config for Hiero Local Node setup Using Hardhat Toolbox aligned with the rest of the explanation (Mocha + Ethers) Signed-off-by: Miguel Angel Rojo <29736144+freemanzMrojo@users.noreply.github.com> --- ...-hiero-local-node-a-step-by-step-guide.mdx | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/hedera/tutorials/smart-contracts/configuring-hardhat-with-hiero-local-node-a-step-by-step-guide.mdx b/hedera/tutorials/smart-contracts/configuring-hardhat-with-hiero-local-node-a-step-by-step-guide.mdx index 2553f79f..1991961b 100644 --- a/hedera/tutorials/smart-contracts/configuring-hardhat-with-hiero-local-node-a-step-by-step-guide.mdx +++ b/hedera/tutorials/smart-contracts/configuring-hardhat-with-hiero-local-node-a-step-by-step-guide.mdx @@ -165,13 +165,11 @@ If you are using Testnet, for the `HEDERA_PRIVATE_KEY`, enter your testnet **HEX Now, we can update our Hardhat config file to include the Hiero Local Node as a custom network: ```typescript hardhat.config.ts -import type { HardhatUserConfig } from "hardhat/config"; +import hardhatToolboxMochaEthersPlugin from "@nomicfoundation/hardhat-toolbox-mocha-ethers"; +import { configVariable, defineConfig } from "hardhat/config"; -import hardhatToolboxViemPlugin from "@nomicfoundation/hardhat-toolbox-viem"; -import { configVariable } from "hardhat/config"; - -const config: HardhatUserConfig = { - plugins: [hardhatToolboxViemPlugin], +export default defineConfig({ + plugins: [hardhatToolboxMochaEthersPlugin], solidity: { profiles: { default: { @@ -189,11 +187,6 @@ const config: HardhatUserConfig = { }, }, networks: { - hedera: { - type: "http", - url: configVariable("HEDERA_RPC_URL"), - accounts: [configVariable("HEDERA_PRIVATE_KEY")], - }, hardhatMainnet: { type: "edr-simulated", chainType: "l1", @@ -202,10 +195,13 @@ const config: HardhatUserConfig = { type: "edr-simulated", chainType: "op", }, + hedera: { + type: "http", + url: configVariable("HEDERA_RPC_URL"), + accounts: [configVariable("HEDERA_PRIVATE_KEY")], + }, }, -}; - -export default config; +}); ``` 🔍 **Key Highlights**