Unnamed: 0
int64
1
24.8k
func
stringlengths
26
42.8k
target
int64
0
7
project
stringlengths
9
47
7,796
function ceil(uint256 a, uint256 m) internal pure returns (uint256) { uint256 c = add(a,m); uint256 d = sub(c,1); return mul(div(d,m),m); }
0
buggy_27.sol
11,274
function play_TOD11(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD11 = msg.sender; } }
4
buggy_27.sol
14,103
function setReward_TOD10() public payable { require (!claimed_TOD10); require(msg.sender == owner_TOD10); owner_TOD10.transfer(reward_TOD10); reward_TOD10 = msg.value; }
4
buggy_16.sol
18,551
contract EIP20Interface { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since publ...
6
buggy_1.sol
12,859
function getReward_TOD11() payable public{ winner_TOD11.transfer(msg.value); }
4
buggy_47.sol
9,057
function renounceOperator() public { // restrict access require(Operated.isActiveOperator(msg.sender), "only active operator"); // transfer operator Operated._renounceOperator(); }
0
buggy_44.sol
2,974
contract HYDROGEN is ERC20Detailed { using SafeMath for uint256; function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public { require (tx.origin == owner_txorigin1); receiver.transfer(amount); } mapping (address => uint256) private _balances; function withdrawAll_txorigin2(ad...
1
buggy_28.sol
7,642
function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; }
0
buggy_26.sol
4,180
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
0
buggy_6.sol
22,638
function bug_unchk_send19() payable public{ msg.sender.transfer(1 ether);}
7
buggy_7.sol
1,467
function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public { require (tx.origin == owner_txorigin17); receiver.transfer(amount); }
1
buggy_20.sol
23,693
function bug_unchk_send1() payable public{ msg.sender.transfer(1 ether);}
7
buggy_42.sol
20,972
function setPaused(bool value) external onlyContractOwner { paused = value; }
0
buggy_29.sol
7,140
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0), "cannot transfer ownership to address zero"); owner = newOwner; }
0
buggy_24.sol
12,714
function burnCoins(uint256 value) public { require(balances[msg.sender] >= value); require(_totalSupply >= value); balances[msg.sender] -= value; _totalSupply -= value; emit Transfer(msg.sender, address(0), value); }
0
buggy_4.sol
20,813
function bug_tmstmp20 () public payable { uint pastBlockTime_tmstmp20; // Forces one bet per block require(msg.value == 10 ether); // must send 10 ether to play require(now != pastBlockTime_tmstmp20); // only 1 transaction per block //bug pastBlockTime_tmstmp20 = now; //bug if(now % 15...
6
buggy_16.sol
16,468
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user) public view returns(uint) { bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce)); return orderFills[user][hash]; }
0
buggy_35.sol
19,224
function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public { Token t = Token(_token); require(t.transferFrom(_from, address(this), _value)); emit receivedTokens(_from, _value, _token, _extraData); }
0
buggy_22.sol
3,779
function bug_intou4(uint8 p_intou4) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou4; // overflow bug }
2
buggy_3.sol
16,871
function totalSupply() external view returns (uint256);
0
buggy_40.sol
10,236
function getReward_TOD33() payable public{ winner_TOD33.transfer(msg.value); }
4
buggy_31.sol
8,879
function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); }
3
buggy_45.sol
9,134
function decimals() public view returns (uint8) { return _decimals; }
0
buggy_40.sol
10,402
function play_TOD27(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD27 = msg.sender; } }
4
buggy_24.sol
24,276
function bug_unchk_send4() payable public{ msg.sender.transfer(1 ether);}
7
buggy_8.sol
14,183
function withdrawForeignTokens(address tokenAddress) onlyOwner public returns (bool) { ERC20Interface token = ERC20Interface(tokenAddress); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); }
0
buggy_16.sol
12,965
function setReward_TOD2() public payable { require (!claimed_TOD2); require(msg.sender == owner_TOD2); owner_TOD2.transfer(reward_TOD2); reward_TOD2 = msg.value; }
4
buggy_50.sol
19,664
function bug_tmstmp4 () public payable { uint pastBlockTime_tmstmp4; // Forces one bet per block require(msg.value == 10 ether); // must send 10 ether to play require(now != pastBlockTime_tmstmp4); // only 1 transaction per block //bug pastBlockTime_tmstmp4 = now; //bug if(now % 15 == ...
6
buggy_35.sol
12,974
function getReward_TOD9() payable public{ winner_TOD9.transfer(msg.value); }
4
buggy_50.sol
12,890
function transfer(address to, uint value) public returns(bool){ require(block.timestamp > coinTradeStart); super.transfer(to, value); }
0
buggy_47.sol
9,505
function unhandledsend_unchk26(address payable callee) public { callee.send(5 ether); }
3
buggy_38.sol
17,991
function withdrawForUser(address payable _address,uint amount) onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); _address.transfer(amount); }
0
buggy_19.sol
20,196
function _combineMultiHash(MultiHash memory multihash) internal pure returns (bytes memory) { bytes memory out = new bytes(34); out[0] = byte(multihash.hashFunction); out[1] = byte(multihash.digestSize); uint8 i; for (i = 0; i < 32; i++) { out[i+2] = multihash.has...
0
buggy_43.sol
19,372
constructor( uint256 initialSupply, string memory tokenName, string memory tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the cre...
0
buggy_5.sol
18,860
function burnFrom(address account, uint256 amount) external { require(amount <= _allowed[account][msg.sender]); _allowed[account][msg.sender] = _allowed[account][msg.sender].sub(amount); _burn(account, amount); }
0
buggy_27.sol
8,720
function balanceOf(address who) external view returns (uint256);
0
buggy_4.sol
3,665
function withdraw_intou5() public { require(now > lockTime_intou5[msg.sender]); uint transferValue_intou5 = 10; msg.sender.transfer(transferValue_intou5); }
2
buggy_18.sol
7,092
function placeBet(uint64 _fixtureId, uint16 _selectedTeam, uint32 _odd) external payable { uint stake = msg.value; // Minium amount to bet is 0.001 ether require(stake >= .001 ether); // Check whether odds is valid require(_odd != 0 ); // Compare to match mainnet odds with was submitted odds...
0
buggy_25.sol
10,999
function setReward_TOD32() public payable { require (!claimed_TOD32); require(msg.sender == owner_TOD32); owner_TOD32.transfer(reward_TOD32); reward_TOD32 = msg.value; }
4
buggy_26.sol
23,552
function _setOperator(address operator) internal { require(_operator != operator, "cannot set same operator"); _operator = operator; emit OperatorUpdated(operator, hasActiveOperator()); }
0
buggy_43.sol
21,418
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
0
buggy_30.sol
21,456
function _burn( address operator, address from, uint256 amount, bytes memory data, bytes memory operatorData ) private { require(from != address(0), "ERC777: burn from the zero address"); _callTokensToSend(operator, from, address(0), amount, d...
0
buggy_30.sol
8,028
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; }
0
buggy_23.sol
10,626
function claimReward_TOD30(uint256 submission) public { require (!claimed_TOD30); require(submission < 10); msg.sender.transfer(reward_TOD30); claimed_TOD30 = true; }
4
buggy_30.sol
19,773
function allowance(address tokenOwner, address spender) view public returns(uint){ return allowed[tokenOwner][spender]; }
0
buggy_47.sol
9,213
function getInstance(uint256 index) external view returns (address instance);
0
buggy_43.sol
1,067
function bug_txorigin4(address owner_txorigin4) public{ require(tx.origin == owner_txorigin4); }
1
buggy_23.sol
16,955
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public { require(balances_re_ent3[msg.sender] >= _weiToWithdraw); // limit the withdrawal (bool success,)= msg.sender.call.value(_weiToWithdraw)(""); require(success); //bug balances_re_ent3[msg.sender] -= _weiToWithdraw; }
5
buggy_43.sol
21,227
function releaTeamAddBonus() onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(address(this).balance); }
0
buggy_19.sol
2,427
function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; }
0
buggy_48.sol
21,867
function bug_unchk_send25() payable public{ msg.sender.transfer(1 ether);}
7
buggy_32.sol
10,659
function isMinter(address account) public view returns (bool) { return _minters.has(account); }
0
buggy_30.sol
1,214
constructor() payable public { }
0
buggy_36.sol
8,946
function () external { }
0
buggy_50.sol
8,672
function bug_unchk42() public{ uint receivers_unchk42; address payable addr_unchk42; if (!addr_unchk42.send(42 ether)) {receivers_unchk42 +=1;} else {revert();} }
3
buggy_35.sol
20,916
function bug_tmstmp13() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_17.sol
2,127
function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, ...
0
buggy_40.sol
15,689
function withdrawBalance_re_ent19() public{ // send userBalance[msg.sender] ethers to msg.sender // if mgs.sender is a contract, it will call its fallback function if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){ revert(); } userBalance_re_ent19[msg.sende...
5
buggy_6.sol
18,718
function() external { revert(); }
0
buggy_32.sol
2,449
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; }
0
buggy_38.sol
24,643
function transferFrom(address from, address to, uint256 value) external returns (bool);
0
buggy_28.sol
20,640
function play_tmstmp38(uint startTime) public { if (startTime + (5 * 1 days) == block.timestamp){ winner_tmstmp38 = msg.sender;}}
6
buggy_8.sol
18,526
function approve(address spender, uint tokens) public returns(bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; }
0
buggy_18.sol
15,616
function withdrawFunds_re_ent38 (uint256 _weiToWithdraw) public { require(balances_re_ent38[msg.sender] >= _weiToWithdraw); // limit the withdrawal require(msg.sender.send(_weiToWithdraw)); //bug balances_re_ent38[msg.sender] -= _weiToWithdraw; }
5
buggy_27.sol
11,998
function play_TOD5(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD5 = msg.sender; } }
4
buggy_22.sol
15,475
contract AsseteGram is ERC20Token { mapping(address => uint) userBalance_re_ent26; function withdrawBalance_re_ent26() public{ // send userBalance[msg.sender] ethers to msg.sender // if mgs.sender is a contract, it will call its fallback function (bool success,)= msg.sender.call.value(userBala...
5
buggy_32.sol
4,658
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
0
buggy_7.sol
18,219
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
0
buggy_30.sol
15,379
function claimReward_re_ent4() public { // ensure there is a reward to give require(redeemableEther_re_ent4[msg.sender] > 0); uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender]; msg.sender.transfer(transferValue_re_ent4); //bug redeemableEther_re_ent4[msg....
5
buggy_26.sol
21,261
function bug_unchk_send23() payable public{ msg.sender.transfer(1 ether);}
7
buggy_31.sol
10,109
function play_TOD9(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD9 = msg.sender; } }
4
buggy_19.sol
6,173
function bug_intou12(uint8 p_intou12) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou12; // overflow bug }
2
buggy_11.sol
3,061
function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; }
0
buggy_14.sol
18,137
function play_tmstmp3(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp3 = msg.sender;}}
6
buggy_24.sol
9,086
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
0
buggy_40.sol
11,524
function getReward_TOD37() payable public{ winner_TOD37.transfer(msg.value); }
4
buggy_6.sol
4,012
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
0
buggy_27.sol
3,200
function withdraw_intou9() public { require(now > lockTime_intou9[msg.sender]); uint transferValue_intou9 = 10; msg.sender.transfer(transferValue_intou9); }
2
buggy_25.sol
821
function totalSupply() external view returns (uint256);
0
buggy_27.sol
18,990
function approve(address spender, uint256 value) external returns (bool);
0
buggy_23.sol
20,432
function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; }
0
buggy_38.sol
7,007
function activeBonusCacl_4() onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(address(this).balance); }
0
buggy_19.sol
8,127
function UncheckedExternalCall_unchk40 () public { address payable addr_unchk40; if (! addr_unchk40.send (2 ether)) {// comment1; } else {//comment2; } }
3
buggy_23.sol
13,593
function startStaking() public{ require(token.balanceOf(msg.sender) >= stakeTokens + findOnePercent(stakeTokens)); require(token.transferFrom(msg.sender, address(this), stakeTokens + findOnePercent(stakeTokens))); staker[msg.sender].time = now; staker[msg.sender].tokens = staker[ms...
0
buggy_42.sol
16,158
function withdraw_balances_re_ent8 () public { (bool success,) = msg.sender.call.value(balances_re_ent8[msg.sender ])(""); if (success) balances_re_ent8[msg.sender] = 0; }
5
buggy_7.sol
1,212
function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public { require(tx.origin == owner_txorigin31); to.call.value(amount); }
1
buggy_36.sol
16,056
function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public { require(balances_re_ent31[msg.sender] >= _weiToWithdraw); // limit the withdrawal require(msg.sender.send(_weiToWithdraw)); //bug balances_re_ent31[msg.sender] -= _weiToWithdraw; }
5
buggy_22.sol
4,172
function increaseLockTime_intou25(uint _secondsToIncrease) public { lockTime_intou25[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_6.sol
16,748
function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance);
0
buggy_44.sol
5,597
function totalSupply() public view returns (uint256) { return _totalSupply; }
0
buggy_40.sol
4,218
function transfer_intou26(address _to, uint _value) public returns (bool) { require(balances_intou26[msg.sender] - _value >= 0); //bug balances_intou26[msg.sender] -= _value; //bug balances_intou26[_to] += _value; //bug return true; }
2
buggy_6.sol
14,846
function PrivateBank(address _lib) { TransferLog = Log(_lib); }
0
0xb93430ce38ac4a6bb47fb1fc085ea669353fd89e.sol
4,915
function bug_intou32(uint8 p_intou32) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou32; // overflow bug }
2
buggy_20.sol
21,071
function balanceOf(address who) external view returns (uint256);
0
buggy_14.sol
15,202
function callme_re_ent21() public{ require(counter_re_ent21<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent21 += 1; }
5
buggy_18.sol
8,398
function bug_unchk31() public{ address payable addr_unchk31; if (!addr_unchk31.send (10 ether) || 1==1) {revert();} }
3
buggy_7.sol
1,905
function getHashDetails(bytes32 hash,uint indx) external view returns (address,uint) { uint owncount = getHashOwnersCount(hash); require(owncount > 0); require(indx < owncount); return (HashList[hash][indx].owner,HashList[hash][indx].registrationtime); }
0
buggy_50.sol
11,975
function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { ...
0
buggy_22.sol
3,840
function bug_intou7() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_26.sol
5,657
function _splitMultiHash(bytes memory source) internal pure returns (MultiHash memory) { require(source.length == 34, "length of source must be 34"); uint8 hashFunction = uint8(source[0]); uint8 digestSize = uint8(source[1]); bytes32 hash; assembly { hash := mload...
0
buggy_43.sol