Files
smom-dbis-138/hardhat.config.js
zaragoza444 e35ad9047c
Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m13s
CI/CD Pipeline / Security Scanning (push) Successful in 2m30s
CI/CD Pipeline / Lint and Format (push) Failing after 45s
CI/CD Pipeline / Terraform Validation (push) Failing after 26s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 28s
Deploy ChainID 138 / Deploy ChainID 138 (push) Failing after 39s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 21s
Validation / validate-genesis (push) Successful in 30s
Validation / validate-terraform (push) Failing after 25s
Validation / validate-kubernetes (push) Failing after 13s
Validation / validate-smart-contracts (push) Failing after 16s
Validation / validate-security (push) Failing after 1m28s
Validation / validate-documentation (push) Failing after 19s
Verify Deployment / Verify Deployment (push) Failing after 53s
feat: add Z Chain 900002 ecosystem with wallet, Z Bot, and deploy scripts
Ship Z Chain slot, International Z Wallet routes, in-app Z Bot APIs, Besu bootstrap, and local/production deployment tooling for digital.omdnl.org.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-06 05:25:10 -07:00

116 lines
3.4 KiB
JavaScript

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];
}
console.warn(
"Ignoring PRIVATE_KEY in Hardhat config because it is not a valid 32-byte hex key."
);
return [];
}
const sharedAccounts = resolveAccounts();
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: {
compilers: [
{ version: "0.5.16", settings: { optimizer: { enabled: true, runs: 200 } } },
{ version: "0.6.6", settings: { optimizer: { enabled: true, runs: 200 } } },
{ version: "0.6.12", settings: { optimizer: { enabled: true, runs: 200 } } },
{ version: "0.8.20", settings: { optimizer: { enabled: true, runs: 200 }, viaIR: true } },
{ version: "0.8.22", settings: { optimizer: { enabled: true, runs: 200 }, viaIR: true } },
],
},
networks: {
hardhat: {
chainId: process.env.Z_CHAIN_LOCAL === "1" ? 900002 : 31337,
},
mainnet: {
url: process.env.ETHEREUM_MAINNET_RPC || "https://eth.llamarpc.com",
accounts: sharedAccounts,
chainId: 1,
},
chain138: {
url: process.env.CHAIN138_RPC_URL || "https://rpc.d-bis.org",
accounts: sharedAccounts,
chainId: 138,
},
sepolia: {
url: process.env.SEPOLIA_RPC_URL || "https://rpc.sepolia.org",
accounts: sharedAccounts,
chainId: 11155111,
},
bsc: {
url: process.env.BSC_MAINNET_RPC || process.env.BSC_RPC_URL || "https://bsc-dataseed.binance.org",
accounts: sharedAccounts,
chainId: 56,
},
polygon: {
url: process.env.POLYGON_MAINNET_RPC || "https://polygon-rpc.com",
accounts: sharedAccounts,
chainId: 137,
},
gnosis: {
url: process.env.GNOSIS_RPC_URL || "https://rpc.gnosischain.com",
accounts: sharedAccounts,
chainId: 100,
},
cronos: {
url: process.env.CRONOS_RPC_URL || "https://evm.cronos.org",
accounts: sharedAccounts,
chainId: 25,
},
optimism: {
url: process.env.OPTIMISM_MAINNET_RPC || "https://mainnet.optimism.io",
accounts: sharedAccounts,
chainId: 10,
},
base: {
url: process.env.BASE_MAINNET_RPC || "https://mainnet.base.org",
accounts: sharedAccounts,
chainId: 8453,
},
arbitrum: {
url: process.env.ARBITRUM_MAINNET_RPC || "https://arb1.arbitrum.io/rpc",
accounts: sharedAccounts,
chainId: 42161,
},
avalanche: {
url: process.env.AVALANCHE_RPC_URL || process.env.AVALANCHE_MAINNET_RPC || "https://api.avax.network/ext/bc/C/rpc",
accounts: sharedAccounts,
chainId: 43114,
},
zchain: {
url: process.env.CHAIN_900002_RPC_URL || "http://127.0.0.1:8546",
accounts: sharedAccounts.length
? sharedAccounts
: ["0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"],
chainId: 900002,
},
},
// Single Etherscan API key = V2 for all chains (see docs/deployment/ETHERSCAN_V2_VERIFY_OTHER_CHAINS.md)
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY || "",
},
paths: {
sources: "./contracts",
tests: "./test",
cache: "./cache",
artifacts: "./artifacts",
},
};