我有一份明智的合同,从开放的齐柏林飞艇合同中进口。我很难用硬帽子来核实合同。契约编译并部署在goerli testnet上,但在运行此命令时我得到了这个错误:
白帽司令部:
npx硬帽验证--网络goerli 0x70adB5B0A27da42CE765B44d638b7475aAb8Cf97
错误信息:
发生了一个意外错误:
{ errno:-2,代码:'ENOENT',syscall:'open',path:'/Users/MY_USER_NAME/Desktop/mammoth/artifacts/build-info/1f140c6c1844d1ec9261b1789241547f.json‘}
这是我最聪明的合同:
SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.17;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
// inherit from ERC721 openzep contracts
contract OneOfAKind is ERC721 {
constructor(string memory name, string memory symbol)
ERC721(name, symbol) {
console.log("Token Name:", name); // show when tests run
console.log("Token Symbol:", symbol); // show when tests run
console.log("Sender's Address:", msg.sender); // shows sender address
}
}
下面是我的Hardhat.config.js文件脚本:
require("@nomicfoundation/hardhat-toolbox");
require("@nomiclabs/hardhat-etherscan");
require("dotenv").config();
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.17",
networks: {
goerli: {
url: process.env.NODE_ENDPOINT,
accounts: [process.env.PRIVATE_KEY]
}
},
etherscan: {
apiKey: process.env.API_KEY
}
};
发布于 2022-10-18 20:31:55
首先,确保插件已正确安装,如果未安装,请使用以下命令:npm install --save-dev @nomiclabs/hardhat-etherscan
,如果安装正确,请执行以下步骤:
npx hardhat clean
删除工件npx hardhat compile
https://ethereum.stackexchange.com/questions/137732
复制相似问题