mirror of
https://github.com/luxfhe/example-poker.git
synced 2026-10-30 18:13:22 +00:00
72 lines
1.8 KiB
TypeScript
72 lines
1.8 KiB
TypeScript
import "@nomicfoundation/hardhat-chai-matchers";
|
|
import "@nomicfoundation/hardhat-ethers";
|
|
import "@nomicfoundation/hardhat-toolbox";
|
|
import "@nomicfoundation/hardhat-verify";
|
|
import "@typechain/hardhat";
|
|
import { config as dotenvConfig } from "dotenv";
|
|
import "@luxfhe/hardhat-docker";
|
|
import "@luxfhe/hardhat-plugin";
|
|
import "@luxfhe/hardhat-network";
|
|
import "hardhat-deploy";
|
|
import "hardhat-deploy-ethers";
|
|
import "hardhat-gas-reporter";
|
|
import { HardhatUserConfig } from "hardhat/config";
|
|
import "solidity-coverage";
|
|
import "./tasks";
|
|
|
|
dotenvConfig();
|
|
|
|
const TESTNET_CHAIN_ID = 42069;
|
|
const TESTNET_RPC_URL = "https://api.testnet.luxfhe.zone:7747";
|
|
|
|
// @todo: Set proper type for the network config.
|
|
const testnetConfig: any = {
|
|
chainId: TESTNET_CHAIN_ID,
|
|
url: TESTNET_RPC_URL,
|
|
};
|
|
|
|
// Select either private keys or mnemonic from .env file or environment variables
|
|
const deployerPrivateKey = process.env.DEPLOYER_PRIVATE_KEY;
|
|
if (!deployerPrivateKey) {
|
|
const mnemonic = process.env.DEPLOYER_MNEMONIC;
|
|
if (!mnemonic) {
|
|
throw new Error("No mnemonic or private key provided, please set MNEMONIC or KEY in your .env file");
|
|
}
|
|
testnetConfig.accounts = {
|
|
count: 10,
|
|
mnemonic,
|
|
path: "m/44'/60'/0'/0",
|
|
};
|
|
} else {
|
|
testnetConfig.accounts = [deployerPrivateKey];
|
|
}
|
|
|
|
const config: HardhatUserConfig = {
|
|
solidity: {
|
|
version: "0.8.20",
|
|
settings: {
|
|
optimizer: {
|
|
enabled: true,
|
|
// https://docs.soliditylang.org/en/latest/using-the-compiler.html#optimizer-options
|
|
runs: 200,
|
|
},
|
|
},
|
|
},
|
|
defaultNetwork: "hardhat",
|
|
namedAccounts: {
|
|
deployer: {
|
|
// By default, it will take the first Hardhat account as the deployer
|
|
default: 0,
|
|
},
|
|
},
|
|
networks: {
|
|
testnet: testnetConfig,
|
|
},
|
|
typechain: {
|
|
outDir: "types",
|
|
target: "ethers-v6",
|
|
},
|
|
};
|
|
|
|
export default config;
|