Verify ERC20 token on BSCScan

Hi. I’m not a developer but have been trying to verify a contract for hours. I’ve gone through all the guides in the search feature but I don’t know what I’m doing with Node or really anything else at the moment. How exactly do you verify it with the link you provided? Is there a way to use that link with Remix? I’m wondering if I should have had a github account prior to deploying this from Remix.

Here is my contract address: https://bscscan.com/address/0x9e18210acfa31e0a48e67971c20c64e2d9211313

I’m getting error about the import feature not working

pragma solidity 0.8.0;
// SPDX-License-Identifier: MIT


import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";

contract TestToken is ERC20 {
    constructor () 
    public ERC20("TestToken4", "TEST4") {
        _mint(msg.sender, 1000000000000000000000000);
    }
}

Error:

Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])

Compiler Warning(s):
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:
|
5 | import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • Compiler Version: v0.8.0+commit.c7dfd78e
  • Optimization Enabled: False
  • Runs: 200

ByteCode (what we are looking for) : *

*(long string of numbers removed)

1 Like

As I have mentioned above, you can use some tool to verify contracts.

Have verified!

2 Likes

Hi @Fluffhead,

Welcome to the community :wave:

We should only use code from an official release of OpenZeppelin Contracts. The GitHub import in your contract imports from the master branch which is subject to change (which can also make it difficult to verify).

If you want to import via GitHub please use a release tag, e.g.:
https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v4.0.0-beta.0/contracts/token/ERC20/ERC20.sol

Please note Solidity 0.8 support is only in the OpenZeppelin Contracts 4.0 Beta.

I am on the same spot. Cant verify it :confused: I am also tried the truffle tool but no success.

My address https://bscscan.com/address/0x9e18210acfa31e0a48e67971c20c64e2d9211313#code

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";

contract MilliCoin is ERC20 {
    constructor(uint256 initialSupply) ERC20 ("MilliCoin", "MLC"){
        _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:4:1:
  |
4 | import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol"
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    Compiler Version: v0.8.4+commit.c7e474f2
    Optimization Enabled: False
    Runs: 200

ByteCode (what we are looking for):
60806040523480156200001157600080fd5b50604051620018f7380380620018f7833981810160405281019062000037919062000321565b6040518060400160405280600981526020017f4d696c6c69436f696e00000000000000000000000