1 Star 1 Fork 1

yaoyanhui/openzeppelin-contracts

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
hardhat.config.js 1.96 KB
一键复制 编辑 原始数据 按行查看 历史
/// ENVVAR
// - CI: output gas report to file instead of stdout
// - COVERAGE: enable coverage report
// - ENABLE_GAS_REPORT: enable gas report
// - COMPILE_MODE: production modes enables optimizations (default: development)
// - COMPILE_VERSION: compiler version (default: 0.8.9)
// - COINMARKETCAP: coinmarkercat api key for USD value in gas report
const fs = require('fs');
const path = require('path');
const argv = require('yargs/yargs')()
.env('')
.options({
ci: {
type: 'boolean',
default: false,
},
coverage: {
type: 'boolean',
default: false,
},
gas: {
alias: 'enableGasReport',
type: 'boolean',
default: false,
},
mode: {
alias: 'compileMode',
type: 'string',
choices: [ 'production', 'development' ],
default: 'development',
},
compiler: {
alias: 'compileVersion',
type: 'string',
default: '0.8.9',
},
coinmarketcap: {
alias: 'coinmarketcapApiKey',
type: 'string',
},
})
.argv;
require('@nomiclabs/hardhat-truffle5');
if (argv.enableGasReport) {
require('hardhat-gas-reporter');
}
for (const f of fs.readdirSync(path.join(__dirname, 'hardhat'))) {
require(path.join(__dirname, 'hardhat', f));
}
const withOptimizations = argv.enableGasReport || argv.compileMode === 'production';
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: {
version: argv.compiler,
settings: {
optimizer: {
enabled: withOptimizations,
runs: 200,
},
},
},
networks: {
hardhat: {
blockGasLimit: 10000000,
allowUnlimitedContractSize: !withOptimizations,
},
},
gasReporter: {
currency: 'USD',
outputFile: argv.ci ? 'gas-report.txt' : undefined,
coinmarketcap: argv.coinmarketcap,
},
};
if (argv.coverage) {
require('solidity-coverage');
module.exports.networks.hardhat.initialBaseFeePerGas = 0;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yaoyanhui/openzeppelin-contracts.git
[email protected]:yaoyanhui/openzeppelin-contracts.git
yaoyanhui
openzeppelin-contracts
openzeppelin-contracts
master

搜索帮助