Problem verifying the contract with truffle

Hi! After read a lot of posts about the contract verification, i guess that i almost have the truffle ready to verify using the binance smart chain network, but have some problems in the final step

When i put

:1234: truffle run verify BEP20Token@0x868bec2cb91619c5365253121ca5da16877262f1 --network testnet

I obtain

Verifying BEP20Token@0x868bec2cb91619c5365253121ca5da16877262f1
Could not find BEP20Token artifact at C

So, it’s imposible to obtain the file BEP20Token.json.

I google about some truffle unbox option but doesn’t find the option to unbox the contract for BEP. Have any idea?

Another importante thing is that i forced to comment the line in truffle-config.js

const { mnemonic, BSCSCANAPIKEY} = require(’./env.json’);

Because i don’t have the file env.json and don’t have idea about how find it.

Can you help me with that?

Thanks

Hi, welcome! :wave:

I am not sure, maybe you can share your contracts, so I can have a try.

HI Sykge!

I try now to send you the code and now i have a new problem. This is the code of my contract

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

import "@openzeppelin/contracts@4.1.0/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Snapshot.sol";
import "@openzeppelin/contracts@4.1.0/access/Ownable.sol";
import "@openzeppelin/contracts@4.1.0/security/Pausable.sol";

contract LosTeques is ERC20, ERC20Burnable, ERC20Snapshot, Ownable, Pausable {
    constructor() ERC20("Los Teques", "LTQ") {
        _mint(msg.sender, 10 * 10 ** decimals());
    }

    function snapshot() public onlyOwner {
        _snapshot();
    }

    function pause() public onlyOwner {
        _pause();
    }

    function unpause() public onlyOwner {
        _unpause();
    }

    function mint(address to, uint256 amount) public onlyOwner {
        _mint(to, amount);
    }

    function _beforeTokenTransfer(address from, address to, uint256 amount)
        internal
        whenNotPaused
        override(ERC20, ERC20Snapshot)
    {
        super._beforeTokenTransfer(from, to, amount);
    }
}

And now, when i’m going to compile “truffle compile” i have a new problems

Compiling your contracts...
===========================
> Compiling .\contracts\ltq.sol

ParserError: Source "@openzeppelin/contracts@4.1.0/token/ERC20/ERC20.sol" not found: File import callback not supported
 --> /C/Users/rufia/lqtcoin/contracts/ltq.sol:4:1:
  |
4 | import "@openzeppelin/contracts@4.1.0/token/ERC20/ERC20.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

,ParserError: Source "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Burnable.sol" not found: File import callback not supported
 --> /C/Users/rufia/lqtcoin/contracts/ltq.sol:5:1:
  |
5 | import "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Burnable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

,ParserError: Source "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Snapshot.sol" not found: File import callback not supported
 --> /C/Users/rufia/lqtcoin/contracts/ltq.sol:6:1:
  |
6 | import "@openzeppelin/contracts@4.1.0/token/ERC20/extensions/ERC20Snapshot.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

,ParserError: Source "@openzeppelin/contracts@4.1.0/access/Ownable.sol" not found: File import callback not supported
 --> /C/Users/rufia/lqtcoin/contracts/ltq.sol:7:1:
  |
7 | import "@openzeppelin/contracts@4.1.0/access/Ownable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

,ParserError: Source "@openzeppelin/contracts@4.1.0/security/Pausable.sol" not found: File import callback not supported
 --> /C/Users/rufia/lqtcoin/contracts/ltq.sol:8:1:
  |
8 | import "@openzeppelin/contracts@4.1.0/security/Pausable.sol";
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I found in some pages that many people have problems with the “callback not supported”, but never found the way to solve it. Can you help me with that please?

Thanks

Hi, I just follow the documentation:

And now, it has been Verified | BscScan.
I do not use Windows, but the confusing thing I think is the path, for your compiling path is .\contracts\ltq.sol, but for you import path is @openzeppelin/contracts@4.1.0/token/ERC20/ERC20.sol, so the difference is \ and /