Skip to content

🏦 SigBank - A Database of Smart Contract Function Signatures

Notifications You must be signed in to change notification settings

tintinweb/sigbank

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

12 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SigBank - A Database of Smart Contract Function Signatures

🏦 SigBank is a database of smart contract function signatures for the Ethereum ecosystem. Function signatures are extracted from the πŸ¦πŸŒ΄πŸŒ΄πŸŒ΄πŸ¦• smart-contract-sanctuary dataset.

image

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).

Β 

πŸ“ˆ Stats

Latest Snapshot

Date:                  Feb 17 2023
Database Size:               96 MB
Distinct Signatures:       924.244
Distinct SignatureHashes:  924.117
SignatureHash Collisions:      118

πŸŽ“ Getting Started

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%";
image
πŸ”Έ Function Signature Sorted by Hash
SELECT sighash, signature
FROM signatures
ORDER BY sighash;
image
πŸ”Έ Find Colliding Sighashes
SELECT 
    sighash,
    signature,
    COUNT(sighash) as `cnt`
FROM signatures
GROUP by sighash
HAVING cnt > 1
order by cnt DESC
image

Β 

πŸ’‘ FAQ

πŸ”Έ How to build the database from scratch?
  1. clone the πŸ¦πŸŒ΄πŸŒ΄πŸŒ΄πŸ¦• smart-contract-sanctuary
  2. ensure submodules are all checked out, else run git submodule init [ethereum|polygon|...] --depth=1
  3. 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

Β 

πŸ“š Other Datasets

πŸ‘©β€πŸ”¬ Data Science Tools

πŸŽ“ Citation

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}} 

About

🏦 SigBank - A Database of Smart Contract Function Signatures

Topics

Resources

Stars

Watchers

Forks