Cannot verify erc721 contract in testnet.snowtrace

Hi, I want to verify my contract in snowtrace, . I followed the steps to verify using remix.

  • Added the contract to remix and compiled it

  • use FLATTENER to flatten the code and added the SPDX-License-Identifier: MIT

  • Added flatten code to Solidity Contract Code section

  • when I clicked verify and publish it gives following error

 Error! Unable to generate Contract ByteCode and ABI
 Found the following ContractName(s) in source code : AddressUpgradeable, ContextUpgradeable, CountersUpgradeable, ERC165Upgradeable, ERC1967UpgradeUpgradeable, ERC721NFTPublic, ERC721URIStorageUpgradeable, ERC721Upgradeable, IBeaconUpgradeable, IERC165Upgradeable, IERC1822ProxiableUpgradeable, IERC2981Upgradeable, IERC721MetadataUpgradeable, IERC721ReceiverUpgradeable, IERC721Upgradeable, Initializable, OwnableUpgradeable, SafeMathUpgradeable, StorageSlotUpgradeable, StringsUpgradeable, UUPSUpgradeable
 But we were unable to locate a matching bytecode (err_code_2)
 For troubleshooting, you can try compiling your source code with the Remix - Solidity IDE and check for exceptions
  • Compiler Version: v0.8.7+commit.e28d00a7
  • Optimization Enabled: True
  • Runs: 200

:1234: Code to reproduce


:computer: Environment

  • Remix
  • Compiler Version: v0.8.7+commit.e28d00a7
  • Optimization Enabled: True
  • Runs: 200

Have you looked through the troubleshooting ideas in our guide?

1 Like

yes . I have followed the tutorial and tried to verify the address using hardhat plugin.
it gives following error when i tried to verify proxy address.

  • I never used solidity 0.8.2 version in the project
Error in plugin @nomiclabs/hardhat-etherscan: The contract you want to verify was compiled with solidity 0.8.2, but your configured compiler version is: 0.8.7.

Possible causes are:
  - You are not in the same commit that was used to deploy the contract.
  - Wrong compiler version selected in hardhat config.
  - The given address is wrong.
  - The selected network (fuji) is wrong.

For the proxy you need to verify differently. Look in the guide for the section called "If proxy is not verified" and try to follow those instructions. Let me know how it goes.

1 Like

The instructions say to use that specific solc input, not one that you generate:

I was able to verify your proxy using this file.

1 Like

Thank you. I was able to verify my other contracts too