【发布时间】:2023-01-16 12:09:10
【问题描述】:
智能合约已成功部署到孟买测试网上的 0x91Dc2eeC62cF6c8a16718FbE7Ca757C462AFBa8c。现在我试图通过 hardhat 验证它,安装了 hardhat-etherscan 库和 hardhat.config.ts 看起来像这样:
const config: HardhatUserConfig = {
solidity: "0.8.9",
defaultNetwork: "mumbai",
networks: {
hardhat: {},
mumbai: {
url: `https://polygon-mumbai.g.alchemy.com/v2/${ALCHEMY_API_KEY}`,
accounts: [MUMBAI_PRIVATE_KEY]
}
},
etherscan: {
apiKey: {
mumbai: POLYGONSCAN_API_KEY
},
customChains: [
{
network: "mumbai",
chainId: 80001,
urls: {
apiURL: "https://api-testnet.polygonscan.com",
browserURL: "https://mumbai.polygonscan.com"
}
}
]
}
};
但是使用上面的智能合约地址和设置运行 npx hardhat verify 会导致:
npx hardhat verify --network mumbai 0x91Dc2eeC62cF6c8a16718FbE7Ca757C462AFBa8c
Nothing to compile
No need to generate any newer typings.
An unexpected error occurred:
[Error: ENOENT: no such file or directory, open '/workspaces/devcontest/artifacts/build-info/326038f2a359a1b4c6d393af35e41db0.json'] {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/workspaces/devcontest/artifacts/build-info/326038f2a359a1b4c6d393af35e41db0.json'
}
有什么问题吗?我正在通过安装了 Hardhat 插件的 M$ Visual Studio Code 在远程开发容器中运行所有这些...
【问题讨论】:
-
你能运行
npx hardhat clean然后再试一次吗
标签: hardhat