#etk #ethereum

bin+lib etk-4byte

EVM Toolkit function selector database

3 unstable releases

0.3.0 Aug 4, 2023
0.2.1 May 6, 2022
0.2.0 May 5, 2022

#2 in #etk

Download history 7/week @ 2023-10-31 7/week @ 2023-11-07 9/week @ 2023-11-14 8/week @ 2023-11-21 19/week @ 2023-11-28 7/week @ 2023-12-05 5/week @ 2023-12-12 11/week @ 2023-12-19 10/week @ 2023-12-26 3/week @ 2024-01-02 8/week @ 2024-01-09 5/week @ 2024-01-16 10/week @ 2024-01-23 12/week @ 2024-01-30 8/week @ 2024-02-06 27/week @ 2024-02-13

57 downloads per month
Used in etk-dasm

MIT/Apache

10MB
115 lines

etk-4byte

Ethereum function selector reverse lookup database, populated from 4byte.directory.

Updating the Database

Since etk-4byte is a purely offline database, it needs regular updates. To fetch the latest database and convert it to the expected format, run:

$ cargo run --features=generate --bin etk-4byte-generate > src/signatures.txt
$ cargo run --features=generate --bin etk-4byte-pack

Then recompile.


lib.rs:

EVM Toolkit Function Selector Database.

To roughly quote 4byte.directory:

Function calls in the Ethereum Virtual Machine are specified by the first four bytes of data sent with a transaction. These function selectors are defined as the first four bytes of the Keccak-256 hash of the canonical representation of the function signature. Since this is a one-way operation, it is not possible to derive the human-readable representation of the function (signature) from the four byte selector. This database is meant to allow mapping those bytes signatures back to their human-readable versions.

Dependencies

~6–19MB
~307K SLoC