【发布时间】:2022-07-26 01:33:26
【问题描述】:
这是我的 hardhat.config.js 文件代码:
require("@nomiclabs/hardhat-waffle");
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
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);
}
});
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.4",
networks : {
hardhat :{
chainId: 1337,
},
paths :{
artifacts: "./src/artifacts",
},
},
};
当我使用 npx hardhat compile 编译它时
它显示以下错误:
错误 HH8:您的配置文件中有一个或多个错误:
- 为 HardhatConfig.networks.paths.url 定义的值无效 - 需要类型的值 字符串。
想了解更多关于Hardhat的配置,请到https://hardhat.org/config
供您参考,我正在按照本教程构建这个 web3 项目:“https://blog.suhailkaka.com/setup-and-build-your-first-web-3-application”
【问题讨论】:
标签: javascript blockchain solidity web3js hardhat