File size: 2,401 Bytes
b7b5c01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7803d64
b7b5c01
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
---
language:
- en
license: mit
tags:
- smart-contracts
- blockchain
- vulnerability-detection
- text-classification
- graph-classification
pretty_name: SmartMalDB
size_categories:
- 10K<n<20K
task_categories:
- text-classification
- feature-extraction
---

# SmartMalDB

## Dataset Description

- **Homepage:** [Add if applicable]
- **Repository:** [[Add GitHub link if public](https://github.com/williamAdson)]
- **Paper:** [Add if applicable]
- **Point of Contact:** Banda William

### Summary

SmartMalDB is a labeled dataset for **smart contract vulnerability classification**. It contains 17,160 smart contract samples, each represented across multiple formats: source code, bytecode, opcode sequences, and control flow graph (CFG) features. The dataset supports both traditional text-based classification and graph-based deep learning approaches.

Vulnerability types include:
- `0` — Clean (no vulnerability)
- `1` — Time manipulation (e.g, block timestamp dependencies)
- `2` — Reentrancy (e.g, External calls before state updates)
- `3` — External (e.g., unchecked external calls)
- `4` — Overflow (e.g, unchecked arithmetic operations)
- `5` — Locked (e.g., lack withdraw or strict balance comparisons)

### Supported Tasks and Leaderboards

- **Text-based vulnerability classification** using `code`, `bytecode`, or `opcode` fields.
- **Graph-based vulnerability classification** using CFG nodes, edges, adjacency matrices, or density features.
- **Multi-modal classification** combining code and structural features.

No official leaderboard is currently available.

### Languages

All smart contract source code is in **Solidity** (English-based syntax). Labels and documentation are in English.

## Dataset Structure

### Data Instances

Example from the dataset:

```json
{
  "code": "pragma solidity ^0.8.0; contract Safe {...}",
  "bytecode": "608060405234801561001057...",
  "opcode": "PUSH1 0x80 PUSH1 0x40 MSTORE...",
  "label": "clean",
  "label_encoded": 0,
  "cfg": "{...}",
  "adj_matrix": "[[0,1,0],[1,0,1],[0,1,0]]",
  "cfg_dot": "digraph G {...}",
  "cfg_nodes": 12,
  "cfg_edges": 15,
  "cfg_density": 0.1136
}
```

## Citations
If you use this dataset, please cite:

```bibtex
@misc{smartmaldb25,
  author = {B. William},
  title = {SmartMalDB},
  year = {2025},
  publisher = {Hugging Face},
  url= {https://huggingface.co/datasets/Adson59/smartmaldb},
}
```