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
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.
When I verify implementation address it verified successfully
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.