UUPS proxy Contract verify on Rinkeby and Mumbai

I use hardhat to verify proxy contract but they said things like
"@nomiclabs/hardhat-etherscan: The address provided as argument contains a contract, but its bytecode doesn't match any of your local contracts."

not sure did i do it right??

npx hardhat verify --network rinkeby 0x440096bC03CDe8Ab9C23E4B25ba2A0b254c6c61E 0x58bd8dc8a85fcb34e63c41ca4254c42e4d3e990a

on ether scan i did verify implement contract but it still show
" Contract Source Code Verified (Similar Match)"

need help

Please see the section about proxies and upgradeable contracts in How to verify a contract on Etherscan/BscScan/PolygonScan and let me know if that fixes things for you.

1 Like

Thank to you a lot. tonight I will give it another short.

Hi
I follow what is can via link you did provide.. here is what I try on

  1. I do fresh deploy with clean code , removed all comment
  2. remove all artifacts and other contract
    npx hardhat clean
  3. verify implement contract via
    npx hardhat verify --network rinkeby 0x58Bd8Dc8a85fcb34E63C41Ca4254C42E4d3E990A
    which virified as it always did

this is implement contract

  1. verify Proxy via
    npx hardhat verify --network rinkeby 0x01921c4864a233B485A4619fDb876e2F4fb66E98

this is Proxy contract

which still got hardhat error
"Error in plugin @nomiclabs/hardhat-etherscan: The address provided as argument contains a contract, but its bytecode doesn't match any of your local contracts."

I need more help..

  • i think about ABI generation issue here
    "When you meet this error, please check the following one by one, making sure that it matches what you used to deploy exactly: contract source code, compiler version, compiler optimizations and runs number, constructor parameters, address of libraries."

well i did check on contract source code, compiler version. its seem ok
and contract have no constructor

so no idea where and how to check "compiler optimizations and runs number"

Your proxy contract is already verified. You can see it shows up as "ERC1967Proxy" and you can use the "Read as Proxy" functionality as well.

1 Like

thank you .I can see that
..
is it possible to make
" Similar Match Source Code"
to
make it

Contract Source Code Verified (Exact Match)

or ERC1967Proxy is always show like this??

It may be possible but we only provide support for up to "similar match". Note that similar match is generally good enough for proxies. Unless someone requests an exact match there is no reason for you to go the extra mile in my opinion.

If you want to give it a shot you can use the JSON input I shared here:

i see this mention in Proxy verify link you send me..

but How i can included those dependencies in the verification request via ether scan plugin?
npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS "Constructor argument 1"

in "Constructor argument 1" right?? do to have to turn Json into kind of string??

this is so close.. I want more shot

Thank you Frangio..

What JSON? You just include the constructor arguments.

let me put it like this

if my contract builded on

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";

how do I put it as constructor arguments???

npx hardhat verify --network mainnet DEPLOYED_CONTRACT_ADDRESS @openzeppelin/contracts/token/ERC20/ERC20.sol @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol @openzeppelin/contracts/access/AccessControl.sol

do you mean something like this right??