Skip to main content
This page shows how to deploy and verify a contract on Whitechain Sepolia using Hardhat. Whitechain Sepolia is a standard EVM network, so you add it by chain ID and RPC URL. Hardhat needs no Whitechain-specific plugin. It is for developers who work from the command line.
Hardhat publishes its own Agent Skill for AI coding assistants. Install it with npx skills add nomicfoundation/hardhat-skills for AI-guided help with Hardhat 3 workflows and migrations. Pair it with the whitechain-dev skill for the Whitechain-specific steps below.

Before you deploy

  • Node.js 22 or later and npm. Hardhat 3 requires Node.js 22 or newer.
  • A funded testnet account. Claim test WBT from the faucet.
  • The private key for that account. Use a throwaway key for testing.

1. Create a project

When prompted:

2. Set environment variables

Create a .env file:
The key must include the 0x prefix. Hardhat rejects the network configuration without it. Add .env to .gitignore so you do not commit the key.
Never commit a private key, and never reuse a mainnet key for testing. Anyone with the key controls the funds.

3. Configure the network

Replace the contents of hardhat.config.ts with:

4. Add a contract

Create contracts/Storage.sol.

5. Add a deploy script

Create scripts/deploy.ts.
network.create("whitechainSepolia") opens a connection to the network defined in hardhat.config.ts. Passing the name makes the script explicit; network.create() with no argument uses whatever --network selects. Do not use network.connect(), which is deprecated in Hardhat 3 and will be removed. Hardhat 3 uses ESM with top-level await, so no main() wrapper is needed.

6. Deploy the contract

The contract address prints to the console. Copy it for verification.

7. Verify the contract

Storage takes no constructor arguments, so pass only the address.
For a contract with constructor arguments, add them after the address.

Verify the result

Open the contract address on the explorer. The Contract tab shows the source code and a verified marker. The same submission also lands on Sourcify, because both verifiers are enabled in the config above.