Prerequisites

  • Node.js v18+
  • A wallet with CTM for gas fees

Step 1: Create a Project

mkdir my-project && cd my-project
npx hardhat init
Select “Create a JavaScript project” when prompted.

Step 2: Configure c8ntinuum Network

Update hardhat.config.js:
require("@nomicfoundation/hardhat-toolbox");

module.exports = {
  solidity: "0.8.20",
  networks: {
    continuum: {
      url: "https://public-evm-rpc.c8ntinuum.com",
      chainId: 2184,
      accounts: [process.env.PRIVATE_KEY],
    },
  },
};

Step 3: Write Your Contract

// contracts/Counter.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

contract Counter {
    uint256 public number;

    function setNumber(uint256 newNumber) public {
        number = newNumber;
    }

    function increment() public {
        number++;
    }
}

Step 4: Write Deploy Script

// scripts/deploy.js
const hre = require("hardhat");

async function main() {
  const Counter = await hre.ethers.getContractFactory("Counter");
  const counter = await Counter.deploy();
  await counter.waitForDeployment();
  console.log("Counter deployed to:", await counter.getAddress());
}

main().catch(console.error);

Step 5: Deploy

PRIVATE_KEY=your_key npx hardhat run scripts/deploy.js --network continuum

Step 6: Verify (Optional)

See Verify with Hardhat for contract verification.