Quickstart with Hardhat
Configure Hardhat for Zroarus Testnet and deploy a contract.
TestnetVerified Sep 27, 2026
Set up#
Create a Hardhat project following the official guide(opens in a new tab) (TypeScript template with the toolbox), then fund a test-only wallet from the faucet(opens in a new tab).
Configure#
Add the Testnet as a network and set evmVersion: "cancun". The key is read from the environment, with no fallback.
import type { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const key = process.env.ZROARUS_TESTNET_KEY; // set in your shell, never committed
const config: HardhatUserConfig = {
solidity: {
version: "0.8.28",
settings: { evmVersion: "cancun", optimizer: { enabled: true, runs: 200 } },
},
networks: {
zroarusTestnet: {
url: "https://rpc.testnet.zroarus.com",
chainId: 305583,
accounts: key ? [key] : [],
},
},
};
export default config;Deploy#
import { ethers } from "hardhat";
async function main() {
const counter = await ethers.deployContract("Counter");
await counter.waitForDeployment();
console.log("Counter deployed to", await counter.getAddress());
}
main().catch((err) => { console.error(err); process.exitCode = 1; });read -rs ZROARUS_TESTNET_KEY && export ZROARUS_TESTNET_KEY
npx hardhat run scripts/deploy.ts --network zroarusTestnet
unset ZROARUS_TESTNET_KEYLook the address up on the explorer(opens in a new tab). To publish the source, see Contract verification.
Something wrong or missing on this page? Send developer feedback.