Skip to main content
This walks through deploying a standard ERC-20 token to Hedera testnet using Hardhat. The contract uses OpenZeppelin’s audited ERC-20 base, so most of the code is library calls. The workflow is the same one you’d use on any EVM chain; the only Hedera-specific bit is the network config.
Run in your browser: Skip local setup and try the same example in the Contract Builder: compile, deploy, and mint from your browser in seconds.

Prerequisites

MetaMask configured for Hedera Testnet

Network Name Hedera Testnet, RPC https://testnet.hashio.io/api, Chain ID 296.

Testnet HBAR in your wallet

Around 5 HBAR is plenty to cover deployment.
You also need Node.js 18 or later installed locally.

Step 1: Scaffold the project

Step 2: Write the ERC-20 contract

Create contracts/MyToken.sol:
The contract inherits OpenZeppelin’s ERC20 and Ownable, mints the initial 1,000,000 supply to the deployer in the constructor, and exposes a mint() function gated by onlyOwner for later minting.

Step 3: Configure Hardhat for Hedera testnet

Create a .env file (and add it to .gitignore):
Use a dedicated dev wallet. Don’t put a mainnet private key in a .env file you’re experimenting with. To get the testnet key from MetaMask: Account → ⋮ → Account details → Show private key.
Replace hardhat.config.js with:

Step 4: Write the deploy script

Create scripts/deploy.js:

Step 5: Deploy

Expected output:
That balance figure is 1,000,000 × 10^18, which is your million tokens with 18 decimals.

Step 6: Verify on HashScan

Open https://hashscan.io/testnet/contract/<your-deployed-address>. HashScan picks the contract up automatically and shows its bytecode, the deployer account, and the deploy transaction. For source-code-level visibility, follow the contract verification guide.

Step 7: Add the token to MetaMask

In MetaMask: Tokens tab → Import tokens, paste your contract address. Symbol and decimals are auto-filled from the contract. You should now see your full supply in the wallet.

What’s next

The token works with any ERC-20-aware tool: DEX listings, wallet imports, indexers, block explorers.

HTS from Solidity

The Hedera-native alternative: create an HTS token with built-in compliance keys (KYC, freeze, pause, wipe) enforced by the network.