PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, July 28, 2022

[FIXED] How to deploy and verify(public source code) ethereum smart contract programmatically?

 July 28, 2022     blockchain, ethereum, solidity     No comments   

Issue

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


Solution

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.



Answered By - Patrik Stas
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing