pipermerriam / ethereum-function-signature-registry

Registry of 4byte function signatures and their human readable counterparts.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement to get multiple hex signatures

naddison36 opened this issue · comments

Can Ethereum function signature registry be enhanced so multiple signatures can be returned for multiple hex signatures?

There's a number of ways this could be done. For example, introduced a new hex_signatures filter option that takes a comma separated list if hex signatures. eg
/api/v1/signatures/?hex_signatures=0xabcd1234,0x722713f7,0x20158c44,0x5c658165

For context, I'm writing a tool that will generate a sequence diagram of all the internal contract calls of a transaction. I need to resolve the function signatures of all the internal transactions hence I'd like to do that in one API call and not many.

Thanks
Nick

I recommend scraping the full API (please limit your concurrency to not overload the server) and just holding a cached copy of it in your application.

Otherwise, I'd be happy to review a pull request adding the requested functionality.

Thanks for the suggestion, @pipermerriam. I'm not a Python developer so I won't be able to do a PR but I can write something to scrape the data without killing the server.

@ligi ethereum-lists/4bytes is a good option. I was impressed that is was up to date but looking at the commits it looks like this is manually updated rather than regularly updated with an automated process.
Why use separate files for each signature? Some operating systems struggle when there's a large number of files in a folder.

Thanks for maintaining these repos

Nick

Ignore that last question @ligi. I now see it's a clever way of using GitHub as a web server. eg https://raw.githubusercontent.com/ethereum-lists/4bytes/master/signatures/a9059cbb

commented

Yea - IMHO the 4-byte directory is a crutch anyway - and there using github as a CDN worked OK for me. In an ideal world every contract would be verified/available on sourcify and you would access the ABI via IPFS - no more 4byte-list workaround ..