Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed because of a cast error
Error code:   DatasetGenerationCastError
Exception:    DatasetGenerationCastError
Message:      An error occurred while generating the dataset

All the data files must have the same columns, but at some point there are 5 new columns ({'cfg_nodes', 'cfg_edges', 'cfg_density', 'adj_matrix', 'cfg_dot'})

This happened while the csv dataset builder was generating data using

hf://datasets/Adson59/smartmaldb/semo_smartmaldb_v700.csv (at revision 153ef764e2fd91fa1a2e95851858185fa9ae04fd), ['hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/semo_smartmaldb_binary.csv', 'hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/semo_smartmaldb_v700.csv', 'hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/smartmaldb_graph.csv']

Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1800, in _prepare_split_single
                  writer.write_table(table)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 765, in write_table
                  self._write_table(pa_table, writer_batch_size=writer_batch_size)
                File "/usr/local/lib/python3.12/site-packages/datasets/arrow_writer.py", line 773, in _write_table
                  pa_table = table_cast(pa_table, self._schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2321, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2249, in cast_table_to_schema
                  raise CastError(
              datasets.table.CastError: Couldn't cast
              code: string
              bytecode: string
              opcode: string
              label: string
              label_encoded: int64
              cfg: string
              adj_matrix: string
              cfg_dot: string
              cfg_nodes: int64
              cfg_edges: int64
              cfg_density: double
              semoCFG: string
              -- schema metadata --
              pandas: '{"index_columns": [{"kind": "range", "name": null, "start": 0, "' + 1638
              to
              {'code': Value('string'), 'bytecode': Value('string'), 'opcode': Value('string'), 'label': Value('string'), 'label_encoded': Value('int64'), 'cfg': Value('string'), 'semoCFG': Value('string')}
              because column names don't match
              
              During handling of the above exception, another exception occurred:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1342, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 907, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1802, in _prepare_split_single
                  raise DatasetGenerationCastError.from_cast_error(
              datasets.exceptions.DatasetGenerationCastError: An error occurred while generating the dataset
              
              All the data files must have the same columns, but at some point there are 5 new columns ({'cfg_nodes', 'cfg_edges', 'cfg_density', 'adj_matrix', 'cfg_dot'})
              
              This happened while the csv dataset builder was generating data using
              
              hf://datasets/Adson59/smartmaldb/semo_smartmaldb_v700.csv (at revision 153ef764e2fd91fa1a2e95851858185fa9ae04fd), ['hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/semo_smartmaldb_binary.csv', 'hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/semo_smartmaldb_v700.csv', 'hf://datasets/Adson59/smartmaldb@153ef764e2fd91fa1a2e95851858185fa9ae04fd/smartmaldb_graph.csv']
              
              Please either edit the data files to have matching columns, or separate them into different configurations (see docs at https://hf.co/docs/hub/datasets-manual-configuration#multiple-configurations)

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

code
string
bytecode
string
opcode
string
label
string
label_encoded
int64
cfg
string
semoCFG
string
pragma solidity ^0.4.25; library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { assert(b > 0); // Solidity automatically thro...
73000000000000000000000000000000000000000030146080604052600080fd00a165627a7a7230582009c6a6c7c61ba3509bf2dda47845f341ae5e01bff84a90a39ddf38fd02bd6d470029
PUSH20 ADDRESS EQ PUSH1 PUSH1 MSTORE PUSH1 DUP1 REVERT STOP LOG1 PUSH6 SHA3 MULMOD INVALID INVALID INVALID INVALID SHL LOG3 POP SWAP12 CALLCODE INVALID LOG4
benign
0
{'blocks': [[{'address': 0, 'opcode': 'PUSH20', 'args': ''}, {'address': 1, 'opcode': 'ADDRESS', 'args': ''}, {'address': 2, 'opcode': 'EQ', 'args': ''}, {'address': 3, 'opcode': 'PUSH1', 'args': ''}, {'address': 4, 'opcode': 'PUSH1', 'args': ''}, {'address': 5, 'opcode': 'MSTORE', 'args': ''}, {'address': 6, 'opcode':...
eJzNWV2PojAU/SuGZ7PxFgTdN1ab0QTF4WN2ko0hrrAOuypGMGZ34n/fFpXW0WibmDoPRjn2XA7t6T2g79oyi5Nc+1r78a6lMXlv1GslFhV/Vwk51twR9uyg7w418k22mpLvKDwK/R5qUOxXMik267IIqZFH08l8fihEjvIiW09mCQN+bxYrdlQk60W6nHCEabaM0yLNDuBuV68dpIGgNLvb9bDvK9WGBLXhZ6WydInVBKXKjE+rrCmobOAHroeVSjM/7aRZgsq64UitsJagMA+/YC+4pzS4Ja0tKI34bKRUGIiGgOM+qV1NEM0AugNM...
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 ...
606060405236156100b8576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631f2698ab146100ca578063315a095d146100f457806336044ecc146101145780634042b66f1461014a578063521eb2731461017057806388adbf8f146101c257806391b7f5ed1461021457806398b9a2dc14610234578063a035b1fe1461026a578063b66a0e5d146102...
PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ P...
benign
0
{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args': ''}, {'address': 2, 'opcode': 'MSTORE', 'args': ''}, {'address': 3, 'opcode': 'CALLDATASIZE', 'args': ''}, {'address': 4, 'opcode': 'ISZERO', 'args': ''}, {'address': 5, 'opcode': 'PUSH2', 'args': ''}, {'address': 6, '...
eJzNnW2THbeRpf+Kg58dExdvCWC/taUemRsUKfNFVtjhYGgsjke7tuSw5HDMOvzf9ybunVunuk0qT0lO4ItmTHahwaqTSAAPDvLvT7759qt33z35Xz/77d+ffP3V+f+efv6z8Wdvv//vP787/+8nLz67f3n3+umL50/Of/Ptn39//jv948/evPpl0D/6z3dffv/Xv4w2zk189/b3X/7xj9d2zv/ru++//cuXf3i3/cH/+euf/rz9r+/f/eVPX3/zJTzw+2+/+err77/+9vqH//jHz3927VlYtmfR2LNPX71+8fLetWvJ2LWP7p49+/ju...
pragma solidity ^0.4.11; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 ...
60606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005157806370a0823114610077578063a9059cbb146100c1575bfe5b341561005957fe5b610061610118565b6040518082815260200191505060405180910390f35b341561007f57fe5b6100ab600480803573ffffffffffffffffffffffffffffffffffffffff169060...
PUSH1 PUSH1 MSTORE PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI DUP1 PUSH4 EQ PUSH2 JUMPI JUMPDEST INVALID JUMPDEST CALLVALUE ISZERO PUSH2 JUMPI INVALID JUMPDEST PUSH2 PUSH2 JUMP JUMPDEST PUSH1 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 ADD SWAP2 POP POP PUSH1 MLOAD DUP1 SWAP...
benign
0
{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args': ''}, {'address': 2, 'opcode': 'MSTORE', 'args': ''}, {'address': 3, 'opcode': 'PUSH1', 'args': ''}, {'address': 4, 'opcode': 'CALLDATALOAD', 'args': ''}, {'address': 5, 'opcode': 'PUSH29', 'args': ''}, {'address': 6, '...
eJzNnW1vHUUShf8K8ucVmqqa1/12Id7glYmD7YAEQlFIvGx2yYuSILSL+O87XWTd5xIF6gxQPZ/A13fGnZnTXd311On+8eT5iyc3r0/++sFXP548fbL+t/vLB/7Zwzf/eXmz/nxycf/08nB9dnHvZP3Ni5eP19+Vj+8/uPpEykf/uHn05vtXfo/1Fq8fPn703Xdv77P+9PrNi1ePvr2pH/zr+2cv609vbl49e/r8EVzw+MXzJ0/fPH3x9sOffvrLB29bJrttmQZb9unV9cXlaWrTbLcPrQ+27OPD+fmdw/Xh/OJwJ7WBA/HodElt2hhs...
"pragma solidity ^0.4.19;\n\ncontract CrowdsaleTokenInterface {\n\n uint public decimals;\n \n f(...TRUNCATED)
"60606040526004361061021a576000357c0100000000000000000000000000000000000000000000000000000000900463f(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzMvW+vJ8lxnflVDL42Fjf/VtW+u5xpDHvRM01N94y5NBaEVuLaWtiWINFYLAx/d1dT1/eevi2T54SaceKVoaFvIbp+mRmZ8eR(...TRUNCATED)
"pragma solidity ^0.4.18;\n\n/**\n * @title ERC20Basic\n * @dev Simpler version of ERC20 interface\n(...TRUNCATED)
"606060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463f(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzNnV+PHMeRxL+KwGfDmMys+Xdva3Ml72HFlblL6WxDIGiRp+OdRAoiBcEn6LvfVJDHigFBK6MlZ/WTzd2Z3lJ3VGVV/jKyf7r(...TRUNCATED)
"contract MPO { \n\tuint256 public reading;\n\tuint256 public time;\n\taddress public operator; \n\t(...TRUNCATED)
"6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463f(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzN3VsPJMdxJeC/YvDZMDrvmfs2NscUFyOOxBnSWhkCIYtcLXclUbBoGLuC/vt2Rra7Tw85YpwwHZkvvpDTNcXuqMqq/PJk/Pm(...TRUNCATED)
"pragma solidity ^0.4.24;\n \nlibrary SafeMath {\n function mul(uint a, uint b) internal returns (u(...TRUNCATED)
"6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463f(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzM3VvvJVlSJfivgvK5NYpttq/zFpChJEdRFUXeBlVrhGioZhjRgKBaoxHiu8/J4vT5r8h8YNlSltl+SkVEumvLj7nvy8+X73/(...TRUNCATED)
"pragma solidity ^0.4.16;\n\ncontract Owned {\n\taddress public owner;\n\taddress public signer;\n\n(...TRUNCATED)
"606060405236156100ad576000357c0100000000000000000000000000000000000000000000000000000000900463fffff(...TRUNCATED)
"PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND DU(...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzN3V2zLclRJui/gum6rW15fMfcFeigrrFCBfUhmMYwmRppGM2AhCG1YT0Y/31WeOzZ+11VCPnrCI+4KVDpZJ5ULs+MzHjyDf+(...TRUNCATED)
"pragma solidity ^0.4.16;\ncontract Token{\n uint256 public totalSupply;\n\n function balanceO(...TRUNCATED)
"60606040523615610097576000357c0100000000000000000000000000000000000000000000000000000000900463fffff(...TRUNCATED)
"PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND DU(...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzN3V/TJLd1HvCv4uK1yzXAwd/crc01vakVV14uaccuF0sWGYWJJKpEulSOSt89g4PJzDNLrXQemDrAjRNLb/fCPacb3fjhAX7(...TRUNCATED)
"pragma solidity ^0.4.24;\n\ncontract DiaOracle {\n address owner;\n\n struct Coin(...TRUNCATED)
"60806040526004361061004c576000357c0100000000000000000000000000000000000000000000000000000000900463f(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
benign
0
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"eJzNnW+PXLeR9b+KoNfColkki937biL1Know1igzI8cbIxC8ljbrZxPbiB0Eu0a++3aVbN3TFizX6dhFvsmfUfcdzr3nssj68VR(...TRUNCATED)
End of preview.

SmartMalDB

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:

{
  "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:

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