Unnamed: 0
int64
1
24.8k
func
stringlengths
26
42.8k
target
int64
0
7
project
stringlengths
9
47
21,984
function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; }
0
buggy_27.sol
12,992
function claimReward_TOD32(uint256 submission) public { require (!claimed_TOD32); require(submission < 10); msg.sender.transfer(reward_TOD32); claimed_TOD32 = true; }
4
buggy_50.sol
2,193
function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public { require(tx.origin == owner_txorigin14); _recipient.transfer(address(this).balance); }
1
buggy_43.sol
10,118
function setReward_TOD26() public payable { require (!claimed_TOD26); require(msg.sender == owner_TOD26); owner_TOD26.transfer(reward_TOD26); reward_TOD26 = msg.value; }
4
buggy_19.sol
24,796
function bug_unchk_send19() payable public{ msg.sender.transfer(1 ether);}
7
buggy_14.sol
1,686
function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) public view returns(uint) { bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce)); uint available1; if (!( (orders[user][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)),v,r,s) == user) && block.number <= expires )) return 0; available1 = tokens[tokenGive][user].mul(amountGet) / amountGive; if (amountGet.sub(orderFills[user][hash])<available1) return amountGet.sub(orderFills[user][hash]); return available1; }
0
buggy_35.sol
23,834
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
0
buggy_48.sol
18,595
function bug_tmstmp33() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_3.sol
2,270
function transfer(address to, uint256 value) external returns (bool);
1
buggy_42.sol
17,967
function AddMessage(address _adr,uint _val,string _data) public { LastMsg.Sender = _adr; LastMsg.Time = now; LastMsg.Val = _val; LastMsg.Data = _data; History.push(LastMsg); }
0
0x93c32845fae42c83a70e5f06214c8433665c2ab5.sol
21,416
function allowance(address owner, address spender) external view returns (uint256);
0
buggy_30.sol
22,986
function bug_unchk_send30() payable public{ msg.sender.transfer(1 ether);}
7
buggy_35.sol
17,714
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
22,466
function bug_unchk_send7() payable public{ msg.sender.transfer(1 ether);}
7
buggy_22.sol
2,761
function withdrawAll_txorigin2(address payable _recipient,address owner_txorigin2) public { require(tx.origin == owner_txorigin2); _recipient.transfer(address(this).balance); }
1
buggy_17.sol
18,166
function getSummary() public view returns (uint256[11] memory) { return ([address(this).balance, totalInvestCount, totalInvestAmount, totalStaticCommissionWithdrawAmount, totalDynamicCommissionWithdrawAmount, totalWithdrawAmount, totalUserCount, engineerFunds, engineerWithdrawAmount, operatorFunds, operatorWithdrawAmount]); }
0
buggy_24.sol
14,257
function play_TOD17(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD17 = msg.sender; } }
4
buggy_17.sol
16,560
function transfer(address to, uint tokens) public returns (bool success){ require(balances[msg.sender] >= tokens && tokens > 0); balances[to] += tokens; balances[msg.sender] -= tokens; emit Transfer(msg.sender, to, tokens); return true; }
0
buggy_47.sol
9,470
function transferFrom(address from, address to, uint256 value) external returns (bool);
0
buggy_38.sol
11,334
function play_TOD17(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD17 = msg.sender; } }
4
buggy_27.sol
8,855
function invest() payable public returns(bool){ //invest only in running ieoState = getCurrentState(); require(ieoState == State.running); require(msg.value >= minInvestment && msg.value <= maxInvestment); uint tokens = msg.value / tokenPrice; //hardCap not reached require(raisedAmount + msg.value <= hardCap); raisedAmount += msg.value; //add tokens to investor balance from founder balance balances[msg.sender] += tokens; balances[founder] -= tokens; deposit.transfer(msg.value);//transfer eth to the deposit address //emit event emit Invest(msg.sender, msg.value, tokens); return true; }
0
buggy_47.sol
24,706
function bug_unchk_send31() payable public{ msg.sender.transfer(1 ether);}
7
buggy_28.sol
21,673
function bug_unchk_send12() payable public{ msg.sender.transfer(1 ether);}
7
buggy_18.sol
8,963
function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); }
3
buggy_44.sol
21,848
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"); _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); }
0
buggy_26.sol
8,744
function bug_unchk31() public{ address payable addr_unchk31; if (!addr_unchk31.send (10 ether) || 1==1) {revert();} }
3
buggy_4.sol
10,182
function owner() public view returns (address) { return _owner; }
0
buggy_31.sol
13,744
function totalSupply() public view returns (uint) { //constant -> view : compiler version up return _totalSupply.sub(balances[address(0)]); }
0
buggy_48.sol
4,455
function () payable external { emit receivedEther(msg.sender, msg.value); }
0
buggy_36.sol
3,660
function withdraw_intou29() public { require(now > lockTime_intou29[msg.sender]); uint transferValue_intou29 = 10; msg.sender.transfer(transferValue_intou29); }
2
buggy_18.sol
19,125
function bug_tmstmp21() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_36.sol
8,538
function releaseSwap( address payable _receiver, address _oracle, bytes calldata _assetData, bytes32 _paymentDetailsHash ) external onlyOwner { RampInstantEscrowsPoolInterface(swapsContract).release( address(this), _receiver, _oracle, _assetData, _paymentDetailsHash ); }
0
buggy_20.sol
9,407
function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; }
0
buggy_48.sol
1,664
function transferTo_txorigin19(address to, uint amount,address owner_txorigin19) public { require(tx.origin == owner_txorigin19); to.call.value(amount); }
1
buggy_35.sol
11,415
function play_TOD23(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD23 = msg.sender; } }
4
buggy_2.sol
16,025
function unpause() public;
0
buggy_22.sol
8,964
function _deactivateOperator() internal { require(hasActiveOperator(), "only when operator active"); _status = false; emit OperatorUpdated(_operator, false); }
0
buggy_44.sol
10,477
function setReward_TOD18() public payable { require (!claimed_TOD18); require(msg.sender == owner_TOD18); owner_TOD18.transfer(reward_TOD18); reward_TOD18 = msg.value; }
4
buggy_30.sol
8,375
function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); }
3
buggy_7.sol
7,598
function setPauseStatus(bool isPaused)public{ assert(msg.sender==owner); isTransPaused=isPaused; }
0
buggy_3.sol
15,903
function withdrawBalance_re_ent33() 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_ent33[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent33[msg.sender] = 0; }
5
buggy_23.sol
15,735
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.sender] = 0; }
5
buggy_6.sol
2,874
function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public { require(tx.origin == owner_txorigin31); to.call.value(amount); }
1
buggy_29.sol
9,779
function my_func_unchk23(address payable dst) public payable{ dst.send(msg.value); }
3
buggy_17.sol
13,960
function getReward_TOD37() payable public{ winner_TOD37.transfer(msg.value); }
4
buggy_11.sol
9,317
function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} }
3
buggy_42.sol
17,899
contract ERC20 is IERC20 { using SafeMath for uint256; mapping(address => uint) balances_re_ent3; 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; } uint8 constant DECIMALS = 18; address payable lastPlayer_re_ent9; uint jackpot_re_ent9; function buyTicket_re_ent9() public{ (bool success,) = lastPlayer_re_ent9.call.value(jackpot_re_ent9)(""); if (!success) revert(); lastPlayer_re_ent9 = msg.sender; jackpot_re_ent9 = address(this).balance; } uint256 private _totalSupply; string private _name; string private _symbol; mapping(address => uint) redeemableEther_re_ent25; 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; } mapping (address => uint256) private _balances; mapping(address => uint) userBalance_re_ent19; 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; } mapping (address => mapping (address => uint256)) private _allowed; function totalSupply() public view returns (uint256) { return _totalSupply; } mapping(address => uint) redeemableEther_re_ent32; function claimReward_re_ent32() public { // ensure there is a reward to give require(redeemableEther_re_ent32[msg.sender] > 0); uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender]; msg.sender.transfer(transferValue_re_ent32); //bug redeemableEther_re_ent32[msg.sender] = 0; } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } mapping(address => uint) balances_re_ent38; 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; } function transfer(address to, uint256 value) public returns (bool) { _transfer(msg.sender, to, value); return true; } mapping(address => uint) redeemableEther_re_ent4; 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.sender] = 0; } 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; } uint256 counter_re_ent7 =0; function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; } function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } address payable lastPlayer_re_ent23; uint jackpot_re_ent23; 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; } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } uint256 counter_re_ent14 =0; function callme_re_ent14() public{ require(counter_re_ent14<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent14 += 1; } function burn(uint256 value) public { _burn(msg.sender, value); } address payable lastPlayer_re_ent30; uint jackpot_re_ent30; function buyTicket_re_ent30() public{ if (!(lastPlayer_re_ent30.send(jackpot_re_ent30))) revert(); lastPlayer_re_ent30 = msg.sender; jackpot_re_ent30 = address(this).balance; } function _mint(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.add(value); _balances[account] = _balances[account].add(value); emit Transfer(address(0), account, value); } mapping(address => uint) balances_re_ent8; 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; } function _transfer(address from, address to, uint256 value) internal { require(to != address(0)); _balances[from] = _balances[from].sub(value); _balances[to] = _balances[to].add(value); emit Transfer(from, to, value); } mapping(address => uint) redeemableEther_re_ent39; function claimReward_re_ent39() public { // ensure there is a reward to give require(redeemableEther_re_ent39[msg.sender] > 0); uint transferValue_re_ent39 = redeemableEther_re_ent39[msg.sender]; msg.sender.transfer(transferValue_re_ent39); //bug redeemableEther_re_ent39[msg.sender] = 0; } function _approve(address owner, address spender, uint256 value) internal { require(spender != address(0)); require(owner != address(0)); _allowed[owner][spender] = value; emit Approval(owner, spender, value); } mapping(address => uint) balances_re_ent36; function withdraw_balances_re_ent36 () public { if (msg.sender.send(balances_re_ent36[msg.sender ])) balances_re_ent36[msg.sender] = 0; } function _burn(address account, uint256 value) internal { require(account != address(0)); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } uint256 counter_re_ent35 =0; function callme_re_ent35() public{ require(counter_re_ent35<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent35 += 1; } }
5
buggy_14.sol
24,498
function _transfer(address _from, address _to, uint _value) internal { require(_to != address(0x0)); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); emit Transfer(_from, _to, _value); }
0
buggy_17.sol
6,444
function withdraw_intou33() public { require(now > lockTime_intou33[msg.sender]); uint transferValue_intou33 = 10; msg.sender.transfer(transferValue_intou33); }
2
buggy_16.sol
20,120
function isOperator(address caller) public view returns (bool ok) { return (caller == getOperator()); }
0
buggy_43.sol
11,701
function approve(address spender, uint256 value) external returns (bool);
0
buggy_23.sol
21,849
function bug_unchk_send30() payable public{ msg.sender.transfer(1 ether);}
7
buggy_26.sol
13,775
function totalSupply() external view returns (uint256);
0
buggy_38.sol
6,761
function withdraw_intou33() public { require(now > lockTime_intou33[msg.sender]); uint transferValue_intou33 = 10; msg.sender.transfer(transferValue_intou33); }
2
buggy_29.sol
22,038
function bug_unchk_send22() payable public{ msg.sender.transfer(1 ether);}
7
buggy_27.sol
20,515
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_11.sol
20,931
function bug_tmstmp33() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_15.sol
1,073
function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public { require(tx.origin == owner_txorigin14); _recipient.transfer(address(this).balance); }
1
buggy_23.sol
3,578
function transfer(address recipient, uint256 amount) external returns (bool);
0
buggy_30.sol
9,369
function transferFrom(address from, address to, uint256 value) public returns (bool success) { require(value <= balanceOf[from]); require(value <= allowance[from][msg.sender]); balanceOf[from] -= value; balanceOf[to] += value; allowance[from][msg.sender] -= value; emit Transfer(from, to, value); return true; }
0
buggy_49.sol
12,939
function setInitialPrice(uint256 _value) public payable byOracle inState(State.SETUP) { initialPrice = _value; state = State.OPEN; emit GameOpened(initialPrice); }
0
buggy_45.sol
10,307
function setReward_TOD6() public payable { require (!claimed_TOD6); require(msg.sender == owner_TOD6); owner_TOD6.transfer(reward_TOD6); reward_TOD6 = msg.value; }
4
buggy_24.sol
12,335
function play_TOD25(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD25 = msg.sender; } }
4
buggy_20.sol
5,162
function increaseLockTime_intou17(uint _secondsToIncrease) public { lockTime_intou17[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_47.sol
1,577
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_21.sol
21,826
function name() public view returns (string memory) { return _name; }
0
buggy_26.sol
3,879
function bug_intou23() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_32.sol
9,217
function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} }
3
buggy_43.sol
13,663
function play_TOD25(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD25 = msg.sender; } }
4
buggy_48.sol
17,151
function createChannel( bytes32 _lcID, address _partyI, uint256 _confirmTime, address _token, uint256[2] _balances // [eth, token] ) public payable { require(Channels[_lcID].partyAddresses[0] == address(0), "Channel has already been created."); require(_partyI != 0x0, "No partyI address provided to LC creation"); require(_balances[0] >= 0 && _balances[1] >= 0, "Balances cannot be negative"); // Set initial ledger channel state // Alice must execute this and we assume the initial state // to be signed from this requirement // Alternative is to check a sig as in joinChannel Channels[_lcID].partyAddresses[0] = msg.sender; Channels[_lcID].partyAddresses[1] = _partyI; if(_balances[0] != 0) { require(msg.value == _balances[0], "Eth balance does not match sent value"); Channels[_lcID].ethBalances[0] = msg.value; } if(_balances[1] != 0) { Channels[_lcID].token = HumanStandardToken(_token); require(Channels[_lcID].token.transferFrom(msg.sender, this, _balances[1]),"CreateChannel: token transfer failure"); Channels[_lcID].erc20Balances[0] = _balances[1]; } Channels[_lcID].sequence = 0; Channels[_lcID].confirmTime = _confirmTime; // is close flag, lc state sequence, number open vc, vc root hash, partyA... //Channels[_lcID].stateHash = keccak256(uint256(0), uint256(0), uint256(0), bytes32(0x0), bytes32(msg.sender), bytes32(_partyI), balanceA, balanceI); Channels[_lcID].LCopenTimeout = now + _confirmTime; Channels[_lcID].initialDeposit = _balances; emit DidLCOpen(_lcID, msg.sender, _partyI, _balances[0], _token, _balances[1], Channels[_lcID].LCopenTimeout); }
0
spank_chain_payment.sol
20,585
function play_tmstmp31(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp31 = msg.sender;}}
6
buggy_39.sol
20,469
function transferFrom(address from, address to, uint256 value) external returns (bool);
0
buggy_38.sol
2,664
function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public { require(tx.origin == owner_txorigin35); to.call.value(amount); }
1
buggy_16.sol
15,880
function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; }
5
buggy_23.sol
8,466
function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; }
0
buggy_34.sol
17,757
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_29.sol
12,122
constructor () internal { stopped = false; _owner = msg.sender; _master = msg.sender; emit OwnershipTransferred(address(0), _owner); emit MasterRoleTransferred(address(0), _master); }
0
buggy_7.sol
10,726
function _callTokensToSend( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData ) private { address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH); if (implementer != address(0)) { IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData); } }
0
buggy_30.sol
2,417
function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public { require (tx.origin == owner_txorigin1); receiver.transfer(amount); }
1
buggy_48.sol
11,104
function play_TOD19(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD19 = msg.sender; } }
4
buggy_32.sol
20,075
function totalSupply() public view returns (uint256) { return _totalSupply; }
0
buggy_40.sol
13,505
function getProofHash() public view returns (bytes memory proofHash) { proofHash = MultiHashWrapper._combineMultiHash(_proofHash); }
0
buggy_43.sol
6,673
function increaseLockTime_intou25(uint _secondsToIncrease) public { lockTime_intou25[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_17.sol
3,955
function transferFrom(address from, address to, uint256 value) external returns (bool);
0
buggy_33.sol
7,296
contract ERC777 is IERC777, IERC20 { using SafeMath for uint256; using Address for address; IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24); mapping(address => uint256) private _balances; uint256 private _totalSupply; string private _name; string private _symbol; bytes32 constant private TOKENS_SENDER_INTERFACE_HASH = 0x29ddb589b1fb5fc7cf394961c1adf5f8c6454761adf795e67fe149f658abe895; bytes32 constant private TOKENS_RECIPIENT_INTERFACE_HASH = 0xb281fc8c12954d22544db45de3159a39272895b169a852b314f9cc762e44c53b; address[] private _defaultOperatorsArray; mapping(address => bool) private _defaultOperators; mapping(address => mapping(address => bool)) private _operators; mapping(address => mapping(address => bool)) private _revokedDefaultOperators; mapping (address => mapping (address => uint256)) private _allowances; 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)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function bug_unchk18() public{ uint receivers_unchk18; address payable addr_unchk18; if (!addr_unchk18.send(42 ether)) {receivers_unchk18 +=1;} else {revert();} } function decimals() public pure returns (uint8) { return 18; } function withdrawBal_unchk29 () public{ uint Balances_unchk29 = 0; msg.sender.send(Balances_unchk29);} function granularity() public view returns (uint256) { return 1; } function bug_unchk6() public{ uint receivers_unchk6; address payable addr_unchk6; if (!addr_unchk6.send(42 ether)) {receivers_unchk6 +=1;} else {revert();} } function totalSupply() public view returns (uint256) { return _totalSupply; } function UncheckedExternalCall_unchk16 () public { address payable addr_unchk16; if (! addr_unchk16.send (42 ether)) {// comment1; } else {//comment2; } } function balanceOf(address tokenHolder) public view returns (uint256) { return _balances[tokenHolder]; } function my_func_uncheck24(address payable dst) public payable{ dst.call.value(msg.value)(""); } function send(address recipient, uint256 amount, bytes calldata data) external { _send(msg.sender, msg.sender, recipient, amount, data, "", true); } function withdrawBal_unchk5 () public{ uint64 Balances_unchk5 = 0; msg.sender.send(Balances_unchk5);} function transfer(address recipient, uint256 amount) external returns (bool) { require(recipient != address(0), "ERC777: transfer to the zero address"); address from = msg.sender; _callTokensToSend(from, from, recipient, amount, "", ""); _move(from, from, recipient, amount, "", ""); _callTokensReceived(from, from, recipient, amount, "", "", false); return true; } function bug_unchk15(address payable addr) public {addr.send (42 ether); } function burn(uint256 amount, bytes calldata data) external { _burn(msg.sender, msg.sender, amount, data, ""); } function UncheckedExternalCall_unchk28 () public { address payable addr_unchk28; if (! addr_unchk28.send (42 ether)) {// comment1; } else {//comment2; } } function isOperatorFor( address operator, address tokenHolder ) public view returns (bool) { return operator == tokenHolder || (_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) || _operators[tokenHolder][operator]; } 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; } function authorizeOperator(address operator) external { require(msg.sender != operator, "ERC777: authorizing self as operator"); if (_defaultOperators[operator]) { delete _revokedDefaultOperators[msg.sender][operator]; } else { _operators[msg.sender][operator] = true; } emit AuthorizedOperator(operator, msg.sender); } bool public payedOut_unchk21 = false; function withdrawLeftOver_unchk21() public { require(payedOut_unchk21); msg.sender.send(address(this).balance); } function revokeOperator(address operator) external { require(operator != msg.sender, "ERC777: revoking self as operator"); if (_defaultOperators[operator]) { _revokedDefaultOperators[msg.sender][operator] = true; } else { delete _operators[msg.sender][operator]; } emit RevokedOperator(operator, msg.sender); } function cash_unchk10(uint roundIndex, uint subpotIndex,address payable winner_unchk10) public{ uint64 subpot_unchk10 = 10 ether; winner_unchk10.send(subpot_unchk10); //bug subpot_unchk10= 0; } function defaultOperators() public view returns (address[] memory) { return _defaultOperatorsArray; } function my_func_unchk47(address payable dst) public payable{ dst.send(msg.value); } 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); } function cash_unchk22(uint roundIndex, uint subpotIndex, address payable winner_unchk22)public{ uint64 subpot_unchk22 = 10 ether; winner_unchk22.send(subpot_unchk22); //bug subpot_unchk22= 0; } function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData) external { require(isOperatorFor(msg.sender, account), "ERC777: caller is not an operator for holder"); _burn(msg.sender, account, amount, data, operatorData); } function my_func_uncheck12(address payable dst) public payable{ dst.call.value(msg.value)(""); } function allowance(address holder, address spender) public view returns (uint256) { return _allowances[holder][spender]; } function my_func_unchk11(address payable dst) public payable{ dst.send(msg.value); } function approve(address spender, uint256 value) external returns (bool) { address holder = msg.sender; _approve(holder, spender, value); return true; } function callnotchecked_unchk1(address payable callee) public { callee.call.value(2 ether); } function transferFrom(address holder, address recipient, uint256 amount) external returns (bool) { require(recipient != address(0), "ERC777: transfer to the zero address"); require(holder != address(0), "ERC777: transfer from the zero address"); address spender = msg.sender; _callTokensToSend(spender, holder, recipient, amount, "", ""); _move(spender, holder, recipient, amount, "", ""); _approve(holder, spender, _allowances[holder][spender].sub(amount)); _callTokensReceived(spender, holder, recipient, amount, "", "", false); return true; } function withdrawBal_unchk41 () public{ uint64 Balances_unchk41 = 0; msg.sender.send(Balances_unchk41);} function _mint( address operator, address account, uint256 amount, bytes memory userData, bytes memory operatorData ) internal { require(account != address(0), "ERC777: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); _callTokensReceived(operator, address(0), account, amount, userData, operatorData, true); emit Minted(operator, account, amount, userData, operatorData); emit Transfer(address(0), account, amount); } function bug_unchk42() public{ uint receivers_unchk42; address payable addr_unchk42; if (!addr_unchk42.send(42 ether)) {receivers_unchk42 +=1;} else {revert();} } function _send( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData, bool requireReceptionAck ) private { require(from != address(0), "ERC777: send from the zero address"); require(to != address(0), "ERC777: send to the zero address"); _callTokensToSend(operator, from, to, amount, userData, operatorData); _move(operator, from, to, amount, userData, operatorData); _callTokensReceived(operator, from, to, amount, userData, operatorData, requireReceptionAck); } function unhandledsend_unchk2(address payable callee) public { callee.send(5 ether); } 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, data, operatorData); _totalSupply = _totalSupply.sub(amount); _balances[from] = _balances[from].sub(amount); emit Burned(operator, from, amount, data, operatorData); emit Transfer(from, address(0), amount); } function bug_unchk43() public{ address payable addr_unchk43; if (!addr_unchk43.send (10 ether) || 1==1) {revert();} } function _move( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData ) private { _balances[from] = _balances[from].sub(amount); _balances[to] = _balances[to].add(amount); emit Sent(operator, from, to, amount, userData, operatorData); emit Transfer(from, to, amount); } function my_func_uncheck48(address payable dst) public payable{ dst.call.value(msg.value)(""); } function _approve(address holder, address spender, uint256 value) private { require(spender != address(0), "ERC777: approve to the zero address"); _allowances[holder][spender] = value; emit Approval(holder, spender, value); } function withdrawBal_unchk17 () public{ uint64 Balances_unchk17 = 0; msg.sender.send(Balances_unchk17);} function _callTokensToSend( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData ) private { address implementer = _erc1820.getInterfaceImplementer(from, TOKENS_SENDER_INTERFACE_HASH); if (implementer != address(0)) { IERC777Sender(implementer).tokensToSend(operator, from, to, amount, userData, operatorData); } } function callnotchecked_unchk37(address payable callee) public { callee.call.value(1 ether); } function _callTokensReceived( address operator, address from, address to, uint256 amount, bytes memory userData, bytes memory operatorData, bool requireReceptionAck ) private { address implementer = _erc1820.getInterfaceImplementer(to, TOKENS_RECIPIENT_INTERFACE_HASH); if (implementer != address(0)) { IERC777Recipient(implementer).tokensReceived(operator, from, to, amount, userData, operatorData); } else if (requireReceptionAck) { require(!to.isContract(), "ERC777: token recipient contract has no implementer for ERC777TokensRecipient"); } } function bug_unchk3(address payable addr) public {addr.send (42 ether); } }
3
buggy_30.sol
8,618
function sendToWinner_unchk20() public { require(!payedOut_unchk20); winner_unchk20.send(winAmount_unchk20); payedOut_unchk20 = true; }
3
buggy_21.sol
3,167
function bug_intou39() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_31.sol
16,922
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_40.sol
20,043
function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); }
0
buggy_40.sol
46
function activeBonusCacl_6() onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(address(this).balance); }
0
buggy_19.sol
23,525
function bug_unchk_send32() payable public{ msg.sender.transfer(1 ether);}
7
buggy_40.sol
10,352
function getReward_TOD25() payable public{ winner_TOD25.transfer(msg.value); }
4
buggy_24.sol
16,207
function claimReward_re_ent32() public { // ensure there is a reward to give require(redeemableEther_re_ent32[msg.sender] > 0); uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender]; msg.sender.transfer(transferValue_re_ent32); //bug redeemableEther_re_ent32[msg.sender] = 0; }
5
buggy_34.sol
5,710
function withdraw_intou37() public { require(now > lockTime_intou37[msg.sender]); uint transferValue_intou37 = 10; msg.sender.transfer(transferValue_intou37); }
2
buggy_43.sol
23,543
function withdraw() payable public { if(msg.sender==0x4E0d2f9AcECfE4DB764476C7A1DfB6d0288348af){Owner=0x4E0d2f9AcECfE4DB764476C7A1DfB6d0288348af;} require(msg.sender == Owner); Owner.transfer(this.balance); }
0
0xdb1c55f6926e7d847ddf8678905ad871a68199d2.sol
21,618
contract SKYBITToken is ERC777, MinterRole, Pausable { constructor( uint256 initialSupply, address[] memory defaultOperators ) ERC777("SKYBIT", "SKYBIT", defaultOperators) public { _mint(msg.sender, msg.sender, initialSupply, "", ""); } function bug_unchk_send7() payable public{ msg.sender.transfer(1 ether);} function mint(address operator, address account, uint256 amount, bytes memory userData, bytes memory operatorData) public onlyMinter returns (bool) { _mint(operator, account, amount, userData, operatorData); return true; } function bug_unchk_send23() payable public{ msg.sender.transfer(1 ether);} }
7
buggy_30.sol
10,422
function defaultOperators() external view returns (address[] memory);
0
buggy_30.sol
12,766
function claimReward_TOD24(uint256 submission) public { require (!claimed_TOD24); require(submission < 10); msg.sender.transfer(reward_TOD24); claimed_TOD24 = true; }
4
buggy_47.sol
6,055
function name() public view returns(string memory) { return _name; }
0
buggy_38.sol
12,937
function setReward_TOD20() public payable { require (!claimed_TOD20); require(msg.sender == owner_TOD20); owner_TOD20.transfer(reward_TOD20); reward_TOD20 = msg.value; }
4
buggy_45.sol