在尝试将智能契约部署到Goerli testnet时出错。错误:
Error HH8: There's one or more errors in your config file:
* Invalid account: #0 for network: goerli - private key too long, expected 32 bytes
To learn more about Hardhat's configuration, please go to https://hardhat.org/config/
For more info go to https://hardhat.org/HH8 or run Hardhat with --show-stack-traces这是我的hardhat.config.js文件:
/** @type import('hardhat/config').HardhatUserConfig */
require("@nomiclabs/hardhat-waffle");
const ALCHEMY_API_KEY = "API_KEY";
const GOERLI_PRIVATE_KEY = "PRV_KEY";
module.exports = {
solidity: "0.8.17",
networks: {
goerli: {
url: `https://eth-goerli.alchemyapi.io/v2/${ALCHEMY_API_KEY}`,
accounts: [GOERLI_PRIVATE_KEY],
},
},
};我在同一个目录(脚本目录)上。此外,我从戈利帐户的Metamask复制了私钥。我在谷歌上搜索,但没有发现任何有用的东西。
发布于 2023-01-19 17:23:51
在尝试了两天之后,我打开了一个新的元问询并创建了一个新的帐户&通过遵循我在第一个元询问时遵循的相同的私钥复制方法,它完美地工作了,IDK发生了什么,但它成功了。
https://ethereum.stackexchange.com/questions/143089
复制相似问题