How to verify ERC20 deployed via Remix on Etherscan?

Hi @DeSaint,

Welcome to the community :wave:

:warning: We should only use an official release of OpenZeppelin Contracts. When using GitHub imports we can specify a release tag. The following is for OpenZeppelin Contracts 3.4 Solidity 0.7 version.

https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0-solc-0.7/contracts/token/ERC20/ERC20.sol

The code you provided is importing Solidity 0.7 branch which is subject to change and is not part of an official release. As the code can change, this can make verification difficult too.

An example ERC20 can be found in: Deploy a simple ERC20 token in Remix

Also, the code provided isn’t burnable, it appears to be different to what is actually deployed. The code above has a supply of zero, but the contract linked on Etherscan has minted tokens. I assume you are only showing a cut down version of your contract?

I use the following process to verify using Hardhat by converting GitHub imports to npm imports: Verify smart contract inheriting from OpenZeppelin Contracts

As @skyge said, to verify you will need to know the Solidity compiler version used and whether optimization was enabled.

1 Like