Verfiy on bscscan error

Hi i want to verify my contract on bscscan but i keep getting this error Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])

i am a noobie so keep it simpel please

pragma solidity ^0.8.0;

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

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

Thanks for helping me!

Hi @Sjoerd welcome to Open Zeppelin!

Because you are having compiler issues, it is probably a very basic environment problem.

Please follow the guide at OpenZeppelin Upgrades: Step by Step Tutorial for Hardhat

Here are some learning resources Solidity learning resources

If you are still having problems after that please update us and we can help.

1 Like

Hi Tsushima,

Thanks for helping me out, i figured out how to get the errors out Remix Ethereum but i can’t verify on Bscscan i am new noob so i will share:

// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

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

contract Name is ERC20 {
    constructor (uint256 initialsupply)  ERC20 ("Name", "NME"){
        _mint(msg.sender,initialsupply);
    }
    
}

And Bscscan give this error: Error! Unable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])

This is an environment issue. You will have to figure out how to verify with Remix.

2 Likes

I’m having the exact same issue and haven’t been able to figure it out have you had any luck ?

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:

I think you should share your contract address and compiler version.