I’m using Etherscan multi-file verification but I keep on getting error “File import callback not supported” even though I made sure that all openzeppelin files were uploaded.
Here’s the smart contract:
pragma solidity >=0.4.25 <0.7.0;
// import './VerificationList.sol';
import '@openzeppelin/contracts/token/ERC20/ERC20.sol';
import '@openzeppelin/contracts/utils/Pausable.sol';
import '@openzeppelin/contracts/access/Ownable.sol';
contract CreateToken is ERC20, Ownable, Pausable {
uint256 _totalSupply;
uint256 public blackListCount;
uint256 public whiteListCount;
// Mapping of token addresses to vesting deadline
// mapping(address => uint256) public vestingDeadline;
constructor(
string memory _name,
string memory _symbol,
uint8 _decimals,
address _owner,
uint256 _supply
) public ERC20(_name, _symbol) {
// _totalSupply = _supply.mul(10**_decimals);
_setupDecimals(_decimals);
_mint(_owner, _supply);
transferOwnership(_owner);
blackListCount = 0;
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
* @param recipient The wallet address of the investor receiving the tokens
* @param amount The amount of tokens being sent
*/
function transfer(address recipient, uint256 amount) public virtual override whenNotPaused() returns (bool) {
_beforeTokenTransfer(msg.sender, recipient, amount);
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused and must be called by the owner.
*/
function pause() public onlyOwner() {
_pause();
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused and must be called by the owner.
*/
function unpause() public onlyOwner() {
_unpause();
}
/**
* @dev Burns a given number of tokens
* @param amount The number of tokens to burn
*/
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
/**
* @dev Mints a given number of tokens
* @param amount The number of tokens to burn
*/
function mint(uint256 amount) public onlyOwner() {
_mint(msg.sender, amount);
}
/**
@dev List of checks before token transfers are allowed
@param from The wallet address sending the tokens
@param to The wallet address recieving the tokens
@param amount The amount of tokens being transfered
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal override {
require(!paused(), 'ERC20Pausable: token transfer while paused');
require(!isBlackListed[to], 'Recipient not allowed');
require(amount > 0, 'Amount must not be 0');
// if (msg.sender != owner()) {
// require(vestingDeadline[from] >= block.timestamp, 'Lock in period has not passed');
// }
}
///mapping of the addresses if it is blacklisted or not
mapping(address => bool) public isBlackListed;
///mapping of the addresses if it is whitelisted or not
mapping(address => bool) public isWhiteListed;
/***
* @notice Check of an address is blacklisted
* @param _address Address to be checked if blacklisted
* @return Whether the address passed is blacklisted or not
*/
function getBlackListStatus(address _address) public view onlyOwner returns (bool) {
return isBlackListed[_address];
}
/***
* @notice Check of an address is whitelisted
* @param _address Address to be checked if whitelisted
* @return Whether the address passed is whitelisted or not
*/
function getWhiteListStatus(address _address) public view onlyOwner returns (bool) {
return isWhiteListed[_address];
}
/***
* @notice Add an address to the blacklist
* @param _address The address to be added to the blacklist
*/
function addBlackList(address[] memory _address) public onlyOwner {
for (uint256 i = 0; i < _address.length; i++) {
require(_address[i] != address(0), 'The address is address 0');
require(_address[i] != owner(), 'The address is the owner');
if (!isBlackListed[_address[i]]) {
isBlackListed[_address[i]] = true;
blackListCount++;
emit AddedBlackList(_address[i]);
}
if (isWhiteListed[_address[i]]) {
isWhiteListed[_address[i]] = false;
emit RemovedWhiteList(_address[i]);
}
}
}
/***
* @notice Remove an address from the blacklist
* @param _address The address to be removed from the blacklist
*/
function removeBlackList(address[] memory _address) public onlyOwner {
for (uint256 i = 0; i < _address.length; i++) {
if (isBlackListed[_address[i]]) {
isBlackListed[_address[i]] = false;
blackListCount--;
emit RemovedBlackList(_address[i]);
}
}
}
/***
* @notice Add an address to the whitelist
* @param _address The address to be added to the whitelist
*/
function addWhiteList(address[] memory _address) public onlyOwner {
for (uint256 i = 0; i < _address.length; i++) {
if (!isBlackListed[_address[i]]) {
isWhiteListed[_address[i]] = true;
whiteListCount++;
emit AddedWhiteList(_address[i]);
}
}
}
/***
* @notice Remove an address from the whitelist
* @param _address The address to be removed from the whitelist
*/
function removeWhiteList(address[] memory _address) public onlyOwner {
for (uint256 i = 0; i < _address.length; i++) {
if (isWhiteListed[_address[i]]) {
isWhiteListed[_address[i]] = false;
whiteListCount--;
emit RemovedWhiteList(_address[i]);
}
}
}
// event DestroyedBlackFunds(address _blackListedUser, uint256 _balance);
event AddedBlackList(address _address);
event RemovedBlackList(address _address);
event AddedWhiteList(address _address);
event RemovedWhiteList(address _address);
}
This contract is being called by another smart contract with a function of CreateToken then passing the parameters for the constructor.
Environment
Truffle v5.1.52 (core: 5.1.52)
Solidity - 0.6.2 (solc-js)
Node v12.18.4
Web3.js v1.2.9
Code to reproduce
The error occurs when verifying the Smart Contract using Multi-part option of Etherscan.
Thanks and Advance