ekx-hardhatlisted
Install: claude install-skill Ekinoxis-evm/claude-skills
# Hardhat
Used in the two older contract repos, and alongside Foundry elsewhere for
scripting and verification.
**For new contract repos, prefer Foundry** — see [`../ekx-foundry/SKILL.md`](../ekx-foundry/SKILL.md).
Hardhat stays where it already is, and where we need its JS ecosystem
(Ignition, TypeChain typings consumed directly by a Next.js frontend).
Docs: https://hardhat.org/docs
---
## Config
A config trimmed to the shape we use:
```ts
import { HardhatUserConfig } from "hardhat/config";
import "@nomicfoundation/hardhat-toolbox";
const config: HardhatUserConfig = {
solidity: {
version: "0.8.24",
settings: { optimizer: { enabled: true, runs: 200 } },
},
networks: {
base: { url: process.env.BASE_MAINNET_RPC_URL || "https://mainnet.base.org", chainId: 8453, accounts: [process.env.DEPLOYER_PRIVATE_KEY!] },
baseSepolia: { url: process.env.BASE_SEPOLIA_RPC_URL || "https://sepolia.base.org", chainId: 84532, accounts: [process.env.DEPLOYER_PRIVATE_KEY!] },
localhost: { url: "http://127.0.0.1:8545", chainId: 1337 },
},
etherscan: { apiKey: { base: process.env.BASESCAN_API_KEY!, baseSepolia: process.env.BASESCAN_API_KEY! } },
gasReporter: { enabled: process.env.REPORT_GAS === "true", currency: "USD" },
};
export default config;
```
Guard the `accounts` array — `[undefined!]` crashes the whole config load, so every
command fails even ones that need no key. Prefer
`accounts: process.env.DEPLOYER_PRIVATE_KEY ? [process.env.DEPLOYER_PR