I deployed an ERC-20 Token contract and would like to now verify it on etherscan.io
My contract utilizes Open-Zeppelin's library of contracts - which means it's importing one of their contracts into itself, like so:
pragma solidity ^0.5.0; import "../node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; contract MyTestCoin is ERC20 { // etc. Of course, it so happens that this imported ERC20.sol contract imports other contracts into itself as well, so the rabbit hole gets even deeper.
So my question is basically this: if I want to verify my contract, can I just verify IT, or do I need to also somehow verify every other contract it imports as well?
Also, what Open Source License Type should I choose when I go through the verification process? etherscan.io has like 9 different options you can choose from - and I can't tell what's right for this.
Any help would be greatly appreciated.
UPDATE
ok, I tried using truffle flattened in Terminal. It combined and outputted the code of all the files I pointed it to into one stream, so I copy-pasted that code into the etherscan verification page and got this error:
Compiler debug log: Error! Unable to generate Contract ByteCode and ABI Found the following ContractName(s) in source code : ERC20, IERC20, MyTestCoin, SafeMath But we were unable to locate a matching bytecode (err_code_2) For troubleshooting, you can try compiling your source code with the Remix - Solidity IDE and check for exceptions So - what's that all about?
UPDATE # 2
As per the suggestion in the error message I received, I took all the code and compiled it in Remix - there were no errors. So the code seems to be just fine...