1

I have an abi file with lot of functions for a large contract. It would really take a lot of time to generate by hand the hash of each functions/methods.

Since the source code isn’t public, how to automatically get the full list of function selectors for such file (with the aim of getting function name for each selector hash) ?

1

The ABI can be converted to a Solidity interface which contains all of the function names:

|improve this answer|||||
  • Doesn’t this requires having a pragma about the compiler version specified in the ᴀʙɪ (which isn’t my case) ? – user2284570 Oct 5 '19 at 3:55
  • The data in an ABI is generic enough that interfaces can be generated to work with ^0.5.0 or ^0.4.22 (earlier if tuple types aren't used) – iamdefinitelyahuman Oct 6 '19 at 6:44
  • Isn’t there an a browser test page for abi2solidity? – user2284570 Oct 6 '19 at 14:14
  • Not that I'm aware of, sorry. – iamdefinitelyahuman Oct 6 '19 at 15:18

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.