0

I want to deploy a contract via the clone factory pattern described here

Is there a way to verify the child cloned contract (preferably via CLI) on etherscan? I know for proxy contracts generally it was only possible via the etherscan interface directly.

It also mentions this but not sure if this holds:

Etherscan verification doesn't work yet

1 Answer 1

0

You can use hardhat-etherscan task to verify contracts on etherscan and co.

Put the source code of the contract in contracts folder. Compile it with npx hardhat compile. Configurate the Etherscan's task by defining the API Key.

npx hardhat verify --network mainnet 0xAddress

It fetches the ByteCode of the Contract and if it matches one of the compiled contracts, then the source code will be uploaded to the Etherscan.

With the plugin, you can also set the constructor arguments, which were used to create the contract.

If the arguments are complex, the hardhat-etherscan requires additional js module, which exports those values. But you can also automate the creation of that module file.

2
  • but does this work specifically with proxy contracts? The verification isn't as straightforward as for regular contracts (ie the process you described).
    – YBM
    Jan 11, 2023 at 16:58
  • Actually, the proxy contract verification is the same as the regular contracts. If you mean, the Proxy Tab is missing, means Etherscan couldn't automatically detect current implementation address. Then you just have to call the API manually. docs.etherscan.io/api-endpoints/… It triggers automatic detection again, optionally you can provide the expected implementation address.
    – tenbits
    Jan 11, 2023 at 17:24

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.