90 lines
2.7 KiB
JavaScript
90 lines
2.7 KiB
JavaScript
require("@nomiclabs/hardhat-waffle");
|
|
require("hardhat-gas-reporter");
|
|
require("@nomiclabs/hardhat-etherscan");
|
|
require("dotenv").config();
|
|
require("solidity-coverage");
|
|
require("hardhat-deploy");
|
|
require("./tasks/block-number");
|
|
|
|
//require("@nomicfoundation/hardhat-toolbox");
|
|
//// Deprecated, below import combined in toolbox import already
|
|
//require("@nomiclabs/hardhat-ethers");
|
|
//require("@nomicfoundation/hardhat-verify");
|
|
|
|
const RPC_URL_SEPOLIA = process.env.SEPOLIA_RPC_URL || "https://eth-sepolia";
|
|
const PRIVATE_KEY_SEPOLIA = process.env.SEPOLIA_PRIVATE_KEY || "0xkey";
|
|
|
|
const RPC_URL_GANACHE = process.env.LOCAL_RPC_URL || "http://192.168.1.10:7545";
|
|
const PRIVATE_KEY_GANACHE = process.env.LOCAL_PRIVATE_KEY || "0xkey";
|
|
|
|
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY || "key";
|
|
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY || "key";
|
|
|
|
const REPORT_GAS = process.env.REPORT_GAS || "true";
|
|
const REPORT_PRICE = process.env.REPORT_PRICE || "false";
|
|
|
|
/** @type import('hardhat/config').HardhatUserConfig */
|
|
module.exports = {
|
|
defaultNetwork: "hardhat",
|
|
networks: {
|
|
sepolia: {
|
|
url: RPC_URL_SEPOLIA,
|
|
accounts: [PRIVATE_KEY_SEPOLIA],
|
|
chainId: 11155111,
|
|
blockConfirmation: 6,
|
|
},
|
|
ganache: {
|
|
url: RPC_URL_GANACHE,
|
|
accounts: [PRIVATE_KEY_GANACHE],
|
|
chainId: 5777,
|
|
blockConfirmation: 1,
|
|
},
|
|
localhost: {
|
|
// Hardhost similar like ganache, can debug the transaction
|
|
// Start in terminal - yarn hardhat node
|
|
url: "http://127.0.0.1:8545/",
|
|
chainId: 31337,
|
|
blockConfirmation: 1,
|
|
},
|
|
},
|
|
solidity: {
|
|
compilers: [
|
|
{
|
|
version: "0.8.8",
|
|
},
|
|
{
|
|
version: "0.6.6",
|
|
},
|
|
],
|
|
},
|
|
etherscan: {
|
|
apiKey: ETHERSCAN_API_KEY,
|
|
customChains: [],
|
|
},
|
|
sourcify: {
|
|
enabled: false,
|
|
},
|
|
gasReporter: {
|
|
enabled: REPORT_GAS === "true",
|
|
offline: REPORT_PRICE === "false",
|
|
coinmarketcap: COINMARKETCAP_API_KEY,
|
|
token: "ETH", // ETH, BNB, MATIC, AVAX, HT, MOVR - https://www.npmjs.com/package/hardhat-gas-reporter
|
|
currency: "USD",
|
|
//gasPrice: 10, // In case gasPriceApi not working https://etherscan.io/gastracker#chart_gasprice
|
|
gasPriceApi:
|
|
"https://api.etherscan.io/api?module=proxy&action=eth_gasPrice&apikey=" +
|
|
ETHERSCAN_API_KEY,
|
|
outputFile: "gas-report.txt",
|
|
noColors: true,
|
|
},
|
|
namedAccounts: {
|
|
deployer: {
|
|
default: 0,
|
|
//4: 1,
|
|
},
|
|
user: {
|
|
default: 1,
|
|
},
|
|
},
|
|
};
|