0

I built out a script using web3js that will scrape data from specific contract ABIs. But, if the contract that is interacted with is utilizing a proxy contract it will pull the ABI of the proxy, not the actual implementation. This of course, causes an issue as it doesn't provide the right data return that's needed.

I'm looking for a way to pull the non-proxied contract ABI implementation, how can I accomplish this?

1

1 Answer 1

0

You can use this endpoint:

https://api.etherscan.io/api? 
   module=contract
   &action=getsourcecode
   &address=<address>?
   &apikey=<yourapikey>"

Which will return you a json object with an implementation field. If the field is empty, then you can use this endpoint for the official ABI:

https://api.etherscan.io/api
   ?module=contract
   &action=getabi
   &address=<address>
   &apikey=YourApiKeyToken

Otherwise, the field will give you the address where the official ABI is :)

1
  • This works. Thanks for the help!
    – vizzi
    Sep 16 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.