【问题标题】:Error HH100: Network rinkeby doesn't exist错误 HH100:网络 rinkeby 不存在
【发布时间】: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


【解决方案1】:
 [`0x${PRIVATE_KEY}`]

检查 0x${} 确保它在您的 PRIVATE_KEY 中。

【讨论】:

    猜你喜欢
    • 2022-07-13
    • 2019-05-05
    • 1970-01-01
    • 1970-01-01
    • 2018-07-19
    • 1970-01-01
    • 1970-01-01
    • 2021-11-07
    • 2021-10-22
    相关资源
    最近更新 更多