filename stringlengths 56 76 | code stringlengths 176 147k | source_contract stringlengths 82 124 | vulnerability_type stringclasses 8
values | injection_mode stringclasses 2
values | template_name stringclasses 40
values | solidity_version stringclasses 28
values | injected_regions stringlengths 117 314 | subset stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|
0xe5a5f138005e19a3e6d0fe68b039397eeef2322b_point_62_timestamp.sol | pragma solidity 0.4.24;
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner... | data/smartbugs-wild-clean-contracts/0xe5a5f138005e19a3e6d0fe68b039397eeef2322b.sol | timestamp | point | timestamp_comparison | 0.4.24 | [{"start_byte": 11581, "end_byte": 11638, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 6200, "end_byte": 6225, "component": "state", "description": "Injected state code"}] | point |
0x31efeb0296487dc6af9b3be1dd8588e69cfda4e9_point_11_tx_origin.sol | pragma solidity 0.4.18;
/*
Author: Patrick Guay @ Vanbex and Etherparty
patrick@vanbex.com
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
add... | data/smartbugs-wild-clean-contracts/0x31efeb0296487dc6af9b3be1dd8588e69cfda4e9.sol | tx_origin | point | tx_origin_transfer | 0.4.18 | [{"start_byte": 3073, "end_byte": 3173, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 1180, "end_byte": 1202, "component": "state", "description": "Injected state code"}] | point |
0x27525a26a2fc5bec00e1bf82a73abebcd91c4a42_point_20_tx_origin.sol | pragma solidity 0.4.24;
// File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address... | data/smartbugs-wild-clean-contracts/0x27525a26a2fc5bec00e1bf82a73abebcd91c4a42.sol | tx_origin | point | tx_origin_with_param | 0.4.24 | [{"start_byte": 7706, "end_byte": 7747, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0xb110e378ea8b83dd52d1c5a810a5dcf99bbc96ae_point_74_tx_origin.sol | pragma solidity 0.4.15;
/**
* @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 b... | data/smartbugs-wild-clean-contracts/0xb110e378ea8b83dd52d1c5a810a5dcf99bbc96ae.sol | tx_origin | point | tx_origin_transfer | 0.4.15 | [{"start_byte": 25288, "end_byte": 25387, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 14340, "end_byte": 14361, "component": "state", "description": "Injected state code"}] | point |
0x4b6ddb08e3ca085dd52266e7fd8ec91010f6f8b5_point_58_unchecked_send.sol | pragma solidity ^0.5.4;
////////////////////////////////////////////////////////////////////////////////
contract SafeMath
{
function safeMul(uint a, uint b) internal pure returns (uint)
{
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
//----------------------------... | data/smartbugs-wild-clean-contracts/0x4b6ddb08e3ca085dd52266e7fd8ec91010f6f8b5.sol | unchecked_send | point | unchecked_send_balance_legacy | 0.5.4 | [{"start_byte": 8209, "end_byte": 8266, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0x818ebd30145c9d7c697978bf24c905d9e8a194ec_point_14_overflow.sol | pragma solidity 0.4.23;
contract PasswordEscrow {
uint256 allocation;
address public owner;
uint256 public commissionFee;
uint256 public totalFee;
//data
struct Transfer {
address from;
uint256 amount;
}
mapping(bytes32 => Transfer) private transferToPassword;
mapping(address => uint256) ... | data/smartbugs-wild-clean-contracts/0x818ebd30145c9d7c697978bf24c905d9e8a194ec.sol | overflow | point | addition_overflow_input | 0.4.23 | [{"start_byte": 3844, "end_byte": 3882, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 52, "end_byte": 75, "component": "state", "description": "Injected state code"}] | point |
0xc29f013d7745d95c86407b53137a1596072d4b83_point_30_unchecked_send.sol | pragma solidity 0.4.21;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, ... | data/smartbugs-wild-clean-contracts/0xc29f013d7745d95c86407b53137a1596072d4b83.sol | unchecked_send | point | unchecked_send_balance_legacy | 0.4.21 | [{"start_byte": 3383, "end_byte": 3432, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0x5585f99a9af13b73a6210ea9c8ca98b69f4a4b31_point_0_overflow.sol | pragma solidity ^0.4.24;
// similar as shrimpfarmer, with two changes:
// A. half of your plumbers leave when you sell pooh
// B. the "free" 100 plumber cost 0.001 eth (in line with the mining fee)
// bots should have a harder time
contract PlumberCollector{
mapping(address => uint256) amounts;
uint256 pub... | data/smartbugs-wild-clean-contracts/0x5585f99a9af13b73a6210ea9c8ca98b69f4a4b31.sol | overflow | point | batch_transfer_overflow | 0.4.24 | [{"start_byte": 945, "end_byte": 1412, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 270, "end_byte": 312, "component": "state", "description": "Injected state code"}] | point |
0x88b0652919467b1e47cd1a1fd676cd1940d2fa69_point_83_unchecked_send.sol | /**
* Copyright 2017–2018, bZeroX, LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0.
*/
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
... | data/smartbugs-wild-clean-contracts/0x88b0652919467b1e47cd1a1fd676cd1940d2fa69.sol | unchecked_send | point | unchecked_send_literal_legacy | 0.4.24 | [{"start_byte": 5329, "end_byte": 5364, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0x39f5be9f4b18830c9bb17cfdb045a4724c3d3b28_point_13_underflow.sol | pragma solidity ^0.5.0;
/*
* Creator: Mercury token
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256... | data/smartbugs-wild-clean-contracts/0x39f5be9f4b18830c9bb17cfdb045a4724c3d3b28.sol | underflow | point | subtraction_underflow | 0.5.0 | [{"start_byte": 4044, "end_byte": 4107, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 1991, "end_byte": 2118, "component": "state", "description": "Injected state code"}] | point |
0x4b6ddb08e3ca085dd52266e7fd8ec91010f6f8b5_point_90_unhandled_exception.sol | pragma solidity ^0.5.4;
////////////////////////////////////////////////////////////////////////////////
contract SafeMath
{
function safeMul(uint a, uint b) internal pure returns (uint)
{
uint c = a * b;
assert(a == 0 || c / a == b);
return c;
}
//----------------------------... | data/smartbugs-wild-clean-contracts/0x4b6ddb08e3ca085dd52266e7fd8ec91010f6f8b5.sol | unhandled_exception | point | unchecked_call_05x | 0.5.4 | [{"start_byte": 12861, "end_byte": 12926, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 5620, "end_byte": 5648, "component": "state", "description": "Injected state code"}] | point |
0x685bd934b371f2ee4894225064d937a57fb03974_point_40_unchecked_send.sol | pragma solidity ^0.5.9;
/*
* Creator: Bossvegas
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
... | data/smartbugs-wild-clean-contracts/0x685bd934b371f2ee4894225064d937a57fb03974.sol | unchecked_send | point | unchecked_send_literal_legacy | 0.5.9 | [{"start_byte": 9541, "end_byte": 9576, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0x75f23e7134502c0c0aa081b552d55bc8b654f1ee_point_24_unchecked_send.sol | pragma solidity 0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 val... | data/smartbugs-wild-clean-contracts/0x75f23e7134502c0c0aa081b552d55bc8b654f1ee.sol | unchecked_send | point | unchecked_send_literal_legacy | 0.4.18 | [{"start_byte": 6821, "end_byte": 6864, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}] | point |
0xabdac5fcbb870e6d28821db3cc8f132b5c7e940d_point_130_timestamp.sol | pragma solidity ^0.5.4;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256... | data/smartbugs-wild-clean-contracts/0xabdac5fcbb870e6d28821db3cc8f132b5c7e940d.sol | timestamp | point | timestamp_equality_050 | 0.5.4 | [{"start_byte": 8721, "end_byte": 8818, "component": "vulnerable_code", "description": "Injected vulnerable_code code"}, {"start_byte": 7810, "end_byte": 7828, "component": "state", "description": "Injected state code"}] | point |
End of preview. Expand in Data Studio
Smart Contracts with AST-Injected Vulnerabilities
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.
Dataset Structure
The data is provided in Parquet format.
Schema
| Field | Type | Description |
|---|---|---|
filename |
string | Name of the injected Solidity file |
code |
string | The full source code of the injected contract |
source_contract |
string | Path/Name of the original clean contract |
vulnerability_type |
string | Type of vulnerability injected (e.g., reentrancy, lock) |
injection_mode |
string | point (single injection) or coupled (multiple injections) |
template_name |
string | Specific template used for injection |
solidity_version |
string | Solidity version of the contract |
injected_regions |
string | JSON string describing the start/end bytes of injected code |
subset |
string | Origin subset (point or coupled) |
Statistics
Total Files: 225300
Vulnerability Distribution
| Vulnerability Type | Count |
|---|---|
| timestamp | 33175 |
| overflow | 32370 |
| unchecked_send | 32370 |
| tx_origin | 36574 |
| underflow | 21249 |
| unhandled_exception | 23601 |
| reentrancy | 19911 |
| lock | 6400 |
| tod | 2387 |
| dos | 4983 |
| access | 7326 |
| state | 4954 |
Metadata
Detailed statistics are available in the repository root:
Usage
from datasets import load_dataset
dataset = load_dataset("minhnn32/sc-ast-injected")
print(dataset['train'][0])
- Downloads last month
- 26