Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A minimal example showing how to deploy a simple smart contract using Hardhat scripts.
// contracts/Counter.sol
pragma solidity ^0.8.0;
contract Counter {
uint256 public count = 0
function increment() public { count += 1 }
}
// scripts/deploy.js
async function main() {
const [deployer] = await ethers.getSigners()
const Counter = await ethers.getContractFactory('Counter')
const counter = await Counter.deploy()
await counter.deployed()
console.log('Counter deployed to:', counter.address)
}
main().catch((error) => { console.error(error); process.exitCode = 1 })Hardhat is a JavaScript/TypeScript-based Ethereum development environment and framework. It enables developers to compile, deploy, test, and debug smart contracts efficiently on Ethereum and EVM-compatible networks.
Origin & Creator
Hardhat was created by Nomic Labs in 2018 to simplify Ethereum smart contract development and provide a powerful local blockchain testing environment.
Industrial Note
Hardhat is preferred for Ethereum development workflows, CI/CD smart contract testing, automated deployment, and integration with frontends or other tools like ethers.js and web3.js.