代码拉取完成,页面将自动刷新
/**
* @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;
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。