0
votes

I want to deploy an ethereum smart contract and verify(reveal) its source code. Can I do it programmatically?

Usually I deploy a smart contract and verify it on etherscan.io. After the verification the source code is revealed. The task is that I need to deploy a lot of smart contracts but I can not verify them manually. Is there a way or API to upload the solidity code to reveal smart contract code to the public?

Though I guess the answer is "no" but still want to hear any ideas.

Thanks in advance

1
This isn't a satisfying answer at the moment, but github.com/ethpm/ethpm-spec is an attempt to solve this, with reproducible contract package compilations. github.com/ethpm/py-ethpm is one in-progress implementation of the spec. - carver

1 Answers

1
votes

Indeed, at the time of writing this, it seems like there's no public endpoint to do this. There's no mention of such contract verification endpoint in Etherscan documentation here https://etherscan.io/apis or here https://hexdocs.pm/etherscan/

Someone was asking the same thing on their subreddit just about a month ago, without much success

Etherscan is using Are you a robot? checkbox CAPTCHA upon verification. That one would be pretty hard to trick, not really worth trying. What you could do instead however is a partial automation of contract verification using Selenium.

Lets say you want to verify 20 contracts with minimal effort. It should be possible to write a script which would open up 20 tabs in browser, in each it would go to Etherscan, enter appropriate contract details for one of the contracts, but then let a human to handle the page with Are you a robot? captcha.