# Step-by-Step Guide: Deploy Your Smart Contract on Nero Chain Testnet Using Hardhat

By [Navadi](https://paragraph.com/@navadi) · 2025-04-18

---

**Introduction**

Hardhat is a powerful development environment that simplifies the creation, testing, deployment, and verification of smart contracts. This guide will walk you through deploying a smart contract specifically on the Nero Chain Testnet.

### What You'll Need

*   Node.js installed ([Download Node.js](https://nodejs.org))
    
*   Your wallet's private key (for testnet)
    
*   An API key from Neroscan ([Get here](https://testnet.neroscan.io/))
    
*   Nero Chain Testnet tokens ([Request from faucet](https://app.testnet.nerochain.io/faucet))
    

### Step 1: Project Initialization

Create a fresh directory for your smart contract and start your project:

    mkdir NeroContract
    cd NeroContract
    npm init -y
    

### Step 2: Install and Setup Hardhat

Install Hardhat and its necessary tools:

    npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox @nomicfoundation/hardhat-ignition-ethers
    

Then initialize Hardhat:

Choose the option "Create a JavaScript project" and complete the setup.

### Step 3: Smart Contract Creation

You can write your own Solidity contract or quickly start using OpenZeppelin’s template for ERC-20 tokens:

*   [ERC-20 Template](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol)
    

Save your contract file inside the `contracts` folder created by Hardhat.

### Step 4: Configure Hardhat for Nero Chain

Create `.env` file in the root directory:

    NERO_TESTNET_PROVIDER_URL=https://rpc-testnet.nerochain.io
    PRIVATE_KEY=<your_private_key>
    API_KEY=<your_neroscan_api_key>
    

Now configure `hardhat.config.js`:

    require("@nomicfoundation/hardhat-toolbox");
    require("@nomicfoundation/hardhat-ignition-ethers");
    require('dotenv').config();
    
    module.exports = {
      solidity: "0.8.24",
      defaultNetwork: "nero_testnet",
      networks: {
        nero_testnet: {
          url: process.env.NERO_TESTNET_PROVIDER_URL,
          accounts: [process.env.PRIVATE_KEY]
        }
      },
      etherscan: {
        apiKey: process.env.API_KEY,
        customChains: [
          {
            network: "nero_testnet",
            chainId: 689,
            urls: {
              apiURL: "https://api-testnet.neroscan.io/api",
              browserURL: "https://testnet.neroscan.io"
            }
          }
        ],
        enabled: true
      }
    };
    

### Step 5: Compile and Deploy

First, compile your smart contract:

    npx hardhat compile
    

Deploy using Hardhat Ignition:

    npx hardhat ignition deploy ./ignition/modules/YourDeployScript.js --network nero_testnet
    

Ensure you replace `YourDeployScript.js` with your actual deploy script filename.

### Step 6: Verify Deployment

Check your smart contract deployment on the [Nero Testnet Explorer](https://testnet.neroscan.io/).

![](https://storage.googleapis.com/papyrus_images/0c4b2d0a901ff5db67aeecef5714f1c5095cb689aa113f061e84bf9155eeb7d2.png)

### Congratulations!

You've successfully created, deployed, and verified your smart contract on the Nero Chain Testnet. You're now ready to explore further possibilities with Hardhat and Nero Chain's robust environment.

### What's Next?

Explore deployment to Nero Mainnet by adjusting configurations accordingly, and continue building secure and innovative blockchain applications.

**Check out Nero Chain at** [**Website**](https://nerochain.io/) **|** [**Twitter**](https://x.com/Nerochain_io) **|** [**Discord**](https://discord.com/invite/nerochainofficial) **|**

---

*Originally published on [Navadi](https://paragraph.com/@navadi/step-by-step-guide-deploy-your-smart-contract-on-nero-chain-testnet-using-hardhat)*
