Hi. I am trying to verify the following smart contract using Hardhat (it was deployed by another account with remix, on the Ethereum Mainnet):
Code to reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Genetix is ERC20 {
string private _name = "GENETIX";
string private _symbol = "GNTX";
uint256 private _totalSupply = 1978651800 * 10 ** 18;
constructor() ERC20(_name, _symbol) {
_mint(msg.sender, _totalSupply);
}
function burn(uint256 _amount) public {
require(balanceOf(msg.sender) >= _amount, "Not Enough Tokens To Burn.");
_burn(msg.sender, _amount);
}
}
Environment
Deployed using Remix, Solidity Compiler v. 0.8.7, and tried to verify it with Hardhat v. 2.8.3.
My hardhat.config.js file:
require("@nomiclabs/hardhat-waffle");
require("@nomiclabs/hardhat-etherscan");
let secrets = require("./secrets");
// This is a sample Hardhat task. To learn how to create your own go to
// https://hardhat.org/guides/create-task.html
task("accounts", "Prints the list of accounts", async (taskArgs, hre) => {
const accounts = await hre.ethers.getSigners();
for (const account of accounts) {
console.log(account.address);
}
});
// You need to export an object to set up your config
// Go to https://hardhat.org/config/ to learn more
/**
* @type import('hardhat/config').HardhatUserConfig
*/
module.exports = {
solidity: "0.8.7",
networks: {
rinkeby: {
url: secrets.url,
accounts: [secrets.key]
}
},
etherscan: {
apiKey: "secrets.apiKey"
}
};
Any solutions out there? My token contract address is "0x703a2B537367cc8eA3360A54B842692462Bb9969". Thank you.