npx hardhat build, deploy scripts, ethers.js, and tests all behave normally.
This page covers what is Hedera-specific. For a full local walkthrough, the Solo team maintains an end-to-end Hardhat guide.
Using Solo with EVM tools
Deploy a local Solo network, generate funded ECDSA accounts, configure
hardhat.config.ts, deploy a contract, and connect MetaMask.Pick a relay endpoint
Solo’s relay port changed in version 0.63; deployments on 0.62 and earlier use
7546. Solo also forwards to the next free port if 37546 is taken, so confirm the assignment printed at the end of your deploy. See Local Development for the current endpoint list, and the JSON-RPC relay page for third-party and self-hosted options.
Use ECDSA keys
Hedera supports both ED25519 and ECDSA (secp256k1) keys, but only ECDSA keys work over the JSON-RPC relay. An ED25519 account has no EVM address that Hardhat or ethers.js can sign for, so deployments from one fail.- Local network: Solo writes pre-funded ECDSA accounts to the
createdAccountsarray in~/.solo/one-shot-<deployment-name>/accounts.json. Each entry includes the private key (0xplus 64 hex characters), its public key, and the derived EVM address. - Testnet and mainnet: create an ECDSA account in the Hedera Portal and use its HEX Encoded Private Key, not the DER-encoded one.
Configure the network
Hardhat 3 requirestype and chainId on HTTP networks. Without both, connecting to the relay fails with HHE40000: No network with chain id "298" found. Define one network entry per target rather than swapping the URL, since chainId has to move with it:
hardhat.config.ts
--network, so npx hardhat run scripts/deploy.ts --network hederaLocal targets the local relay.
Store the private key with Hardhat’s keystore rather than committing it:
Migrating from Hardhat 2 to Hardhat 3
Migrating from Hardhat 2 to Hardhat 3
- compile → build:
npx hardhat compileis nownpx hardhat build. - project init:
npx hardhat initis nownpx hardhat --init. - keystore commands: the keystore plugin (
npx hardhat keystore set ...) is new in v3. - Solidity tests: v3 runs Foundry-compatible Solidity tests alongside TypeScript integration tests.
- Network management: v3 tasks can open and manage multiple network connections at once.
Hedera-specific gotchas
- Gas price units. The relay returns
msg.valueandgasPricewith 18 decimals, while native Hedera APIs use 8 decimals for HBAR. See HBAR decimal places. - Foundry and Hardhat print “ETH”. Tooling hardcodes the label. The currency being spent is HBAR.
- Contract verification. Sourcify supports mainnet (
295) and testnet (296). It does not support a local network, so verification has to wait until you deploy to a public network. - Token association. Transferring an HTS token to an account requires that account to be associated with the token first. See token association.
Further learning
- How to Mint and Burn an ERC-721 Token (Part 1)
Create a basic ERC-721 NFT, mint it, and burn it on Hedera. - Access Control, Token URI, Pause & Transfer (Part 2)
Extend your NFT with pausing, token URIs, and role-restricted minting. - Upgrade Your NFT with UUPS Proxies (Part 3)
Add upgradeability using OpenZeppelin’s UUPS proxy pattern.