Added Gas Reporter
This commit is contained in:
+23
-5
@@ -5,14 +5,19 @@ require("@nomiclabs/hardhat-ethers");
|
||||
//require("@nomicfoundation/hardhat-verify");
|
||||
require("dotenv").config();
|
||||
require("./tasks/block-number");
|
||||
require("hardhat-gas-reporter");
|
||||
|
||||
const RPC_URL_SEPOLIA = process.env.SEPOLIA_RPC_URL;
|
||||
const PRIVATE_KEY_SEPOLIA = process.env.SEPOLIA_PRIVATE_KEY;
|
||||
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;
|
||||
const PRIVATE_KEY_GANACHE = process.env.LOCAL_PRIVATE_KEY;
|
||||
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;
|
||||
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 = {
|
||||
@@ -42,6 +47,19 @@ module.exports = {
|
||||
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,
|
||||
},
|
||||
};
|
||||
|
||||
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
|
||||
|
||||
Reference in New Issue
Block a user