1

I have seen an Smart Contract that deploys new contracts, which are automatically verified in etherscan without doing anything special:

Contract contract = new Contract(a, b);

The contract is verified in Etherscan, and creates new contracts which are also verified. The project is built with Hardhat and I have been playing with it, deploying the first contract (which deploys contracts), but when I create a new contract it is not verified...

I have been researching, but I do not see anything in internet about automatic verification of Smart Contracts deployed from another Smart Contract.

UPDATE (Solution):

I saw a hardhat verification script for an Smart Contract, deployed by the main contract. Once launched the script, next contract (deployed by the main contract) get automatically verified, because bytecode are same, just different param values. Once a child contract is verified, then next new created contracts are verified as well.

2

1 Answer 1

3

Contract verification is an off-chain process. For etherscan for instance, the code is stored by Etherscan and they just verify that the bytecode matches. You can create scripts off-chain however to listen for new contract events and then go and verify them for users. Here's the etherscan docs on doing it, also super helpful with deployment scripts in general too!

https://docs.etherscan.io/tutorials/verifying-contracts-programmatically

1
  • Thanks for the answer. I was aware of this method, but as far as I'm concerned the developer didn't deploy nothing apart of the Smart Contract, so I don't know where is happening the magic... Apr 25, 2022 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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