你好,我试图在二进制测试网上验证我的测试令牌,并获得有关导入erc20的错误。
--> myc:4:1:
|
4 | import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^代码:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract TestC is ERC20{
constructor(uint256 initialSupply) ERC20("TestC", "ALPH") {
_mint(msg.sender, initialSupply);
}
}完全没有错误或警告的混合编译器编译。但是,当y试图验证bncscan上的源代码时,它会返回此错误。
发布于 2022-03-09 08:48:53
当从块资源管理器的UI验证源代码时,这是一个典型的问题。复制“https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol“”中的内容;创建名为ERC20.sol的新文件;粘贴此文件中复制的代码并将导入语句更改为import ./ERC20.sol;
https://ethereum.stackexchange.com/questions/122571
复制相似问题