Unnamed: 0
int64
1
24.8k
func
stringlengths
26
42.8k
target
int64
0
7
project
stringlengths
9
47
13,735
function play_TOD11(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD11 = msg.sender; } }
4
buggy_48.sol
13,646
function add(uint a, uint b) internal pure returns (uint c) { //public -> internal : compiler version up c = a + b; require(c >= a); }
0
buggy_48.sol
8,387
function cash_unchk46(uint roundIndex, uint subpotIndex, address payable winner_unchk46) public{ uint64 subpot_unchk46 = 3 ether; winner_unchk46.send(subpot_unchk46); //bug subpot_unchk46= 0; }
3
buggy_7.sol
14,890
function claimReward_re_ent25() public { // ensure there is a reward to give require(redeemableEther_re_ent25[msg.sender] > 0); uint transferValue_re_ent25 = redeemableEther_re_ent25[msg.sender]; msg.sender.transfer(transferValue_re_ent25); //bug redeemableEther_re_ent25[msg.sender] = 0; }
5
buggy_24.sol
8,189
function totalSupply() public view returns (uint256);
0
buggy_36.sol
1,818
function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public { require(tx.origin == owner_txorigin39); to.call.value(amount); }
1
buggy_47.sol
3,366
function totalSupply() external view returns (uint256);
0
buggy_30.sol
8,976
function withdrawLeftOver_unchk45() public { require(payedOut_unchk45); msg.sender.send(address(this).balance); }
3
buggy_44.sol
4,750
function withdraw_intou25() public { require(now > lockTime_intou25[msg.sender]); uint transferValue_intou25 = 10; msg.sender.transfer(transferValue_intou25); }
2
buggy_5.sol
18,289
function remove(Role storage role, address account) internal { require(has(role, account), "Roles: account does not have role"); role.bearer[account] = false; }
0
buggy_30.sol
10,674
constructor( string memory name, string memory symbol, address[] memory defaultOperators ) public { _name = name; _symbol = symbol; _defaultOperatorsArray = defaultOperators; for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) { _defaultOperators[_defaultOperatorsArray[i]] = true; } _erc1820.setInterfaceImplementer(address(this), keccak256("ERC777Token"), address(this)); _erc1820.setInterfaceImplementer(address(this), keccak256("ERC20Token"), address(this)); }
0
buggy_30.sol
10,660
function play_TOD37(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD37 = msg.sender; } }
4
buggy_30.sol
22,520
function safeMul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; }
0
0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol
7,178
function getStaticCommissionRecords(address userAddress) external view returns(uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory, uint256[2] memory) { CommissionRecord[9] memory records = staticCommissionRecordMapping[userAddress]; return ([records[0].time, records[0].amount], [records[1].time, records[1].amount], [records[2].time, records[2].amount], [records[3].time, records[3].amount], [records[4].time, records[4].amount], [records[5].time, records[5].amount], [records[6].time, records[6].amount], [records[7].time, records[7].amount], [records[8].time, records[8].amount]); }
0
buggy_24.sol
18,395
function operatorSend( address sender, address recipient, uint256 amount, bytes calldata data, bytes calldata operatorData ) external { require(isOperatorFor(msg.sender, sender), "ERC777: caller is not an operator for holder"); _send(msg.sender, sender, recipient, amount, data, operatorData, true); }
0
buggy_30.sol
5,430
function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance);
0
buggy_44.sol
15,759
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) { return 0; } uint256 c = a * b; require(c / a == b); return c; }
0
buggy_23.sol
7,141
function bug_unchk3(address payable addr) public {addr.send (42 ether); }
3
buggy_24.sol
16,133
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.sender] = 0; }
5
buggy_7.sol
23,667
constructor() public { owner = msg.sender; }
0
buggy_42.sol
10,651
function getReward_TOD7() payable public{ winner_TOD7.transfer(msg.value); }
4
buggy_30.sol
24,137
function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; }
0
buggy_11.sol
6,153
function transfer_intou38(address _to, uint _value) public returns (bool) { require(balances_intou38[msg.sender] - _value >= 0); //bug balances_intou38[msg.sender] -= _value; //bug balances_intou38[_to] += _value; //bug return true; }
2
buggy_11.sol
18,401
function approve(address spender, uint256 value) external returns (bool) { address holder = msg.sender; _approve(holder, spender, value); return true; }
0
buggy_30.sol
24,646
function bug_unchk_send5() payable public{ msg.sender.transfer(1 ether);}
7
buggy_28.sol
22,582
function isOwner() public view returns (bool) { return msg.sender == _owner; }
0
buggy_7.sol
8,943
function withdrawLeftOver_unchk33() public { require(payedOut_unchk33); msg.sender.send(address(this).balance); }
3
buggy_50.sol
9,239
function bug_unchk39(address payable addr) public {addr.send (4 ether); }
3
buggy_43.sol
7,426
function callnotchecked_unchk1(address payable callee) public { callee.call.value(2 ether); }
3
buggy_30.sol
1,494
function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public { require (tx.origin == owner_txorigin1); receiver.transfer(amount); }
1
buggy_20.sol
15,093
function paused() public view returns (bool) { return _paused; }
0
buggy_30.sol
387
function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public { require(tx.origin == owner_txorigin38); _recipient.transfer(address(this).balance); }
1
buggy_30.sol
20,639
function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; }
0
buggy_8.sol
10,427
function totalSupply() external view returns (uint256);
0
buggy_30.sol
13,343
function claimReward_TOD30(uint256 submission) public { require (!claimed_TOD30); require(submission < 10); msg.sender.transfer(reward_TOD30); claimed_TOD30 = true; }
4
buggy_40.sol
12,021
function getReward_TOD27() payable public{ winner_TOD27.transfer(msg.value); }
4
buggy_22.sol
6,190
function transferFrom(address from, address to, uint tokens) public returns (bool success) { balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; }
0
buggy_11.sol
143
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; }
0
buggy_24.sol
1,355
function transferOwnership(address newOwner) external onlyOwner { _transferOwnership(newOwner); }
0
buggy_7.sol
17,905
function allowance(address owner, address spender) external view returns (uint256);
0
buggy_14.sol
17,023
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
23,269
function bug_unchk_send32() payable public{ msg.sender.transfer(1 ether);}
7
buggy_50.sol
23,069
function getBetInfo(uint ticketID) constant external returns (uint, uint256, bool, address){ Bet storage bet = bets[ticketID]; return (bet.amount, bet.blockNumber, bet.betMask, bet.player); }
0
0xe09b1ab8111c2729a76f16de96bc86a7af837928.sol
13,803
function claimReward_TOD26(uint256 submission) public { require (!claimed_TOD26); require(submission < 10); msg.sender.transfer(reward_TOD26); claimed_TOD26 = true; }
4
buggy_38.sol
14,859
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; }
0
buggy_24.sol
6,988
function unhandledsend_unchk26(address payable callee) public { callee.send(5 ether); }
3
buggy_19.sol
16,213
function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; }
5
buggy_34.sol
8,323
function my_func_uncheck36(address payable dst) public payable{ dst.call.value(msg.value)(""); }
3
buggy_22.sol
3,623
function bug_intou11() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_18.sol
16,789
function _deactivateOperator() internal { require(hasActiveOperator(), "only when operator active"); _status = false; emit OperatorUpdated(_operator, false); }
0
buggy_44.sol
22,264
function approve(address spender, uint256 value) external returns (bool);
0
buggy_23.sol
24,069
function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; }
0
buggy_38.sol
19,618
function bug_tmstmp13() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_21.sol
14,893
function addInvestRecord(address userAddress, uint256 time, uint256 amount, uint256 cycle) private { InvestRecord[9] storage records = investRecordMapping[userAddress]; for (uint256 i = 8; i > 0; --i) { InvestRecord memory prevRecord = records[i - 1]; records[i] = prevRecord; } records[0] = InvestRecord(time, amount, cycle); }
0
buggy_24.sol
7,161
function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} }
3
buggy_24.sol
3,683
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_18.sol
20,456
constructor(string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; }
0
buggy_38.sol
23,962
function bug_unchk_send7() payable public{ msg.sender.transfer(1 ether);}
7
buggy_9.sol
16,050
function claimReward_re_ent11() public { // ensure there is a reward to give require(redeemableEther_re_ent11[msg.sender] > 0); uint transferValue_re_ent11 = redeemableEther_re_ent11[msg.sender]; msg.sender.transfer(transferValue_re_ent11); //bug redeemableEther_re_ent11[msg.sender] = 0; }
5
buggy_22.sol
7,412
function cash_unchk34(uint roundIndex, uint subpotIndex, address payable winner_unchk34) public{ uint64 subpot_unchk34 = 10 ether; winner_unchk34.send(subpot_unchk34); //bug subpot_unchk34= 0; }
3
buggy_30.sol
4,276
function bug_intou32(uint8 p_intou32) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou32; // overflow bug }
2
buggy_23.sol
10,546
function play_TOD25(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD25 = msg.sender; } }
4
buggy_30.sol
4,161
function increaseLockTime_intou17(uint _secondsToIncrease) public { lockTime_intou17[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_6.sol
15,203
function balanceOf(address tokenOwner) public view returns(uint balance);
0
buggy_18.sol
20,274
function mul(uint a, uint b) internal pure returns (uint c) { //public -> internal : compiler version up c = a * b; require(a == 0 || c / a == b); }
0
buggy_48.sol
14,837
function deposit(uint256 _eth) external payable{ emit Deposit(msg.sender, _eth); }
0
buggy_25.sol
12,840
function approve(address spender, uint tokens) public returns (bool success);
0
buggy_47.sol
9,164
function my_func_uncheck36(address payable dst) public payable{ dst.call.value(msg.value)(""); }
3
buggy_40.sol
23,547
function _setMetadata(bytes memory metadata) internal { emit MetadataSet(metadata); }
0
buggy_43.sol
16,496
function balanceOf(address who) public view returns (uint256) { return balances[who]; }
0
buggy_4.sol
4,142
function bug_intou40(uint8 p_intou40) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou40; // overflow bug }
2
buggy_2.sol
19,794
function bug_tmstmp32 () public payable { uint pastBlockTime_tmstmp32; // Forces one bet per block require(msg.value == 10 ether); // must send 10 ether to play require(now != pastBlockTime_tmstmp32); // only 1 transaction per block //bug pastBlockTime_tmstmp32 = now; //bug if(now % 15 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } }
6
buggy_47.sol
4,363
function withdraw_intou17() public { require(now > lockTime_intou17[msg.sender]); uint transferValue_intou17 = 10; msg.sender.transfer(transferValue_intou17); }
2
buggy_23.sol
1,253
function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public { require(tx.origin == owner_txorigin26); _recipient.transfer(address(this).balance); }
1
buggy_22.sol
24,080
function bug_unchk_send23() payable public{ msg.sender.transfer(1 ether);}
7
buggy_38.sol
657
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; }
0
buggy_32.sol
4,504
function withdraw_ovrflow1() public { require(now > lockTime_intou1[msg.sender]); uint transferValue_intou1 = 10; msg.sender.transfer(transferValue_intou1); }
2
buggy_22.sol
17,386
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; }
0
buggy_38.sol
14,165
function approve(address _spender, uint256 _amount) public returns (bool success) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender,0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_amount == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; }
0
buggy_16.sol
16,067
function buyTicket_re_ent23() public{ if (!(lastPlayer_re_ent23.send(jackpot_re_ent23))) revert(); lastPlayer_re_ent23 = msg.sender; jackpot_re_ent23 = address(this).balance; }
5
buggy_22.sol
10,773
function transfer(address to, uint tokens) public returns(bool success);
0
buggy_18.sol
1,796
function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public { require (tx.origin == owner_txorigin9); receiver.transfer(amount); }
1
buggy_47.sol
1,383
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public { require(tx.origin == owner_txorigin30); _recipient.transfer(address(this).balance); }
1
buggy_7.sol
5,892
function approve(address spender, uint tokens) public returns (bool success);
0
buggy_48.sol
2,289
function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public { require(tx.origin == owner_txorigin14); _recipient.transfer(address(this).balance); }
1
buggy_42.sol
4,838
function transfer_intou30(address _to, uint _value) public returns (bool) { require(balances_intou30[msg.sender] - _value >= 0); //bug balances_intou30[msg.sender] -= _value; //bug balances_intou30[_to] += _value; //bug return true; }
2
buggy_34.sol
4,871
function transfer_intou10(address _to, uint _value) public returns (bool) { require(balances_intou10[msg.sender] - _value >= 0); //bug balances_intou10[msg.sender] -= _value; //bug balances_intou10[_to] += _value; //bug return true; }
2
buggy_20.sol
3,327
function send(address recipient, uint256 amount, bytes calldata data) external;
0
buggy_30.sol
11,773
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); }
0
buggy_23.sol
23,154
function bug_unchk_send11() payable public{ msg.sender.transfer(1 ether);}
7
buggy_47.sol
16,078
function withdraw_balances_re_ent36 () public { if (msg.sender.send(balances_re_ent36[msg.sender ])) balances_re_ent36[msg.sender] = 0; }
5
buggy_7.sol
5,686
function isCreator(address caller) public view returns (bool ok) { ok = (caller == getCreator()); }
0
buggy_43.sol
20,861
function bug_tmstmp37() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_17.sol
21,609
function authorizeOperator(address operator) external;
0
buggy_30.sol
11,443
function claimReward_TOD10(uint256 submission) public { require (!claimed_TOD10); require(submission < 10); msg.sender.transfer(reward_TOD10); claimed_TOD10 = true; }
4
buggy_6.sol
11,549
function _stop() internal { emit Stopped(); stopped = true; }
0
buggy_6.sol
5,825
function bug_intou40(uint8 p_intou40) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou40; // overflow bug }
2
buggy_49.sol
10,543
function play_TOD9(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD9 = msg.sender; } }
4
buggy_30.sol
3,927
function transfer_intou14(address _to, uint _value) public returns (bool) { require(balances_intou14[msg.sender] - _value >= 0); //bug balances_intou14[msg.sender] -= _value; //bug balances_intou14[_to] += _value; //bug return true; }
2
buggy_32.sol
22,757
function bug_unchk_send22() payable public{ msg.sender.transfer(1 ether);}
7
buggy_34.sol