volsa / etherface

Ethereum Signature Database
https://www.etherface.io
GNU General Public License v3.0
171 stars 22 forks source link

Event Signature Indexing Update --> Record Param Names and Indexed Fields as well #25

Open maharshi365 opened 3 months ago

maharshi365 commented 3 months ago

Hi,

Would it be possible to add the param information as well as the indexed information to the signatures that are being stored. For example if we look up a generic ERC20 Transfer on etherface we see the following:

Search: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef Result: Transfer(address,address,uint256)

I think it would be better to store the additional information to help make decoding uses cases easier. Below is what I suggest.

Search: 0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef Result: Transfer(address indexed from, address indexed to, uint256 value)

volsa commented 3 months ago

Technically it's pretty easy to implement (see this part) but two things that immediately come to mind

  1. How would you deal with identical signatures but different parameter names, e.g. foo(address a), foo(address b), foo(address c) and so on. Do you just return all possible parameter names (a, b, c,...)?
  2. Implementing this feature at this stage means the metadata of scraped signatures in the database becomes inconsistent, i.e. every new signature will have that extra information regarding parameter names but all previously scraped signatures won't. You could re-download and re-scrape all Solidity files stored in the database to fill these gaps but I'm not sure if it's worth the effort.

Anyhow, I won't work on this mainly because of lack of time and motivation (as can be seen by the amount of open issues). However, I'd be happy to merge any PR if you feel motivated enough.