Skip to content

Commit

Permalink
show gas report
Browse files Browse the repository at this point in the history
  • Loading branch information
YouStillAlive committed Dec 5, 2024
1 parent 30cf91b commit 1fa16cf
Show file tree
Hide file tree
Showing 5 changed files with 769 additions and 425 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ artifacts
typechain
typechain-types
dist
gasReport.md

# production
build
Expand Down
3 changes: 2 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ coverage.json
cache
artifacts
typechain
typechain-types
typechain-types
gasReport.md
63 changes: 43 additions & 20 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,48 @@
import '@nomicfoundation/hardhat-toolbox';
import 'hardhat-gas-reporter';
import { HardhatUserConfig } from 'hardhat/config';
import 'solidity-coverage';
import { HardhatUserConfig } from "hardhat/config"
import "hardhat-gas-reporter"
import "@typechain/hardhat"
import "solidity-coverage"
import "@nomicfoundation/hardhat-network-helpers"
import "@nomicfoundation/hardhat-chai-matchers"

const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
version: '0.8.24',
settings: {
evmVersion: 'istanbul',
optimizer: {
enabled: true,
runs: 200,
},
defaultNetwork: "hardhat",
solidity: {
compilers: [
{
version: "0.8.27",
settings: {
evmVersion: "istanbul",
optimizer: {
enabled: true,
runs: 200,
},
viaIR: true,
},
},
],
},
networks: {
hardhat: {
blockGasLimit: 130_000_000,
},
},
},
networks: {
hardhat: {
blockGasLimit: 130_000_000,
gasReporter: {
enabled: true,
showMethodSig: true,
currency: "USD",
token: "BNB",
gasPriceApi:
"https://api.bscscan.com/api?module=proxy&action=eth_gasPrice&apikey=" + process.env.BSCSCAN_API_KEY,
coinmarketcap: process.env.CMC_API_KEY || "",
noColors: true,
reportFormat: "markdown",
outputFile: "gasReport.md",
forceTerminalOutput: true,
L1: "binance",
forceTerminalOutputFormat: "terminal",
showTimeSpent: true,
},
},
};
}

export default config;
export default config
Loading

0 comments on commit 1fa16cf

Please sign in to comment.