Verify ERC1967Proxy created from Factory

Hi

I am trying to verify a proxy contract (0xe81a45439ff9bc5841202ce4b2049e578f8771d9) that was created from within a factory contract. This is what I have tried to date;

Verified the factory and implementation.

The factory (0x415eacc51dc77e97c6bebb3296d5ffb84cce5d8f) creates the proxy using the following

ERC1967Proxy proxy = new ERC1967Proxy(implementation(), data);

Data in this case is the following;

abi.encodeWithSignature(
                "initialize(string,string,address)",
                name,
                symbol,
                addr
            );

From the transaction that created the contract I can observe the following (0xdd7233ff9158341511ae2ca7b9fc7e82438c3fd7c2a924d33f73cc68d0744213)

name = McCoySpace
symbol = MCCOY
addr = 0xa57fb5a5ad51beb3854d801ea3ad6ac2845cd082

Using https://abi.hashex.org/ I encoded these variable and came up with;

077f224a000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a0000000000000000000000000a57fb5a5ad51beb3854d801ea3ad6ac2845cd082000000000000000000000000000000000000000000000000000000000000000a4d63436f7953706163650000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000054d43434f59000000000000000000000000000000000000000000000000000000

I took implementation contract (0x4c9fee9218dcc2d11374dd9ca80669ff9d58d0ed) and the data above and encoded them

0000000000000000000000004c9fee9218dcc2d11374dd9ca80669ff9d58d0ed000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000001c8303737663232346130303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303630303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303061303030303030303030303030303030303030303030303030306135376662356135616435316265623338353464383031656133616436616332383435636430383230303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303061346436333433366637393533373036313633363530303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303534643433343334663539303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030000000000000000000000000000000000000000000000000

Compiler options used when compiling the factory were;

  compilers: {
    solc: {
      version: "0.8.3",
      settings: {
        optimizer: {
          enabled: true,
          runs: 1,
        },
      },
    },
  },

I tried using truffle-plugin-verify and directly on etherscan using standard json taken from solt output neither worked.

Any help / direction would be greatly appreciated.

Cheers,

Jason

Hi, welcome! :wave:

There is a tutorial, maybe it can help you, please have a check.

@Skyge thank you for the link :slight_smile: I have read through that article and used a similar approach to verify the factory and implementation code. I was not able to get that approach to work with the proxy itself.

I was able to get it verified, I used truffle verify to get the proper standard json file. Solt which I used previously generated one with multiple files and truffle verify outputs a single file. This gave me the correct bytes for the contract and I was able to locate the arguments from the suggested contracts on the etherscan page.