msc-smart-contract-audition/vulnerable-functions-base
收藏Hugging Face2024-05-04 更新2024-05-25 收录
下载链接:
https://hf-mirror.com/datasets/msc-smart-contract-audition/vulnerable-functions-base
下载链接
链接失效反馈官方服务:
资源简介:
---
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
---
These datasets serve as a basis for other datasets in this family which are built for tasks like *Classification* or *Seq2Seq generation*.
# 1. 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 compiled by [Solodit](https://solodit.xyz/).
## Usage
```python
from datasets import load_dataset
dataset = load_dataset(
"msc-smart-contract-audition/vulnerable-functions-base",
split='train',
escapechar='\\',
)
```
| Field | Description |
|-|-|
| 1. `name` | Title of audit report |
| 2. `severity` | Severity of vulnerability (`Low`, `Medium`, `High`) |
| 3. `description` | Description/Explanation of the vulnerability |
| 4. `recommendation` | Recommended mitigation of the vulnerability |
| 5. `impact` | Explains how the vulnerability affects the smart contract (Optional) |
| 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*) |
# 2. 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`.
## Usage
```python
from datasets import load_dataset
dataset = load_dataset(
"msc-smart-contract-audition/vulnerable-functions-base",
name="verified-functions",
split='train',
escapechar='\\',
)
```
| Field | Description |
|-|-|
| 1. `function` | Raw solidity code |
# Additional Info
- The newline characters are escaped (i.e. `\\n`)
- The dataset has a single split `train` (hence the adjusted loading isntructions).
提供机构:
msc-smart-contract-audition
原始信息汇总
数据集概述
1. Smart Contract Vulnerabilities with Explanations (vulnerable-w-explanations)
- 数据文件:
db-vulnerable.csv - 描述: 包含由五家审计公司审计的
Solidity函数,这些审计由Solodit编译。 - 字段:
name: 审计报告标题severity: 漏洞严重性(Low,Medium,High)description: 漏洞描述/解释recommendation: 漏洞的推荐缓解措施impact: 漏洞对智能合约的影响(可选)function: 原始的Solidity漏洞代码
2. Verified functions (verified-functions)
- 数据文件:
db-verified.csv - 描述: 包含无已知漏洞的
Solidity函数,这些函数从Etherscan抓取,属于至少持有1 ETH的前500个审计合约。 - 字段:
function: 原始的Solidity代码
数据集使用
- 加载示例:
-
vulnerable-w-explanations: python from datasets import load_dataset dataset = load_dataset( "msc-smart-contract-audition/vulnerable-functions-base", split=train, escapechar=, ) -
verified-functions: python from datasets import load_dataset dataset = load_dataset( "msc-smart-contract-audition/vulnerable-functions-base", name="verified-functions", split=train, escapechar=, )
-
附加信息
- 换行符被转义(例如
\n) - 数据集只有一个分割
train。



