r/Harmony_Devs • • Jun 15 '22

Question How to get contract ABI programatically?

Hello, I'm trying to get a contract ABI programatically, just like I usually do for Ethereum Mainnet and Arbitrum One, eg:

- https://api.etherscan.io/api?module=contract&action=getabi&address=0x2E645469f354BB4F5c8a05B3b30A929361cf77eC

- https://api.arbiscan.io/api?module=contract&action=getabi&address=0xe592427a0aece92de3edee1f18e0157c05861564

I tried using the URLs specified here https://docs.harmony.one/home/developers/api, but none seem to work for this contract https://explorer.harmony.one/address/0x35d112044d174dd16fee24d5c5cab24f4f81cb41.

Does Harmony One have support for this?

Thanks in advance! :)

1 Upvotes

2 comments sorted by

2

u/SlightAddress Jun 16 '22

There is an API you can call if it is uploaded and verified with Harmony.

I have an example here:

https://github.com/johnashu/web3_base/blob/59d4aa1d1b3f2ecc07f605f476464fa6a1d3b844/web3_base.py#L34

1

u/AutoModerator Jun 15 '22

THIS IS NOT AN IMMEDIATE SOLUTION OUTLET. For time-sensitive questions or prompt response needs please go to our Live Chat based on Discord found By Clicking Here This sub is for building a dev community legacy through tutorials, general non-time-sensitive questions, conceptual discussions, news promotion, project releases, for-hire/is-hiring, and anything that builds a robust community resiliency.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.