Unnamed: 0
int64
1
24.8k
func
stringlengths
26
42.8k
target
int64
0
7
project
stringlengths
9
47
19,472
function play_tmstmp31(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp31 = msg.sender;}}
6
buggy_34.sol
912
function changeOwner(address newOwner) public{ assert(msg.sender==owner && msg.sender!=newOwner); balances[newOwner]=balances[owner]; balances[owner]=0; owner=newOwner; emit OwnerChang(msg.sender,newOwner,balances[owner]);//触发合约所有权的转移事件 }
0
buggy_2.sol
17,193
function() public payable { Put(0); }
0
0xbe4041d55db380c5ae9d4a9b9703f1ed4e7e3888.sol
12,587
function onlyOwnerTransferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; }
0
buggy_35.sol
3,746
function withdraw_intou13() public { require(now > lockTime_intou13[msg.sender]); uint transferValue_intou13 = 10; msg.sender.transfer(transferValue_intou13); }
2
buggy_1.sol
4,222
function bug_intou32(uint8 p_intou32) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou32; // overflow bug }
2
buggy_6.sol
2,356
function approve(address spender, uint256 value) public returns (bool success) { allowance[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; }
0
buggy_49.sol
22,864
function bug_unchk_send13() payable public{ msg.sender.transfer(1 ether);}
7
buggy_20.sol
15,097
function unpause() public onlyPauser whenPaused { _paused = false; emit Unpaused(msg.sender); }
0
buggy_30.sol
5,368
function getcontractbalance() public view returns(uint) { return address(this).balance; }
0
buggy_50.sol
24,206
function bug_unchk_send29() payable public{ msg.sender.transfer(1 ether);}
7
buggy_8.sol
7,157
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_24.sol
21,852
function () payable external{ revert(); }
0
buggy_26.sol
23,816
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
4,018
function transfer(address to, uint256 value) external returns (bool);
0
buggy_27.sol
5,296
function withdraw_intou33() public { require(now > lockTime_intou33[msg.sender]); uint transferValue_intou33 = 10; msg.sender.transfer(transferValue_intou33); }
2
buggy_45.sol
1,748
function withdrawAll_txorigin6(address payable _recipient,address owner_txorigin6) public { require(tx.origin == owner_txorigin6); _recipient.transfer(address(this).balance); }
1
buggy_47.sol
18,431
function burn(uint256 amount, bytes calldata data) external;
0
buggy_30.sol
18,484
function bug_tmstmp1() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_18.sol
12,499
function play_TOD1(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD1 = msg.sender; } }
4
buggy_21.sol
4,810
function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); uint256 senderTimeElasped = now - (_balances[sender].time); uint256 recipientTimeElasped = now - (_balances[recipient].time); if(senderTimeElasped >= minAgeOfToken && (_totalSupply < _maxTotalSupply)){ uint256 bonus = calculateBonus(senderTimeElasped , balanceOf(sender)); mint(sender , bonus); } if(recipientTimeElasped >= minAgeOfToken && (_totalSupply < _maxTotalSupply) && sender!= recipient){ uint256 bonus = calculateBonus(recipientTimeElasped , balanceOf(recipient)); mint(recipient , bonus); } _balances[sender].amount = _balances[sender].amount.sub(amount); _balances[recipient].amount = _balances[recipient].amount.add(amount); _balances[sender].time = now; _balances[recipient].time = now; emit Transfer(sender, recipient, amount); }
0
buggy_34.sol
3,290
function userWithdraw() external { User storage user = userMapping[msg.sender]; if (user.currentInvestAmount > 0) { uint256 avaliableIA = user.currentInvestAmount; if (!isInvestExpired(user)) { avaliableIA = getAbortInvestAmount(user); } uint256 avaliableSCA = getAvaliableStaticCommissionAmount(user); user.staticCommissionBalance = user.staticCommissionBalance.add(avaliableSCA); user.currentInvestTime = 0; user.currentInvestAmount = 0; user.currentInvestCycle = 0; user.currentlevel = 0; user.currentStaticCommissionRatio = 0; user.currentStaticCommissionWithdrawAmount = 0; user.totalWithdrawAmount = user.totalWithdrawAmount.add(avaliableIA); totalWithdrawAmount = totalWithdrawAmount.add(avaliableIA); msg.sender.transfer(avaliableIA); } }
0
buggy_24.sol
4,820
function bug_intou31() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_34.sol
13,131
function getReward_TOD11() payable public{ winner_TOD11.transfer(msg.value); }
4
buggy_44.sol
21,735
function bug_unchk_send31() payable public{ msg.sender.transfer(1 ether);}
7
buggy_1.sol
23,632
function bug_unchk_send17() payable public{ msg.sender.transfer(1 ether);}
7
buggy_43.sol
12,059
function play_TOD35(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD35 = msg.sender; } }
4
buggy_7.sol
8,369
function callnotchecked_unchk37(address payable callee) public { callee.call.value(1 ether); }
3
buggy_7.sol
20,384
function bug_tmstmp33() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_9.sol
10,749
function operatorSend( address sender, address recipient, uint256 amount, bytes calldata data, bytes calldata operatorData ) external;
0
buggy_30.sol
6,551
function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; }
0
BECToken.sol
1,543
function () external payable { revert("this pool cannot receive ether"); }
0
buggy_20.sol
8,328
function sendToWinner_unchk44() public { require(!payedOut_unchk44); winner_unchk44.send(winAmount_unchk44); payedOut_unchk44 = true; }
3
buggy_7.sol
3,063
function transferFrom(address from, address to, uint256 value) public returns (bool) { _transfer(from, to, value); _approve(from, msg.sender, _allowed[from][msg.sender].sub(value)); return true; }
0
buggy_14.sol
926
function bug_txorigin40(address owner_txorigin40) public{ require(tx.origin == owner_txorigin40); }
1
buggy_6.sol
24,514
function bug_unchk_send27() payable public{ msg.sender.transfer(1 ether);}
7
buggy_17.sol
20,111
function play_tmstmp19(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp19 = msg.sender;}}
6
buggy_43.sol
18,141
function bug_tmstmp25() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_24.sol
11,918
function play_TOD7(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD7 = msg.sender; } }
4
buggy_36.sol
9,174
function bug_unchk27(address payable addr) public {addr.send (42 ether); }
3
buggy_43.sol
4,657
function bug_intou20(uint8 p_intou20) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou20; // overflow bug }
2
buggy_7.sol
13,036
function play_TOD11(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD11 = msg.sender; } }
4
buggy_44.sol
22,470
function () payable external { emit receivedEther(msg.sender, msg.value); }
0
buggy_22.sol
16,958
function _deactivateOperator() internal { require(hasActiveOperator(), "only when operator active"); _status = false; emit OperatorUpdated(_operator, false); }
0
buggy_43.sol
7,947
function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); }
3
buggy_6.sol
16,135
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(userBalance_re_ent26[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent26[msg.sender] = 0; }
5
buggy_7.sol
20,932
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; }
0
buggy_15.sol
13,460
function play_TOD33(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD33 = msg.sender; } }
4
buggy_43.sol
3,520
function addMinter(address account) public onlyMinter { _addMinter(account); }
0
buggy_30.sol
16,722
function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public { require(balances_re_ent17[msg.sender] >= _weiToWithdraw); // limit the withdrawal (bool success,)=msg.sender.call.value(_weiToWithdraw)(""); require(success); //bug balances_re_ent17[msg.sender] -= _weiToWithdraw; }
5
buggy_44.sol
15,446
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_32.sol
14,731
function staticBonus() onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(address(this).balance); }
0
buggy_19.sol
19,890
function play_tmstmp27(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp27 = msg.sender;}}
6
buggy_50.sol
6,039
function transfer_intou22(address _to, uint _value) public returns (bool) { require(balances_intou22[msg.sender] - _value >= 0); //bug balances_intou22[msg.sender] -= _value; //bug balances_intou22[_to] += _value; //bug return true; }
2
buggy_38.sol
13,338
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue)); return true; }
0
buggy_40.sol
12,570
function setReward_TOD2() public payable { require (!claimed_TOD2); require(msg.sender == owner_TOD2); owner_TOD2.transfer(reward_TOD2); reward_TOD2 = msg.value; }
4
buggy_35.sol
4,448
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "Safe sub error"); uint256 c = a - b; return c; }
0
buggy_36.sol
12,366
function getReward_TOD31() payable public{ winner_TOD31.transfer(msg.value); }
4
buggy_20.sol
21,437
function totalSupply() public view returns (uint256) { return _totalSupply; }
0
buggy_30.sol
4,916
function setLimits( uint256 _minAmount, uint256 _maxAmount ) public onlyOwner validateLimits(_minAmount, _maxAmount) { minSwapAmount = _minAmount; maxSwapAmount = _maxAmount; emit LimitsChanged(_minAmount, _maxAmount); }
0
buggy_20.sol
19,421
constructor() public { owner = msg.sender; }
0
buggy_34.sol
14,133
function play_TOD17(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD17 = msg.sender; } }
4
buggy_16.sol
14,313
function play_TOD35(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD35 = msg.sender; } }
4
buggy_17.sol
17,448
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_11.sol
18,130
function bug_tmstmp1() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_24.sol
15,103
function isPauser(address account) public view returns (bool) { return _pausers.has(account); }
0
buggy_30.sol
22,078
function bug_unchk_send1() payable public{ msg.sender.transfer(1 ether);}
7
buggy_2.sol
22,991
constructor() public { feeAccount = msg.sender; }
0
buggy_35.sol
17,931
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_14.sol
5,407
function withdraw_intou9() public { require(now > lockTime_intou9[msg.sender]); uint transferValue_intou9 = 10; msg.sender.transfer(transferValue_intou9); }
2
buggy_44.sol
11,559
function play_TOD31(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD31 = msg.sender; } }
4
buggy_6.sol
2,477
function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public { require(tx.origin == owner_txorigin26); _recipient.transfer(address(this).balance); }
1
buggy_38.sol
2,836
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public { require(tx.origin == owner_txorigin30); _recipient.transfer(address(this).balance); }
1
buggy_15.sol
5,975
function bug_intou40(uint8 p_intou40) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou40; // overflow bug }
2
buggy_9.sol
6,462
function increaseLockTime_intou21(uint _secondsToIncrease) public { lockTime_intou21[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_16.sol
7,960
function _transferOwnership(address newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
0
buggy_6.sol
16,407
function callme_re_ent42() public{ require(counter_re_ent42<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent42 += 1; }
5
buggy_35.sol
2,914
function name() public view returns(string memory) { return _name; }
0
buggy_28.sol
22,200
function approve(address spender, uint256 value) external returns (bool);
0
buggy_23.sol
9,273
function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} }
3
buggy_43.sol
14,572
function play_TOD9(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD9 = msg.sender; } }
4
buggy_14.sol
21,420
function symbol() external view returns (string memory);
0
buggy_30.sol
4,649
function transferMasterRole(address newMaster) external onlyOwner { _transferMasterRole(newMaster); }
0
buggy_7.sol
3,931
function bug_intou20(uint8 p_intou20) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou20; // overflow bug }
2
buggy_32.sol
8,068
function withdrawLeftOver_unchk9() public { require(payedOut_unchk9); msg.sender.send(address(this).balance); }
3
buggy_23.sol
6,417
function transfer(address _to, uint _value) public transferable(msg.sender) returns (bool) { return super.transfer(_to, _value); }
0
buggy_12.sol
6,619
function withdraw_ovrflow1() public { require(now > lockTime_intou1[msg.sender]); uint transferValue_intou1 = 10; msg.sender.transfer(transferValue_intou1); }
2
buggy_17.sol
15,522
function changeStakingPercentage(uint _newStakePercentage) public onlyOwner{ stakePercentage = _newStakePercentage; }
0
buggy_33.sol
15,792
function callme_re_ent14() public{ require(counter_re_ent14<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent14 += 1; }
5
buggy_23.sol
15,931
function callme_re_ent42() public{ require(counter_re_ent42<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent42 += 1; }
5
buggy_36.sol
6,809
function withdraw_ovrflow1() public { require(now > lockTime_intou1[msg.sender]); uint transferValue_intou1 = 10; msg.sender.transfer(transferValue_intou1); }
2
buggy_28.sol
2,106
function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public { require(tx.origin == owner_txorigin26); _recipient.transfer(address(this).balance); }
1
buggy_40.sol
18,933
function play_tmstmp2(uint startTime) public { if (startTime + (5 * 1 days) == block.timestamp){ winner_tmstmp2 = msg.sender;}}
6
buggy_6.sol
3,370
function isOperatorFor(address operator, address tokenHolder) external view returns (bool);
0
buggy_30.sol
12,249
function play_TOD19(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD19 = msg.sender; } }
4
buggy_34.sol
20,000
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; }
0
buggy_40.sol
18,004
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 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } }
6
buggy_19.sol
18,878
function play_tmstmp14(uint startTime) public { if (startTime + (5 * 1 days) == block.timestamp){ winner_tmstmp14 = msg.sender;}}
6
buggy_2.sol
1,160
constructor() public { owner = msg.sender; }
0
buggy_36.sol
21,800
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; }
0
buggy_26.sol