1 Star 2 Fork 3

lights li/hardhat_framework

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
hardhat.config.ts 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
lights li 提交于 2022-01-05 19:36 . 提交脚手架
/**
* @type import('hardhat/config').HardhatUserConfig
*/
import "@nomiclabs/hardhat-ethers";
import "@nomiclabs/hardhat-waffle";
import "@nomiclabs/hardhat-etherscan";
import "hardhat-abi-exporter";
import "hardhat-deploy";
//import * as env from "dotenv";
import { HardhatUserConfig } from "hardhat/types";
import * as fs from "fs";
import {extTask} from "./hardhat.task";
//env.config({ path: './.env' });
console.log("config hardhat.");
extTask.RegTasks();
//get prikeyts from a json file
let buffer = fs.readFileSync("testprikeys.json");
let srcjson = JSON.parse(buffer.toString());
let namedkeys: { [id: string]: number } = srcjson["namedkeys"];
let onlykeys: string[] = srcjson["prikeys"] as string[];
let hardhat_prikeys = [];
for (var i = 0; i < onlykeys.length; i++)
hardhat_prikeys.push({ "privateKey": onlykeys[i], "balance": "99000000000000000000" });
const config: HardhatUserConfig = {
solidity: {
version: "0.8.2",
settings: {
optimizer: {
enabled: true,
runs: 200
}
}
},
namedAccounts: namedkeys,//from json
paths: {
artifacts: "artifacts",
deploy: "deploy",
sources: "contracts",
tests: "test",
},
defaultNetwork: "hardhat",
networks: {
hardhat: {
accounts: hardhat_prikeys
},
rinkeby: {
url: `https://rinkeby.infura.io/v3/${process.env.INFURA_API_KEY}`,
accounts: onlykeys,
chainId: 4,
live: true,
saveDeployments: true,
tags: ["staging"],
timeout: 60000
},
bscTest: {
url: "https://data-seed-prebsc-1-s1.binance.org:8545/",
accounts: onlykeys,
chainId: 97,
live: true,
saveDeployments: true,
tags: ["staging"],
},
},
etherscan: {
// Your API key for Etherscan
// Obtain one at https://bscscan.com/
apiKey: "8RP2CMPTXGBTMBT1SDD2KS2C9H4NQ6AS79"
},
mocha: {
timeout: 600000
}
};
export default config;
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/lightsever/hardhat_framework.git
git@gitee.com:lightsever/hardhat_framework.git
lightsever
hardhat_framework
hardhat_framework
master

搜索帮助