【发布时间】:2022-07-13 02:28:05
【问题描述】:
这是我的 hardhat.config 的上半部分
require("@nomiclabs/hardhat-waffle");
const dotenv = require("dotenv");
dotenv.config();
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
当我运行 npx hardhat run scripts/deployPizzaHeadNFT --network rinkeby 时,我一直收到相同的“错误 HH100:网络 rinkeby 不存在”
hardhat.config 的下半部分
module.exports = {
solidity: "0.8.4",
networks: {
rinkeby: {
url: process.env.REACT_APP_RINKEBY_RPC_URL
accounts: [process.env.REACT_APP_PRIVATE_KEY],
},
},
etherscan: {
apiKey: process.env.REACT_APP_ETHERSCAN_KEY,
},
};
【问题讨论】:
-
是安全帽配置文件在正确的位置。它应该与 package.json 处于同一级别
-
是的,在同一级别
-
你找到解决办法了吗?
标签: solidity