|
--- |
|
license: mit |
|
configs: |
|
- config_name: vulnerable-w-explanations |
|
data_files: db-vulnerable.csv |
|
default: true |
|
- config_name: verified-functions |
|
data_files: db-verified.csv |
|
language: |
|
- en |
|
tags: |
|
- finance |
|
pretty_name: Smart Contract Vulnerabilities with Explanations |
|
size_categories: |
|
- 1K<n<10K |
|
--- |
|
|
|
# Smart Contract Vulnerabilities with Explanations (`vulnerable-w-explanations`) |
|
|
|
This repository offers two datasets of `Solidity` functions, |
|
This dataset comprises vulnerable `Solidity` functions audited by 5 auditing companies: |
|
- [Codehawks](https://www.codehawks.com/) |
|
- [ConsenSys](https://consensys.io/) |
|
- [Cyfrin](https://www.cyfrin.io/) |
|
- [Sherlock](https://www.sherlock.xyz/) |
|
- [Trust Security](https://www.trust-security.xyz/) |
|
|
|
These audits are nicely compiled by [Solodit](https://solodit.xyz/). |
|
|
|
## Fields |
|
1. `name` - Title of audit report |
|
2. `severity` - Severity of vulnerabiliy (`Low`, `Medium`, `High`) |
|
3. `description` - Description/Explanation of the vulnerability |
|
4. `recommendation` - Recommended mitigation of the vulnerability |
|
5. `impact` (Optional) - Explains how the vulnerability affects the smart contract |
|
6. `function` - Raw vulnerable *solidity* code (*Sometimes this could be inaccurate. Best efforts were made to clean-up the dataset but some rows might include other programming languages e.g. javascript*) |
|
|
|
# Verified functions (`verified-functions`) |
|
|
|
This repository also includes a dataset with functions with no known vulnerabilities. They were scraped-off from [Etherscan](https://etherscan.io). |
|
|
|
Specifically, the functions are a part of the top 500 auditted contracts holding at least `1 ETH`. |
|
|
|
## Fields |
|
1. `function` - Raw solidity code |
|
|
|
# Usage |
|
|
|
```python |
|
from datasets import load_dataset |
|
dataset = load_dataset("msc-smart-contract-audition/vulnerable-functions-base", escapechar='\\') |
|
``` |
|
|
|
# Additional Info |
|
|
|
This dataset serves as basis for the other datasets in this family which are built for tasks s.a. Classification or Seq2Seq generation. |
|
|