Just starting out trying to learn contracts and how they work. Found an example from your wizard and ran it fine in remix, compiled and deployed fine. When I went to etherscan.io to compile the code I received this error :
........
Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])
........
The Compiler Warning(s) game me this :
........
ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File import callback not supported
--> myc:8:1:
|
8 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol"
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
........
I am not 100% sure what is going on with this error, have googled it and found that the @open statement is supposed to be used but that did not help as shown in code below. I did however notice in MyContract_metadata.json the "version": "0.5.17+commit.d19bba13" is show, do not know if this would have to be changed to the ^0.8.2 version or if it matters?
Any help would be greatly appreciated for your time.
Thank you.
you should create a folder named contracts and inside have a folder named token, and inside the folder token you should leav a ERC20 smartcontract, you can found one on the git of openzeppelin
Hello . I get the same error above like You. Where and How can I install the openzeppelin folders so that "import" function in the code can work , not give error and verify the contract successfully ?
Any help would be greatly appreciated .
Thanks a lot.
No, I did not mean in the Remix folder, I thought you had a problem building your project in general.
If your contract is already deployed and you're just looking to verify it on Etherscan via Remix, then you just need to flatten the source code before you paste it into Remix.
I could verify now.
I have right clicked on Remix page to the .sol file and clicked on "flatten"
Copy and paste to the verify and publish page . It worked.