I'm trying to to verify and publish a contract on BSC Scan testnet. I'm using Open Zepellin and Remix - ETH IDE, however I'm getting the following error:
not found: File import callback not supported
I believe the same issue is true if I try verifying it on Etherscan.
what am I doing wrong?
This is the code I pasted on BSC Scan to verify and publish it.
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract Presidente is ERC20, Ownable {
constructor() ERC20("Presidente", "PRES") {
_mint(msg.sender, 1000000 * 10 ** decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
i see that you are trying to verify while the contract you have needs to be flattened,
here is what you need to do:
Go to remix.ethereum.org and create a new file token.sol
copy/paste your code in it and save it
go to the last tab plugin manager and look for FLATTENER install it
FLATTENER will show as a tab click on it and press on Flatten token.sol
press on Save as token_flat.sol
go back to the first tab and you'll find the new file
remove all of the extra license showen "// SPDX-License-Identifier: MIT"
move the second part to become the theird part
pragma solidity ^0.8.0;
/**
@dev Interface for the optional metadata functions from the ERC20 standard.
Available since v4.1. / interface IERC20Metadata is IERC20 { /*
/**
/**
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
after this part