我目前正在构建符合 ERC721 的合约并已在此处发布合约:https://ropsten.etherscan.io/address/0xa513bc0a0d3af384fefcd8bbc1cc0c9763307c39 - 我正在尝试验证和发布合约源代码
我的文件的开头看起来像这样:
// SPDX-License-Identifier: MIT
// We will be using Solidity version 0.8.4
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
contract ViperToken is ERC721 {
但是,当尝试使用 Solidity 单个文件验证和发布时,出现以下错误:
ParserError: Source "@openzeppelin/contracts/token/ERC721/ERC721.sol" not found: File import callback not supported
--> myc:6:1:
|
6 | import "@openzeppelin/contracts/token/ERC721/ERC721.sol"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
任何人都可以指出我的方向 1. 解决这个问题或 2. 有关如何适当编写具有导入的依赖项的合同的文档,可以使用 Etherscan 进行验证。现在这只是一个单一的文件合同。
答案 0 :(得分:0)
简单地说,我必须钻进一个兔子洞才能解决这个问题,因为我对 Solidity 还很陌生。
我必须执行以下操作;
总而言之,我很确定在 Etherscan 网络应用程序中无法验证包含导入文件的合同。
如果有人有兴趣了解我如何构建它,最终产品就在这里https://github.com/lukecurtis93/viper-nft(这只是我在网上找到的一个 CryptoKitties 克隆作为基础并更新了所有内容)