require("@nomicfoundation/hardhat-toolbox"); require("dotenv").config(); function resolveAccounts() { const rawPrivateKey = (process.env.PRIVATE_KEY || "").trim(); if (!rawPrivateKey) return []; const normalizedPrivateKey = rawPrivateKey.startsWith("0x") ? rawPrivateKey : `0x${rawPrivateKey}`; if (/^0x[0-9a-fA-F]{64}$/.test(normalizedPrivateKey)) return [normalizedPrivateKey]; return []; } const sharedAccounts = resolveAccounts(); const devAccount = "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; /** Minimal Hardhat config — Z Chain deploy only (avoids full monorepo compile). */ module.exports = { solidity: { compilers: [ { version: "0.8.20", settings: { optimizer: { enabled: true, runs: 200 } } }, { version: "0.8.19", settings: { optimizer: { enabled: true, runs: 200 } } }, ], }, networks: { hardhat: { chainId: process.env.Z_CHAIN_LOCAL === "1" ? 900002 : 31337, }, zchain: { url: process.env.CHAIN_900002_RPC_URL || "http://127.0.0.1:8546", accounts: sharedAccounts.length ? sharedAccounts : [devAccount], chainId: 900002, }, }, paths: { sources: "./contracts/z-chain", tests: "./test/z-chain", cache: "./cache/zchain", artifacts: "./artifacts/zchain", }, };