Skip to content
Request a review

HyperEVM Development · HyperEVM Basics · 2/8

Development Environment Setup

Hardhat Setup

Hardhat is a popular Ethereum development framework. The config below uses the Hardhat 2 format (Hardhat 3 uses a different config and plugin set), so pin the versions:

mkdir my-hyperevm-project && cd my-hyperevm-project
npm init -y
npm install --save-dev hardhat@^2.28 @nomicfoundation/hardhat-toolbox@^6
npx hardhat init

hardhat.config.ts

import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";

// Use a throwaway testnet key from your environment — never commit keys
const accounts = process.env.PRIVATE_KEY ? [process.env.PRIVATE_KEY] : [];

const config: HardhatUserConfig = {
  solidity: {
    version: "0.8.24",
    settings: { evmVersion: "cancun" }, // HyperEVM runs Cancun (without blobs)
  },
  networks: {
    hyperevm: {
      url: "https://rpc.hyperliquid.xyz/evm",
      chainId: 999,
      accounts,
    },
    hyperevmTestnet: {
      url: "https://rpc.hyperliquid-testnet.xyz/evm",
      chainId: 998,
      accounts,
    },
  },
};

export default config;

Foundry Setup

Foundry is a fast, portable toolkit for EVM development:

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Create project
forge init my-hyperevm-project
cd my-hyperevm-project

foundry.toml

[profile.default]
src = "src"
out = "out"
libs = ["lib"]
solc_version = "0.8.24"
evm_version = "cancun"

[rpc_endpoints]
hyperevm = "https://rpc.hyperliquid.xyz/evm"
hyperevm_testnet = "https://rpc.hyperliquid-testnet.xyz/evm"

Deploying a Contract

Deploy to testnet first (testnet HYPE for gas is available from the faucets listed in HyperEVM Tools).

With Hardhat

// scripts/deploy.ts
import { ethers } from "hardhat";

async function main() {
  const Contract = await ethers.getContractFactory("MyContract");
  const contract = await Contract.deploy();
  await contract.waitForDeployment();
  console.log("Deployed to:", await contract.getAddress());
}

main().catch(console.error);
npx hardhat run scripts/deploy.ts --network hyperevmTestnet

With Foundry

forge create src/MyContract.sol:MyContract \
  --rpc-url hyperevm_testnet \
  --private-key $PRIVATE_KEY \
  --broadcast

Large Contracts and Big Blocks

Small blocks have a 3M gas limit (as of October 2026), which many contract deployments exceed. To use 30M-gas big blocks, the deployer address sends the HyperCore action {"type": "evmUserModify", "usingBigBlocks": true} (the Python SDK has exchange.use_big_blocks(True)), deploys, then sets it back to false. The deployer must already exist as a HyperCore user, e.g. by having received USDC on HyperCore. The eth_bigBlockGasPrice RPC method returns the base fee for the next big block. See dual-block architecture.

Measured on testnet (2026-10-19, hyperevm-perp, a learning project, not audited): a deployment of about 2.8M gas, a ~14 KB contract, was refused as exceeding the block gas limit. Yet the latest block headers on mainnet and testnet both reported a 3,000,000 gas limit when read on 2026-10-20, so the limit a transaction actually meets may be lower than the header shows. Plan for big blocks once a deployment approaches 2M gas. Turn big blocks off afterwards: while they are on, every transaction from that address waits for a big block (one a minute, per the dual-block docs).

Verifying Contracts

Contract verification on HyperEVMScan (an Etherscan-family explorer, chain 999):

# Foundry (Etherscan API key in ETHERSCAN_API_KEY)
forge verify-contract <ADDRESS> src/MyContract.sol:MyContract \
  --chain 999 \
  --verifier etherscan

# Hardhat (requires the etherscan config for chain 999)
npx hardhat verify --network hyperevm <ADDRESS> <constructor-args>

Testing

Always test locally before deploying:

# Hardhat
npx hardhat test

# Foundry (faster)
forge test -vvv

Note that the read precompiles and CoreWriter are not available in a local Hardhat or Anvil node, so for integration testing with HyperCore, use the testnet deployment.