shazow / whatsabi

Extract the ABI (and resolve proxies, and get other metadata) from Ethereum bytecode, even without source code.
https://shazow.github.io/whatsabi/
MIT License
1.06k stars 74 forks source link

feature: Add stateMutability #17

Closed KingMaxime closed 1 year ago

KingMaxime commented 1 year ago

is there any way to get the stateMutability of a function whether it is view or nonpayable just like in standard abi?

shazow commented 1 year ago

Yup, coming up next release! I have some WIP in #14 if you want to sub to that. Just need to push the stateMutability improvements shortly.

KingMaxime commented 1 year ago

Okay nice. 👍 Great Job with this package save me a lot of work

Yup, coming up next release! I have some WIP in #14 if you want to sub to that. Just need to push the stateMutability improvements shortly.

shazow commented 1 year ago

Just merged #14 into master, would appreciate some testing/feedback before I do a release. There's some major changes:

In some cases, it manages to successfully guess whether there are inputs or outputs (not super reliable, I'd say like... 60%?), but there have been major changes behind the scenes with how the static analysis works so we can do more advanced things moving forward.

Also we now have stateMutability included in the ABI, which is reliable in detecting payable functions, but not reliable in distinguishing nonpayable vs view yet (no attemps to detect pure yet, probably too dangerous to be wrong?).

shazow commented 1 year ago

Next release issue is here: https://github.com/shazow/whatsabi/issues/18

shazow commented 1 year ago

Included in the latest release: https://github.com/shazow/whatsabi/releases