Verify openzippelin code on BSCscan

I am a newbie in coding. I followed all the steps to deploy a copied contract from openzippelin on BSC using remix and it was all good. but when i try to verify the code, i got the following Error. i just copy and paste code from remix. can someone please help? thanks

Compiler debug log:
Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])
For troubleshooting, you can try compiling your source code with the Remix - Solidity IDE and check for exceptions

Compiler Warning(s):

ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File import callback not supported --> myc:4:1: | 4 | import "@openzeppelin/contracts/token/ERC20/ERC20.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ParserError: Source "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol" not found: File import callback not supported --> myc:5:1: | 5 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ParserError: Source "@openzeppelin/contracts/token/ERC20/extensions/ERC20Snapshot.sol" not found: File import callback not supported --> myc:6:1: | 6 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Snapshot.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ParserError: Source "@openzeppelin/contracts/access/Ownable.sol" not found: File import callback not supported --> myc:7:1: | 7 | import "@openzeppelin/contracts/access/Ownable.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ParserError: Source "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol" not found: File import callback not supported --> myc:8:1: | 8 | import "@openzeppelin/contracts/token/ERC20/extensions/draft-ERC20Permit.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ParserError: Source "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol" not found: File import callback not supported --> myc:9:1: | 9 | import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Votes.sol" | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • Compiler Version: v0.8.2+commit.661d1103
  • Optimization Enabled: False
  • Runs: 200

ByteCode (what we are looking for) :
6101406040527f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9610120908152503480156200003

1 Like

Try to flatten your code. Bscscan doesn't allow "import"

Try a different compiler version.

Hi, I tried your above method using the compile, flatten way but when I flatten I get an error in the code on line 40: interface IERC20Metadata is IERC20 which reads: TypeError: Definition of base has to precede definition of derived contract --> bep-20_flat.sol:40:29:
|
40 | interface IERC20Metadata is IERC20

I have no clue what this means and cannot find a solution anywhere, can you please help if possible?

Did you add the IERC20 interface before IERC20Metadata?

Im not sure what you mean? This was the reference when I compiled the code and then flattened it. Can you explain a bit more what you are asking me? thanks

1 Like

When you flattened it, where did you put "interface IERC20..." ?
Is it before or after "interface IERC20MEtadata is IERC20..." ?