Add dataset card
Browse files
README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- code
|
| 4 |
+
language_details: solidity
|
| 5 |
+
tags:
|
| 6 |
+
- smart-contracts
|
| 7 |
+
- security
|
| 8 |
+
- vulnerability-injection
|
| 9 |
+
license: mit
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# Smart Contracts with AST-Injected Vulnerabilities
|
| 13 |
+
|
| 14 |
+
This dataset contains **225300** Solidity smart contracts with injected vulnerabilities. The vulnerabilities were injected using an AST-level injection tool, targeting both single-point and coupled (multi-point) vulnerabilities.
|
| 15 |
+
|
| 16 |
+
## Dataset Structure
|
| 17 |
+
|
| 18 |
+
The data is provided in **Parquet** format.
|
| 19 |
+
|
| 20 |
+
### Schema
|
| 21 |
+
|
| 22 |
+
| Field | Type | Description |
|
| 23 |
+
| :--- | :--- | :--- |
|
| 24 |
+
| `filename` | string | Name of the injected Solidity file |
|
| 25 |
+
| `code` | string | The full source code of the injected contract |
|
| 26 |
+
| `source_contract` | string | Path/Name of the original clean contract |
|
| 27 |
+
| `vulnerability_type` | string | Type of vulnerability injected (e.g., reentrancy, lock) |
|
| 28 |
+
| `injection_mode` | string | `point` (single injection) or `coupled` (multiple injections) |
|
| 29 |
+
| `template_name` | string | Specific template used for injection |
|
| 30 |
+
| `solidity_version` | string | Solidity version of the contract |
|
| 31 |
+
| `injected_regions` | string | JSON string describing the start/end bytes of injected code |
|
| 32 |
+
| `subset` | string | Origin subset (`point` or `coupled`) |
|
| 33 |
+
|
| 34 |
+
## Statistics
|
| 35 |
+
|
| 36 |
+
### Total Files: 225300
|
| 37 |
+
|
| 38 |
+
### Vulnerability Distribution
|
| 39 |
+
|
| 40 |
+
| Vulnerability Type | Count |
|
| 41 |
+
| :--- | :---: |
|
| 42 |
+
| timestamp | 33175 |
|
| 43 |
+
| overflow | 32370 |
|
| 44 |
+
| unchecked_send | 32370 |
|
| 45 |
+
| tx_origin | 36574 |
|
| 46 |
+
| underflow | 21249 |
|
| 47 |
+
| unhandled_exception | 23601 |
|
| 48 |
+
| reentrancy | 19911 |
|
| 49 |
+
| lock | 6400 |
|
| 50 |
+
| tod | 2387 |
|
| 51 |
+
| dos | 4983 |
|
| 52 |
+
| access | 7326 |
|
| 53 |
+
| state | 4954 |
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
## Metadata
|
| 57 |
+
|
| 58 |
+
Detailed statistics are available in the repository root:
|
| 59 |
+
- [injected_sc_point_statistics.json](https://huggingface.co/datasets/minhnn32/sc-ast-injected/blob/main/injected_sc_point_statistics.json)
|
| 60 |
+
- [injected_sc_coupled_statistics.json](https://huggingface.co/datasets/minhnn32/sc-ast-injected/blob/main/injected_sc_coupled_statistics.json)
|
| 61 |
+
|
| 62 |
+
## Usage
|
| 63 |
+
|
| 64 |
+
```python
|
| 65 |
+
from datasets import load_dataset
|
| 66 |
+
|
| 67 |
+
dataset = load_dataset("minhnn32/sc-ast-injected")
|
| 68 |
+
print(dataset['train'][0])
|
| 69 |
+
```
|