Dataset Viewer
Auto-converted to Parquet Duplicate
code
stringlengths
107
701k
bytecode
stringlengths
100
105k
opcode
stringlengths
63
138k
label
stringclasses
6 values
label_encoded
int64
0
5
cfg
stringlengths
588
1.29M
adj_matrix
stringclasses
264 values
cfg_dot
stringlengths
218
292k
cfg_nodes
int64
3
2.7k
cfg_edges
int64
2
3.4k
cfg_density
float64
0.67
1.42
pragma solidity ^0.4.10; contract GasToken2 { ////////////////////////////////////////////////////////////////////////// // RLP.sol // Due to some unexplained bug, we get a slightly different bytecode if // we use an import, and are then unable to verify the code in Etherscan //////////////...
0x606060405236156100ce576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100d3578063079d229f14610162578063095ea7b3146101b857806318160ddd1461021257806323b872dd1461023b578063313ce567146102b45780635f2e2b45146102e35780636366b9361461033d57806370a082311461037457806395d89b411461...
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...
overflow
4
{'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, '...
[[0. 1. 1. ... 0. 0. 0.] [0. 0. 1. ... 0. 0. 0.] [0. 0. 0. ... 0. 0. 0.] ... [0. 0. 0. ... 0. 1. 0.] [0. 0. 0. ... 0. 0. 1.] [0. 0. 0. ... 0. 0. 0.]]
digraph CFG { rankdir=UD; node [shape=box]; block_0 [label="PUSH1\nPUSH1\nMSTORE\nCALLDATASIZE\nISZERO\nPUSH2\nJUMPI"]; block_1 [label="PUSH1\nCALLDATALOAD\nPUSH29\nSWAP1\nDIV\nPUSH4\nAND\nDUP1\nPUSH4\nEQ\nPUSH2\nJUMPI"]; block_2 [label="DUP1\nPUSH4\nEQ\nPUSH2\nJUMPI"]; block_3 [label="DUP1\nPUSH4\nEQ\nPUSH2\nJUMPI"];...
266
317
1.191729
"pragma solidity ^0.4.20;// blaze it\r\n\r\ninterface ERC20 {\r\n function totalSupply() external(...TRUNCATED)
"0x6060604052600436106101715763ffffffff60e060020a6000350416631210265281146101765780631aa3a008146101a(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH4 PUSH1 PUSH1 EXP PUSH1 CALLDATALOAD DIV A(...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
644
809
1.256211
"pragma solidity ^0.4.24;\r\n\r\ninterface TokenReceiver {\r\n function tokenFallback(address from,(...TRUNCATED)
"0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH4 PUSH29 PUSH1 CALLDATALOAD DIV AND PUSH4 (...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
165
204
1.236364
"pragma solidity ^0.4.18;\r\n\r\ncontract DelegateERC20 {\r\n function delegateTotalSupply() public(...TRUNCATED)
"0x6060604052600436106101455763ffffffff60e060020a6000350416630581345e81146101525780630ce511791461017(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH4 PUSH1 PUSH1 EXP PUSH1 CALLDATALOAD DIV A(...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
435
558
1.282759
"pragma solidity ^0.4.18;\r\n\r\ncontract DelegateERC20 {\r\n function delegateTotalSupply() public(...TRUNCATED)
"0x60606040526004361061015f576000357c010000000000000000000000000000000000000000000000000000000090046(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
525
656
1.249524
"pragma solidity ^0.4.24;\r\n\r\n// File: ..\\openzeppelin-solidity\\contracts\\math\\SafeMath.sol\r(...TRUNCATED)
"0x6080604052600436106101665763ffffffff60e060020a60003504166303a503a481146101b657806319a96e72146101d(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH4 PUSH1 PUSH1 EXP PUSH1 CALLDATALOAD DIV A(...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
753
958
1.272244
"pragma solidity ^0.4.11;\r\n\r\n\r\n/**\r\n * Math operations with safety checks\r\n */\r\nlibrary (...TRUNCATED)
"0x606060405236156100ce576000357c0100000000000000000000000000000000000000000000000000000000900463fff(...TRUNCATED)
"PUSH1 PUSH1 MSTORE CALLDATASIZE ISZERO PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND DU(...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nCALLDATA(...TRUNCATED)
263
316
1.201521
"pragma solidity ^0.4.23;\r\n\r\n\r\n\r\ncontract Consts {\r\n string constant TOKEN_NAME = \"Amo(...TRUNCATED)
"0x6080604052600436106101b7576000357c010000000000000000000000000000000000000000000000000000000090046(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
621
753
1.21256
"pragma solidity ^0.4.13;\r\n\r\nlibrary SafeMath {\r\n function mul(uint256 a, uint256 b) internal(...TRUNCATED)
"0x6060604052600436106100cc5763ffffffff60e060020a60003504166306fdde0381146100d9578063095ea7b31461016(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH4 PUSH1 PUSH1 EXP PUSH1 CALLDATALOAD DIV A(...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
220
275
1.25
"pragma solidity ^0.4.24;\r\n\r\n\r\ncontract owned {\r\n constructor() public { owner = msg.send(...TRUNCATED)
"0x608060405260043610610041576000357c010000000000000000000000000000000000000000000000000000000090046(...TRUNCATED)
"PUSH1 PUSH1 MSTORE PUSH1 CALLDATASIZE LT PUSH2 JUMPI PUSH1 CALLDATALOAD PUSH29 SWAP1 DIV PUSH4 AND (...TRUNCATED)
overflow
4
"{'blocks': [[{'address': 0, 'opcode': 'PUSH1', 'args': ''}, {'address': 1, 'opcode': 'PUSH1', 'args(...TRUNCATED)
"[[0. 1. 1. ... 0. 0. 0.]\n [0. 0. 1. ... 0. 0. 0.]\n [0. 0. 0. ... 0. 0. 0.]\n ...\n [0. 0. 0. ... (...TRUNCATED)
"digraph CFG {\nrankdir=UD;\nnode [shape=box];\n\nblock_0 [label=\"PUSH1\\nPUSH1\\nMSTORE\\nPUSH1\\n(...TRUNCATED)
38
46
1.210526
End of preview. Expand in Data Studio

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
47