π¦ SigBank is a database of smart contract function signatures for the Ethereum ecosystem. Function signatures are extracted from the π¦π΄π΄π΄π¦ smart-contract-sanctuary dataset.
Best effort, no guarantees on accuracy & completeness. Just signatures, lot's of signatures ...
β What is a function signature and function selector in solidity (and EVM languages).
Β
Date: Feb 17 2023
Database Size: 96 MB
Distinct Signatures: 924.244
Distinct SignatureHashes: 924.117
SignatureHash Collisions: 118
Download the latest Database Snapshot (under 'Assets'). Use your favorite sqlite3
explorer/query tool to explore.
πΈ Lookup Sighashes starting with 0x000000..
SELECT sighash, signature
FROM signatures
WHERE sighash LIKE "000000%";
πΈ Find Colliding Sighashes
SELECT
sighash,
signature,
COUNT(sighash) as `cnt`
FROM signatures
GROUP by sighash
HAVING cnt > 1
order by cnt DESC
Β
πΈ How to build the database from scratch?
- clone the π¦π΄π΄π΄π¦ smart-contract-sanctuary
- ensure submodules are all checked out, else run
git submodule init [ethereum|polygon|...] --depth=1
- run the signature extraction tool on all solidity files. hint: split up the work, run multiple processes and let them feed into the same database.
here's an example:
β‘ β git clone --recursive --depth1 https://github.com/tintinweb/smart-contract-sanctuary
β‘ β node _utils/signatures/signatures.js "./smart-contract-sanctuary/**/*.sol"
πΈ How to dump the database into a well formed file-system structure?
β‘ β node _utils/signatures/exportToFs.js
Β
- π Sourcegraph:sigbank - A powerful online code search service that can be used to quickly search for hashes or signatures in sigbank.
- π Sourcegraph:smart-contract-sanctuary - A powerful online code search service that can be used to search the sanctuary without cloning.
If you are using this dataset in your research and paper, here's how you can cite this dataset:
- APA6
Ortner, M., Quelquejay, V. (n.d.). SigBank - A Database of Smart Contract Function Signatures. Retrieved from https://github.com/tintinweb/sigbank.
- LateX (Bib)
@article{sigbank,
title={SigBank - A Database of Smart Contract Function Signatures},
url={https://github.com/tintinweb/sigbank},
author={Ortner, Martin and Quelquejay, Valentin}}