小编Luk*_*tis的帖子

使用导入的 OpenZeppelin 文件在 Etherscan 上验证并发布合约

我目前正在构建符合 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 {
Run Code Online (Sandbox Code Playgroud)

但是,当尝试使用 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"
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Run Code Online (Sandbox Code Playgroud)

任何人都可以向我指出 1. 解决此问题或 2. 有关如何正确编写导入了可以使用 Etherscan 验证的依赖项的合约的文档。现在这只是一个单文件合同。

ethereum solidity smartcontracts cryptocurrency etherscan

9
推荐指数
2
解决办法
7258
查看次数