Coder Social home page Coder Social logo

tintinweb / smart-contract-vulndb Goto Github PK

View Code? Open in Web Editor NEW
175.0 3.0 19.0 65.19 MB

๐Ÿ‹ An open dataset containing smart contract audit issues from various sources.

Home Page: https://tintinweb.github.io/smart-contract-vulndb/

JavaScript 78.51% CSS 21.49%
smart-contract-security vulnerabilities

smart-contract-vulndb's Introduction

The Creed Rebellion!
[ ๐ŸŒ ๐Ÿซ‚ ]

Smart Contract VulnDB

An open dataset of publicly available smart contract issues aggregated from various audit reports. The dataset can be accessed at ๐ŸŒป vulns.json, is updated once a day, and a live demo is available ๐ŸŒ here.

LMK if you're building cool things with this dataset and I'll list them here ๐Ÿ˜Š๐Ÿ™

๐Ÿ”ธ DataSet

โš ๏ธ NOTE: Breaking Change due to GIT Large File Policy Switching from one big vulns.json to files a 25k issues vulns-1.json, vulns-2.json, ...

image

const issue: Issue = {
  title: "<string:title>",
  severity: Severity.Medium,
  body: "<markdown-string:description>",
  dataSource: {
    name: "<string:path-like-report-identifier>",
    repo: "<string:git-or-http-url>",
    url: "<string:url>"
  }
};

To work around GitHub File Size Limits we'll split the database into equal files of 25k issues

๐Ÿ”ธ Live Demo

image

๐Ÿ”ธ Accessing the Latest Snapshot

  • Shell
โ‡’  curl https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-1.json
โ‡’  curl https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-2.json
  • JavaScript
const all_issues = []
for(let idx=1; idx<10; idx++){
  try {
    const all = await (await fetch(`https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-${idx}.json`)).text();
    for(let line of all.split("\n")){
      if(line.trim().length == 0){
        continue;
      } 
      try{
        all_issues.push(JSON.parse(line))
      } catch(e){
        console.log(line)
        throw e
      }
    }
} catch (e){
    console.log(e)
    break;
  }
}
  • JavaScript Local
const fs = require("fs")
let issues = [];
for(let idx=1; idx<10; idx++){
  if(!fs.existsSync(`./dataset/vulns-${idx}.json`)) {
    break;
  }
  const data = fs.readFileSync(`./dataset/vulns-${idx}.json`, "utf-8");
  const part = data.split('\n').filter(l => l.trim().length > 0).map(l => JSON.parse(l))
  issues = [...issues, ...part]
}
console.log(issues.length)
// 39125
[... new Set(issues.map(i => i.severity))]
/*
[
  'medium',   'minor',
  null,       'major',
  'critical', undefined,
  'info'
]
*/

๐Ÿค“ For Nerds

First, run the development server:

npm run dev
# or
yarn dev

Open http://localhost:3000 with your browser to see the result.

๐ŸŽ“ Citation

If you are using this dataset in your research and paper, here's how you can cite this dataset:

  • APA6
Ortner, M. (n.d.). Smart Contract VulnDB. Retrieved from https://github.com/tintinweb/smart-contract-vulndb.
  • LateX (Bib)
 @article{smart_contract_vulndb, 
          title={Smart Contract VulnDB}, 
          url={https://github.com/tintinweb/smart-contract-vulndb}, 
          author={Ortner, Martin}} 

smart-contract-vulndb's People

Contributors

shayanb avatar tintinweb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

smart-contract-vulndb's Issues

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.