jscrui
April 15, 2021, 5:28am
1
Hi, Im trying to verify my contract and getting same error with my contract:
Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract CoinName is ERC20 {
constructor(uint256 initialSupply) public ERC20("CoinName","CoinSymbol") {
_mint(msg.sender, initialSupply);
}
}
Error:
ParserError: Source “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol ” not found: File import callback not supported
→ myc:5:1:
Could you help me? Thanks!!
1 Like
Hi @jscrui ,
Welcome to the community
You should only use an official release of OpenZeppelin Contracts. Currently you are importing via GitHub the master branch which is subject to change.
Remix now supports @
(npm style) imports. Try this using the Contracts Wizard: https://zpl.in/wizard
As for verifying you can try the following with Hardhat: Verify smart contract inheriting from OpenZeppelin Contracts
ATG
August 19, 2021, 9:44am
3
Hello Andrew,
how/where to install the hardhat please?
I used a github openzeppelin contract... same problem:
opened 09:14AM - 19 Aug 21 UTC
Hello, we are newbies, but we managed to create our own token, while using a scr… ipt that included the import of the openzeppelin ERC20 contract. We just adjusted our details, and it created it worked so far.
But now we are facing on Etherscan the problem, that we can't verify the contract, because of the imported file.
Error message:
**Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])**
Warning: SPDX license identifier not provided in source file. Before publishing, consider adding a comment containing "SPDX-License-Identifier: " to each source file. Use "SPDX-License-Identifier: UNLICENSED" for non-open-source code. Please see https://spdx.org for more information.
--> myc
ParserError: Source "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol" not found: File import callback not supported
--> myc:3:1:
|
3 | import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I tried to search in the forum and internet myself, but didn't find a solution.
Can you please tell me how to fix it or where I can find an article, which already covered this problem and came up with a working solution?
It took us a week to come to this step, we spend for the contract around 200$ - please help that it was not done for nothing.
Thanks a lot for your time and knowledge in advance.
I really try to understand your hardhat explaination - do you have a link to a video or other source, that explains is more detailed/in a way I can understand it as a newbie please?