Code Monkey home page Code Monkey logo

smartbugs-wild's Introduction

SmartBugs Wild Dataset

This repository contains 47,398 smart contracts extracted from the Ethereum network.

SmartBugs was used to analyze this dataset. The results are available at: https://github.com/smartbugs/smartbugs-results For more details on the analysis, please see the ICSE 2020 paper.

Structure of the repository

├─ contracts
│  └─ <contract_address>.sol
├─ contracts.csv.tar.gz # the meta data of all the contract
├─ script
│  ├─ get_contracts.py # collect the source code of the contracts from Etherscan
│  └─ get_balance.py   # collect the balance of the contracts from Etherscan

Creation of the dataset

  1. Collection of the contract addresses. We used Google BigQuery to select all the contracts that have at least one transaction. The collection was performed on the 8th of August 2019. We used the following request (also available here: https://bigquery.cloud.google.com/savedquery/281902325312:47fd9afda3f8495184d98db6ae36a40c)
SELECT contracts.address, COUNT(1) AS tx_count
  FROM `ethereum_blockchain.contracts` AS contracts
  JOIN `ethereum_blockchain.transactions` AS transactions 
        ON (transactions.to_address = contracts.address)
  GROUP BY contracts.address
  ORDER BY tx_count DESC
  1. Downloading the source code associated with the contract addresses. We used Etherscan to download the contracts (the script used for the collection is available in the folder script).
  2. We filtered the contracts by identifying and removing duplicates.

Metrics

Metric Value
Solidity source not available 1290074
Solidity source available 972855
Unaccessible 47
Invalid 120
Total 2263096
Unique Solidity Contracts 47398
LOC of the unique contracts 9693457

License

The license in the file LICENSE applies to all the files in this repository, except for all the files in the contracts folder. The files in this folder are publicly available, were obtained using the Etherscan APIs, and retain their original licenses. Please contact us for any additional questions.

smartbugs-wild's People

Contributors

jff avatar ruimaranhao avatar tdurieux avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.