/** * Configuration Hardhat 3 — projet FGC42Forge (Tokenizer 42). * * - Compile Solidity (profils default / production). * - Tests Mocha + ethers via hardhat-toolbox-mocha-ethers. * - Déploiement testnet : réseau `bscTestnet` (BNB Smart Chain, chainId 97). * * Secrets : variables lues depuis `code/.env` (voir `.env.example`). * Ne jamais committer PRIVATE_KEY. */ import hardhatToolboxMochaEthersPlugin from "@nomicfoundation/hardhat-toolbox-mocha-ethers"; import { configVariable, defineConfig } from "hardhat/config"; // Charge BSC_TESTNET_RPC et PRIVATE_KEY depuis le fichier .env local. import "dotenv/config"; export default defineConfig({ plugins: [hardhatToolboxMochaEthersPlugin], solidity: { // Deux profils : dev (default) et production (optimizer activé — proche du deploy Ignition). profiles: { default: { version: "0.8.34", }, production: { version: "0.8.34", settings: { optimizer: { enabled: true, runs: 200, }, }, }, }, }, networks: { // Chaînes simulées locales (template Hardhat 3 — utiles pour tests génériques). hardhatMainnet: { type: "edr-simulated", chainType: "l1", }, hardhatOp: { type: "edr-simulated", chainType: "op", }, // Réseau public de test — déploiement réel du token (gas en tBNB). // Usage : npx hardhat ignition deploy --network bscTestnet ignition/modules/FGC42Forge.ts bscTestnet: { type: "http", chainType: "l1", url: configVariable("BSC_TESTNET_RPC"), accounts: [configVariable("PRIVATE_KEY")], }, }, });