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

View all comments

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