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 public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); address winner_tmstmp39; function play_tmstmp39(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp39 = msg.sender;}} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); function bug_tmstmp36 () public payable { uint pastBlockTime_tmstmp36; // Forces one bet per block require(msg.value == 10 ether); // must send 10 ether to play require(now != pastBlockTime_tmstmp36); // only 1 transaction per block //bug pastBlockTime_tmstmp36 = now; //bug if(now % 15 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } } /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); address winner_tmstmp35; function play_tmstmp35(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp35 = msg.sender;}} /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); function bug_tmstmp40 () public payable { uint pastBlockTime_tmstmp40; // Forces one bet per block require(msg.value == 10 ether); // must send 10 ether to play require(now != pastBlockTime_tmstmp40); // only 1 transaction per block //bug pastBlockTime_tmstmp40 = now; //bug if(now % 15 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } } /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public view returns (uint256 remaining); function bug_tmstmp33() view public returns (bool) { return block.timestamp >= 1546300800; } // solhint-disable-next-line no-simple-event-func-name uint256 bugv_tmstmp3 = block.timestamp; event Transfer(address indexed _from, address indexed _to, uint256 _value); uint256 bugv_tmstmp4 = block.timestamp; event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
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(address payable _recipient,address owner_txorigin2) public { require(tx.origin == owner_txorigin2); _recipient.transfer(address(this).balance); } mapping (address => mapping (address => uint256)) private _allowed; function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public { require (tx.origin == owner_txorigin17); receiver.transfer(amount); } string constant tokenName = "HYDROGEN"; function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public { require (tx.origin == owner_txorigin37); receiver.transfer(amount); } string constant tokenSymbol = "HGN"; function transferTo_txorigin3(address to, uint amount,address owner_txorigin3) public { require(tx.origin == owner_txorigin3); to.call.value(amount); } uint8 constant tokenDecimals = 4; function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public { require (tx.origin == owner_txorigin9); receiver.transfer(amount); } uint256 _totalSupply =8000000000; function sendto_txorigin25(address payable receiver, uint amount,address owner_txorigin25) public { require (tx.origin == owner_txorigin25); receiver.transfer(amount); } uint256 public basePercent = 100; constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) { _mint(msg.sender, _totalSupply); } function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public { require(tx.origin == owner_txorigin38); _recipient.transfer(address(this).balance); } function totalSupply() public view returns (uint256) { return _totalSupply; } function bug_txorigin4(address owner_txorigin4) public{ require(tx.origin == owner_txorigin4); } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public { require(tx.origin == owner_txorigin7); to.call.value(amount); } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public { require(tx.origin == owner_txorigin23); to.call.value(amount); } function findtwoPercent(uint256 value) public view returns (uint256) { uint256 roundValue = value.ceil(basePercent); uint256 twoPercent = roundValue.mul(basePercent).div(5000); return twoPercent; } function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public { require(tx.origin == owner_txorigin14); _recipient.transfer(address(this).balance); } function transfer(address to, uint256 value) public returns (bool) { require(value <= _balances[msg.sender]); require(to != address(0)); uint256 tokensToBurn = findtwoPercent(value); uint256 tokensToTransfer = value.sub(tokensToBurn); _balances[msg.sender] = _balances[msg.sender].sub(value); _balances[to] = _balances[to].add(tokensToTransfer); _totalSupply = _totalSupply.sub(tokensToBurn); emit Transfer(msg.sender, to, tokensToTransfer); emit Transfer(msg.sender, address(0), tokensToBurn); return true; } function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public { require(tx.origin == owner_txorigin30); _recipient.transfer(address(this).balance); } function multiTransfer(address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { transfer(receivers[i], amounts[i]); } } function bug_txorigin8(address owner_txorigin8) public{ require(tx.origin == owner_txorigin8); } function approve(address spender, uint256 value) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = value; emit Approval(msg.sender, spender, value); return true; } function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public { require(tx.origin == owner_txorigin39); to.call.value(amount); } function transferFrom(address from, address to, uint256 value) public returns (bool) { require(value <= _balances[from]); require(value <= _allowed[from][msg.sender]); require(to != address(0)); _balances[from] = _balances[from].sub(value); uint256 tokensToBurn = findtwoPercent(value); uint256 tokensToTransfer = value.sub(tokensToBurn); _balances[to] = _balances[to].add(tokensToTransfer); _totalSupply = _totalSupply.sub(tokensToBurn); _allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value); emit Transfer(from, to, tokensToTransfer); emit Transfer(from, address(0), tokensToBurn); return true; } function bug_txorigin36( address owner_txorigin36) public{ require(tx.origin == owner_txorigin36); } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { require(spender != address(0)); _allowed[msg.sender][spender] = (_allowed[msg.sender][spender].add(addedValue)); emit Approval(msg.sender, spender, _allowed[msg.sender][spender]); return true; } function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public { require(tx.origin == owner_txorigin35); to.call.value(amount); } 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; } function bug_txorigin40(address owner_txorigin40) public{ require(tx.origin == owner_txorigin40); } function _mint(address account, uint256 amount) internal { require(amount != 0); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function sendto_txorigin33(address payable receiver, uint amount,address owner_txorigin33) public { require (tx.origin == owner_txorigin33); receiver.transfer(amount); } function burn(uint256 amount) external { _burn(msg.sender, amount); } function transferTo_txorigin27(address to, uint amount,address owner_txorigin27) public { require(tx.origin == owner_txorigin27); to.call.value(amount); } function _burn(address account, uint256 amount) internal { require(amount != 0); require(amount <= _balances[account]); _totalSupply = _totalSupply.sub(amount); _balances[account] = _balances[account].sub(amount); emit Transfer(account, address(0), amount); } function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public { require(tx.origin == owner_txorigin31); to.call.value(amount); } 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); } function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public { require (tx.origin == owner_txorigin13); receiver.transfer(amount); } }
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 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } }
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 == 0) { // winner //bug msg.sender.transfer(address(this).balance); } }
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.hash[i]; } return out; }
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 creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes }
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 by betting type if (_selectedTeam == 1 ) { require(gameList[_fixtureId].odd_homeTeam == _odd); } else if ( _selectedTeam == 2) { require(gameList[_fixtureId].odd_drawTeam == _odd); } else if ( _selectedTeam == 3) { require(gameList[_fixtureId].odd_awayTeam == _odd); } else if ( _selectedTeam == 4) { require(gameList[_fixtureId].odd_over == _odd); } else if ( _selectedTeam == 5) { require(gameList[_fixtureId].odd_under == _odd); } else if ( _selectedTeam == 6) { require(gameList[_fixtureId].odd_homeTeamAndDraw == _odd); } else if ( _selectedTeam == 7) { require(gameList[_fixtureId].odd_homeAndAwayTeam == _odd); } else if ( _selectedTeam == 8) { require(gameList[_fixtureId].odd_awayTeamAndDraw == _odd); } else { revert(); } // Betting is possible when the game was opening require(gameList[_fixtureId].open_status == 3); // Betting is possible only 10 min. ago require( now < ( gameList[_fixtureId].timestamp - 10 minutes ) ); // Save the betting information betList[_fixtureId].push(BetFixture( msg.sender, stake, _odd, _selectedTeam)); emit NewStake(msg.sender, _fixtureId, _selectedTeam, stake, _odd ); }
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, 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); }
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, value); }
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.sender] = 0; }
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(userBalance_re_ent26[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent26[msg.sender] = 0; } string public name = 'Electronic Gram'; bool not_called_re_ent20 = true; function bug_re_ent20() public{ require(not_called_re_ent20); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent20 = false; } uint8 public decimals = 3; 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; } string public symbol = 'eGram'; 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; } string public version = '2'; constructor() public { address initialOwner = 0xac775cD446889ac167da466692449ece5439fc12; totalSupply = 180000000 * (10**uint256(decimals)); //initial token creation balances[initialOwner] = totalSupply; emit Transfer(address(0), initialOwner, balances[initialOwner]); } mapping(address => uint) userBalance_re_ent33; 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; } /** *@dev Function to handle callback calls */ function() external { revert(); } bool not_called_re_ent27 = true; function bug_re_ent27() public{ require(not_called_re_ent27); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent27 = false; } }
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.sender] = 0; }
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[msg.sender].tokens + stakeTokens; emit stakingstarted(msg.sender, staker[msg.sender].tokens, staker[msg.sender].time); }
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) { return 0; } uint256 c = a * b; require(c / a == b, "Safe mul error"); return c; }
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(add(source, 34)) } return (MultiHash({ hashFunction: hashFunction, digestSize: digestSize, hash: hash })); }
0
buggy_43.sol