| | --- |
| | dataset_name: Smart Contract Intent & Vulnerability Dataset |
| | pretty_name: Smart Contract Intent and Vulnerability Dataset |
| | language: |
| | - code |
| | task_categories: |
| | - text-classification |
| | size_categories: |
| | - 50K-100K |
| | license: mit |
| | multilinguality: monolingual |
| | --- |
| | |
| | # Smart Contract Intent & Vulnerability Dataset |
| |
|
| | This dataset contains a large-scale collection of smart contracts annotated with **malicious intents** and **security vulnerabilities**, designed for research on smart contract security analysis and program understanding. |
| |
|
| | The dataset includes **90,000+ smart contracts** collected from **Ethereum** and **Binance Smart Chain (BSC)**. All data are distributed as a **MySQL database dump** (`.sql.gz`) to support flexible querying and large-scale analysis. |
| |
|
| | ## Dataset Structure |
| |
|
| | The dataset consists of a single MySQL database with **three tables**: |
| |
|
| | - **`contracts`**: Main table containing smart contract source code (Solidity) and basic metadata (e.g., contract address and chain). |
| | - **`tokens`**: Intent annotations for token-related smart contracts. |
| | - **`vulnerabilities`**: Vulnerability annotations for smart contracts. |
| |
|
| | The `contracts` table serves as the primary table and is referenced by both `tokens` and `vulnerabilities`. |
| |
|
| | ## Smart Contract Intent Annotations |
| |
|
| | The `tokens` table labels token contracts with one or more intent categories that describe potentially malicious or risky behaviors. |
| |
|
| | | Intent Type | Explanation | Num | |
| | |------------|------------|-----| |
| | | Fee | Arbitrarily modifies transaction fees and redirects them to specific addresses | 33,268 | |
| | | DisableTrading | Enables or disables trading functionality | 6,617 | |
| | | Blacklist | Restricts designated users from trading or transferring tokens | 4,729 | |
| | | Reflection | Redistributes transaction taxes to token holders | 46,452 | |
| | | MaxTX | Limits maximum transaction volume or frequency | 17,043 | |
| | | Mint | Allows minting of new tokens (controlled or unlimited) | 10,572 | |
| | | Honeypot | Prevents users from selling tokens after purchase | 290 | |
| | | Reward | Distributes rewards to incentivize participation | 4,178 | |
| | | Rebase | Algorithmically adjusts token supply | 659 | |
| | | MaxSell | Restricts selling volume or timing | 68 | |
| |
|
| | ## Smart Contract Vulnerability Annotations |
| |
|
| | The `vulnerabilities` table provides labels for well-known smart contract security issues. |
| |
|
| | | Vulnerability Type | Num | |
| | |-------------------|-----| |
| | | Block Number Dependency (BN) | 116 | |
| | | Timestamp Dependency (TP) | 214 | |
| | | Dangerous Delegatecall (DE) | 48 | |
| | | Ether Frozen (EF) | 57 | |
| | | Ether Strict Equality (SE) | 45 | |
| | | Integer Overflow (OF) | 23 | |
| | | Reentrancy (RE) | 103 | |
| | | Unchecked External Call (UC) | 113 | |
| |
|
| | ## Data Format and Usage |
| |
|
| | - **Format**: MySQL database dump (`.sql`, compressed as `.sql.gz`) |
| | - **Language**: Solidity smart contracts |
| | - **Encoding**: UTF-8 |
| |
|
| | To use the dataset, import it into a MySQL database. |
| |
|
| | ```sql |
| | CREATE DATABASE web3; |
| | ```` |
| |
|
| | ```bash |
| | gunzip web3_all.sql.gz |
| | mysql -u <username> -p web3 < web3_all.sql |
| | ``` |
| |
|
| | After import, the database will contain the following tables: |
| |
|
| | * `contracts` |
| | * `tokens` |
| | * `vulnerabilities` |
| |
|
| | ## Preprocessing |
| |
|
| | Newline (`\n`) and tab (`\t`) characters in smart contract source code were normalized to a single whitespace to ensure consistency in the input format. This normalization does not change the semantic content and is commonly used in smart contract understanding tasks. |
| |
|
| | ## Intended Use |
| |
|
| | This dataset is intended for research on: |
| |
|
| | * Smart contract intent detection |
| | * Vulnerability detection and analysis |
| | * Malicious behavior classification |
| | * Large-scale empirical studies on smart contract security |
| |
|