mirror of
https://github.com/luxfhe/example-erc20-tutorial.git
synced 2026-10-30 18:13:26 +00:00
60 lines
1.3 KiB
TypeScript
60 lines
1.3 KiB
TypeScript
// Plugins
|
|
import "@nomicfoundation/hardhat-toolbox";
|
|
import {config as dotenvConfig} from "dotenv";
|
|
import "hardhat-deploy";
|
|
import {HardhatUserConfig} from "hardhat/config";
|
|
import {resolve} from "path";
|
|
|
|
// DOTENV_CONFIG_PATH is used to specify the path to the .env file for example in the CI
|
|
const dotenvConfigPath: string = process.env.DOTENV_CONFIG_PATH || "./.env";
|
|
dotenvConfig({ path: resolve(__dirname, dotenvConfigPath) });
|
|
|
|
const TESTNET_CHAIN_ID = 8008135;
|
|
const TESTNET_RPC_URL = "https://api.helium.luxfhe.zone";
|
|
|
|
const testnetConfig: any = {
|
|
chainId: TESTNET_CHAIN_ID,
|
|
url: TESTNET_RPC_URL,
|
|
}
|
|
|
|
|
|
// Select either private keys or mnemonic from .env file or environment variables
|
|
const keys = process.env.KEY;
|
|
if (!keys) {
|
|
let mnemonic = process.env.MNEMONIC;
|
|
if (mnemonic) {
|
|
testnetConfig['accounts'] = {
|
|
count: 10,
|
|
mnemonic,
|
|
path: "m/44'/60'/0'/0",
|
|
}
|
|
}
|
|
} else {
|
|
testnetConfig['accounts'] = [keys];
|
|
}
|
|
|
|
|
|
const config: HardhatUserConfig = {
|
|
solidity: {
|
|
version: "0.8.27",
|
|
settings: {
|
|
evmVersion: "cancun",
|
|
optimizer: {
|
|
enabled: true,
|
|
runs: 200
|
|
}
|
|
}
|
|
},
|
|
defaultNetwork: "hardhat",
|
|
networks: {
|
|
hardhat: {},
|
|
testnet: testnetConfig,
|
|
},
|
|
typechain: {
|
|
outDir: "types",
|
|
target: "ethers-v6",
|
|
},
|
|
};
|
|
|
|
export default config;
|