11

How do you properly verify a contract on etherscan that is deployed by another contact?

I deployed a contract that deploys other contracts onto the blockchain.

The original contract is verified , however when that contract deploys contract onto the blockchain, I am unable to verify the contract.

Can anyone help with this?

9

It is not possible as on 24th March 2018. Etherscan is unable to locate contract code on the address of subcontract.

Here is the transaction which deploys two contracts. But for the second contract, etherscan is unable to find contract code.

The second contract does exist and this was verified by using "at address" feature of remix. Until there are some updates to etherscan, it is not possible to verify the contract created by other contract.

  • 1
    Feb 2019, still not possible. – Paul Razvan Berg Feb 13 at 18:43
  • Rinkeby March 4th, 2019. Still not possible – MSwezey Mar 4 at 17:14
2

I have deployed a contract from another contract: https://etherscan.io/tx/0x8fd885ce7ad7b6a591d9614d41cbb1d97aa7d2e290f6aa52531ce3d4c799a5ff

which deployed: https://etherscan.io/address/0xb1400278014f34c8243b15613a4b463b51fb6f2a#code

and I was able to verify contract using the same compiler version and optimization. You have to encode all constructor arguments yourself though, using web3.eth.abi.encodeParameters

that's how I was able to verify it on etherscan.

  • It seems etherscan allows you to verify contracts deployed by contracts as long as constructor parameters are not dynamic length (string, bytes, uint[]). – MaciejGórski Jul 16 '18 at 0:44
  • 1
    Based on the most upvoted answer, there might be more conditions where etherscan fails. – MaciejGórski Jul 16 '18 at 0:55
0

Have never deployed a secondary contract, but I would imagine you could enter your "other" contract's source code into Solidity to retrieve the ABI needed for Etherscan.

From the Compile tab:

  1. Click Details
  2. Scroll down to Interface (ABI)
  3. Click on the icon Copy value to clipboard

You've stated that you've already verified the "original" contract, so I'm assuming you're okay with the rest of the steps on Etherscan.

  • Not sure where I would plug the ABI at etherscan.io/verifyContract The ABI it asks for are in bytecode format per the docs, the ABI that solidity browser gives is not in bytecode but rather something that looks like JSON. This is the actual contract I am trying to verify.. etherscan.io/address/… The actual inputs passed to the deployed contract as consructor arguments were the following parameters 1000000,0,MARIA CANJE,CANJE,0xfDDEdAaa4a86B0B68Fd85D77E8399D0Fe8264289 – Dino Anastos Oct 8 '17 at 14:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.