Can't verify contract on BSC scan

Im not sure what im doing wrong but i cant verify my contract on BSC scan.

This is my simple code and the error:

pragma solidity ^0.8.0;

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

contract RandCoin is ERC20 {
    constructor(uint256 initialSupply) public ERC20 ("RandCoin", "RAND") {
        _mint (msg.sender, initialSupply);
    }
}

Compiler Warning(s):

ParserError: Source not found: File import callback not supported

I've tried to bring in multiple files too (i,e all ERC20.sol, etc - but still can't verify it"

Compiler Warning(s):

ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition.
 --> Context.sol:7:1:
  |
7 | 
  | ^

My contract address is
0x8fa29138025555dc7c5fe12d470de28be03f029f

2 Likes

Sorry, I am not familiar with the BSC-Chain, maybe you should ask for help in their forum: Home | Binance Chain Forum

And they have a documentation about how to verify contracts, maybe you can have a look at it: Truffle Verify - Binance Chain Docs

Verified! Contract Address 0x8fa29138025555dc7c5fe12d470de28be03f029f | BscScan

3 Likes

Wow!!! Thank you so much!!! Really helpful and so fast!!! Thank you again!

1 Like

Hi @S-kh,

Welcome to the community :wave:

Thanks @skyge for being awesome. :pray:

We can use @ (npm style) imports on Remix now.
If you use GitHub imports, you need to specify the release tag so that you use an official release of OpenZeppelin Contracts… Importing from the master branch means that the code can change.

Simple example token:

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

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract MyToken is ERC20 {
    constructor() ERC20("MyToken", "MTK") {
        _mint(msg.sender, 1000000 * 10 ** decimals());
    }
}
3 Likes

Great, thank you for your help!

1 Like

Hi! Could you help me too? I have the same problem. This is my contract code: 0x00afb2e9d3b0f8033eb206e42b21a4ce91a5cf52

Dear Skyge,

i dont want to beg, i looked a lot around the web to get my Contract verified. But my Skills to USE Npm are almost Zero. Can you please tell me or help me to verify my contract:

0x57ce71a128e268e00a6b58d4d32317876fa482d7
I use the Compiler version 0.8.0:

This is my Code:

pragma solidity ^0.8.0;

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

contract SpaceWolf is ERC20 {
    constructor(uint256 initialSupply) public ERC20("SpaceWolf", "SWO") {
        _mint(msg.sender, initialSupply);
    }
}

Hi, I have the exact same problem as you, and I used the exact same source code & Github link and everything. Could you please explain step-by-step how you did it? Like what program u used to install truffle, then how did you verify etc, because I don’t even know how to install Truffle,

Please if you have a moment to explain step-by-step I would appreciate it so much.

It seems like your contract has been verified!

1 Like

It seems like your contract has been verified!

Hi, could you please share your source code, contract address, and compiler version.

Hi, absolutely.


// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";


    contract BloomCoin is ERC20 {
    constructor(uint256 initialSupply) public ERC20 ("BloomCoin", "BLC"){
        _mint(msg.sender, initialSupply);
    }
}


Contact address: 0x05c662050fea040402170a30a777cb53c8374041
Compiler version: 0.8.0

pragma solidity ^0.8.0;

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

contract astrocoin is ERC20 {
    constructor(uint256 initialsupply) public ERC20 ("astrocoin","ASTRO"){
        _mint(msg.sender,initialsupply);
    }
}

Contract Address
0x0de96ff63831acf48f5743eb7002290210d40943
Compiler version: 0.8.0

@Skyge Can you help me verify?

Hey Skyge, can you help on verifying this?

Contract Address: 0x91430112dd6b929ae79a645cd0fe2333fe8ab634
Compiler version: 0.8.0

pragma solidity ^0.8.0;

// SPDX-License-Identifier: MIT

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

contract HODLcoin is ERC20 {
constructor (uint256 initialSupply) ERC20 ("HODLcoin", "HODL"){
    _mint(msg.sender,initialSupply);
    }

}

8 posts were split to a new topic: How to verify contracts on the BSC

Just like I mentioned above:
And BSC-Chain has a documentation about how to verify contracts, maybe you can have a look at it:

Verified!

1 Like

Do you mind sharing how you did it?
I couldn’t understand the steps in Hardhat or Truffle verify :frowning:

Skyge can you contact me on on here please and describe how it works and i will pay you a good sum if you do thank you! t.me/joinchat/T0ylNKzbAwgwNjMy

1 Like

Hi @Skyge,

Have tried truffle flattening but cannot seem to verify this contract - can you please advise?

Contract address: 0x1f838466746f6510185efa5bf2e01d6fbaa43915

Source Code:

pragma solidity ^0.8.0;

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

contract Methane is ERC20 {
    constructor(uint256 initialSupply) public ERC20 ("Methane", "CH4"){
        _mint(msg.sender,initialSupply);
    }
   
}

Many thanks in advance!