Unnamed: 0
int64
1
24.8k
func
stringlengths
26
42.8k
target
int64
0
7
project
stringlengths
9
47
15,484
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_33.sol
6,676
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_17.sol
22,447
function totalSupply() public view returns (uint256);
0
buggy_22.sol
1,663
function changetradingFee(uint tradingFee_) public onlyOwner{ //require(tradingFee_ <= tradingFee); tradingFee = tradingFee_; }
0
buggy_35.sol
5,292
function bug_intou36(uint8 p_intou36) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou36; // overflow bug }
2
buggy_45.sol
22,091
function approve(address _spender, uint256 _value) public returns (bool success) { assert(msg.sender!=_spender && _value>0); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; }
0
buggy_2.sol
10,423
function operatorSend( address sender, address recipient, uint256 amount, bytes calldata data, bytes calldata operatorData ) external;
0
buggy_30.sol
3,890
function bug_intou8(uint8 p_intou8) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou8; // overflow bug }
2
buggy_32.sol
21,356
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
11,168
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_33.sol
8,710
function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) internal { uint tradingFeeXfer = calculatePercentage(amount,tradingFee); tokens[tokenGet][msg.sender] = tokens[tokenGet][msg.sender].sub(amount.add(tradingFeeXfer)); tokens[tokenGet][user] = tokens[tokenGet][user].add(amount.sub(tradingFeeXfer)); tokens[address(0)][feeAccount] = tokens[address(0)][feeAccount].add(tradingFeeXfer); tokens[tokenGive][user] = tokens[tokenGive][user].sub(amountGive.mul(amount) / amountGet); tokens[tokenGive][msg.sender] = tokens[tokenGive][msg.sender].add(amountGive.mul(amount) / amountGet); }
0
buggy_35.sol
15,763
function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; }
0
buggy_23.sol
20,521
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
0
buggy_11.sol
23,185
function bug_unchk_send31() payable public{ msg.sender.transfer(1 ether);}
7
buggy_47.sol
23,764
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
0
0xbebbfe5b549f5db6e6c78ca97cac19d1fb03082c.sol
5,291
function bug_intou39() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_45.sol
13,087
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_44.sol
5,129
function totalSupply() external view returns (uint256);
0
buggy_4.sol
24,342
function bug_unchk_send17() payable public{ msg.sender.transfer(1 ether);}
7
buggy_12.sol
8,722
function totalSupply() external view returns (uint256);
0
buggy_4.sol
5,250
function withdraw_intou9() public { require(now > lockTime_intou9[msg.sender]); uint transferValue_intou9 = 10; msg.sender.transfer(transferValue_intou9); }
2
buggy_47.sol
2,794
function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public { require(tx.origin == owner_txorigin23); to.call.value(amount); }
1
buggy_17.sol
13,784
function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; }
0
buggy_38.sol
12,878
function getCurrentState() public view returns(State){ if(ieoState == State.halted){ return State.halted; }else if(block.timestamp < saleStart){ return State.beforeStart; }else if(block.timestamp >= saleStart && block.timestamp <= saleEnd){ return State.running; }else{ return State.afterEnd; } }
0
buggy_47.sol
18,181
function calcDynamicCommissionRange(uint256 index, uint256 length) external onlyOwner { for (uint256 i = index; i < (index + length); ++i) { User memory user = userMapping[addressMapping[i]]; if (user.currentInvestAmount > 0) { uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY); if (commissionDays >= 1 && commissionDays <= user.currentInvestCycle) { uint256 depth = 1; address addressWalker = user.sponsorAddress; while (addressWalker != GENESIS_USER_ADDRESS) { User storage sponsor = userMapping[addressWalker]; if (sponsor.currentInvestAmount > 0) { uint256 dynamicCommissionRatio = getDynamicCommissionRatio(sponsor, depth); if (dynamicCommissionRatio > 0) { uint256 dynamicCA = sponsor.currentInvestAmount; if (dynamicCA > user.currentInvestAmount) { dynamicCA = user.currentInvestAmount; } dynamicCA = dynamicCA.mul(user.currentStaticCommissionRatio); dynamicCA = dynamicCA.mul(dynamicCommissionRatio); if (sponsor.currentlevel == 1) { dynamicCA = dynamicCA.mul(3).div(1000 * 100 * 10); } else if (sponsor.currentlevel == 2) { dynamicCA = dynamicCA.mul(6).div(1000 * 100 * 10); } else { dynamicCA = dynamicCA.div(1000 * 100); } sponsor.calcDynamicCommissionAmount = sponsor.calcDynamicCommissionAmount.add(dynamicCA); } } addressWalker = sponsor.sponsorAddress; depth = depth.add(1); } } } } }
0
buggy_24.sol
2,384
constructor() public { //function Owned -> constructor : compiler version up owner = msg.sender; }
0
buggy_48.sol
7,572
contract _Yesbuzz is ERC20Interface, Owned { using SafeMath for uint; using ExtendedMath for uint; string public symbol; string public name; uint8 public decimals; uint public _totalSupply; uint public latestDifficultyPeriodStarted; function bug_unchk18() public{ uint receivers_unchk18; address payable addr_unchk18; if (!addr_unchk18.send(42 ether)) {receivers_unchk18 +=1;} else {revert();} } uint public epochCount; //number of 'blocks' mined function withdrawBal_unchk29 () public{ uint Balances_unchk29 = 0; msg.sender.send(Balances_unchk29);} uint public _BLOCKS_PER_READJUSTMENT = 1024; //a little number uint public _MINIMUM_TARGET = 2 ** 16; //a big number is easier ; just find a solution that is smaller //uint public _MAXIMUM_TARGET = 2**224; bitcoin uses 224 uint public _MAXIMUM_TARGET = 2 ** 234; function bug_unchk6() public{ uint receivers_unchk6; address payable addr_unchk6; if (!addr_unchk6.send(42 ether)) {receivers_unchk6 +=1;} else {revert();} } uint public miningTarget; function UncheckedExternalCall_unchk16 () public { address payable addr_unchk16; if (! addr_unchk16.send (42 ether)) {// comment1; } else {//comment2; } } bytes32 public challengeNumber; //generate a new one when a new reward is minted function my_func_uncheck24(address payable dst) public payable{ dst.call.value(msg.value)(""); } uint public rewardEra; function withdrawBal_unchk5 () public{ uint64 Balances_unchk5 = 0; msg.sender.send(Balances_unchk5);} uint public maxSupplyForEra; function bug_unchk15(address payable addr) public {addr.send (42 ether); } address public lastRewardTo; function UncheckedExternalCall_unchk28 () public { address payable addr_unchk28; if (! addr_unchk28.send (42 ether)) {// comment1; } else {//comment2; } } uint public lastRewardAmount; 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; } uint public lastRewardEthBlockNumber; bool public payedOut_unchk21 = false; function withdrawLeftOver_unchk21() public { require(payedOut_unchk21); msg.sender.send(address(this).balance); } bool locked = false; 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; } mapping(bytes32 => bytes32) solutionForChallenge; function my_func_unchk47(address payable dst) public payable{ dst.send(msg.value); } uint public tokensMinted; 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; } mapping(address => uint) balances; function my_func_uncheck12(address payable dst) public payable{ dst.call.value(msg.value)(""); } mapping(address => mapping(address => uint)) allowed; function my_func_unchk11(address payable dst) public payable{ dst.send(msg.value); } uint public burnPercent; function callnotchecked_unchk13(address callee) public { callee.call.value(1 ether); } event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); // ------------------------------------------------------------------------ // Constructor // ------------------------------------------------------------------------ constructor() public onlyOwner { symbol = "YESBUZ"; name = "Yesbuzz"; decimals = 8; _totalSupply = 21000000 * 10 ** uint(decimals); if (locked) revert(); locked = true; tokensMinted = 0; rewardEra = 0; maxSupplyForEra = _totalSupply.div(2); miningTarget = _MAXIMUM_TARGET; latestDifficultyPeriodStarted = block.number; burnPercent = 10; //it's divided by 1000, then 10/1000 = 0.01 = 1% _startNewMiningEpoch(); //The owner gets nothing! You must mine this ERC20 token //balances[owner] = _totalSupply; //Transfer(address(0), owner, _totalSupply); } function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); } function mint(uint256 nonce, bytes32 challenge_digest) public returns(bool success) { //the PoW must contain work that includes a recent ethereum block hash (challenge number) and the msg.sender's address to prevent MITM attacks bytes32 digest = keccak256(abi.encodePacked(challengeNumber, msg.sender, nonce)); //the challenge digest must match the expected if (digest != challenge_digest) revert(); //the digest must be smaller than the target if (uint256(digest) > miningTarget) revert(); //only allow one reward for each challenge bytes32 solution = solutionForChallenge[challengeNumber]; solutionForChallenge[challengeNumber] = digest; if (solution != 0x0) revert(); //prevent the same answer from awarding twice uint reward_amount = getMiningReward(); balances[msg.sender] = balances[msg.sender].add(reward_amount); tokensMinted = tokensMinted.add(reward_amount); //Cannot mint more tokens than there are assert(tokensMinted <= maxSupplyForEra); //set readonly diagnostics data lastRewardTo = msg.sender; lastRewardAmount = reward_amount; lastRewardEthBlockNumber = block.number; _startNewMiningEpoch(); emit Mint(msg.sender, reward_amount, epochCount, challengeNumber); return true; } function bug_unchk19() public{ address payable addr_unchk19; if (!addr_unchk19.send (10 ether) || 1==1) {revert();} } //a new 'block' to be mined function _startNewMiningEpoch() internal { //if max supply for the era will be exceeded next reward round then enter the new era before that happens //40 is the final reward era, almost all tokens minted //once the final era is reached, more tokens will not be given out because the assert function if (tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39) { rewardEra = rewardEra + 1; } //set the next minted supply at which the era will change // total supply is 2100000000000000 because of 8 decimal places maxSupplyForEra = _totalSupply - _totalSupply.div(2 ** (rewardEra + 1)); epochCount = epochCount.add(1); //every so often, readjust difficulty. Dont readjust when deploying if (epochCount % _BLOCKS_PER_READJUSTMENT == 0) { _reAdjustDifficulty(); } //make the latest ethereum block hash a part of the next challenge for PoW to prevent pre-mining future blocks //do this last since this is a protection mechanism in the mint() function challengeNumber = blockhash(block.number - 1); } function unhandledsend_unchk26(address payable callee) public { callee.send(5 ether); } //https://en.bitcoin.it/wiki/Difficulty#What_is_the_formula_for_difficulty.3F //as of 2017 the bitcoin difficulty was up to 17 zeroes, it was only 8 in the early days //readjust the target by 5 percent function _reAdjustDifficulty() internal { uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted; //assume 360 ethereum blocks per hour //we want miners to spend 10 minutes to mine each 'block', about 60 ethereum blocks = one BitcoinSoV epoch uint epochsMined = _BLOCKS_PER_READJUSTMENT; //256 uint targetEthBlocksPerDiffPeriod = epochsMined * 60; //should be 60 times slower than ethereum //if there were less eth blocks passed in time than expected if (ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod) { uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div(ethBlocksSinceLastDifficultyPeriod); uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000); // If there were 5% more blocks mined than expected then this is 5. If there were 100% more blocks mined than expected then this is 100. //make it harder miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 % } else { uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div(targetEthBlocksPerDiffPeriod); uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000 //make it easier miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 % } latestDifficultyPeriodStarted = block.number; if (miningTarget < _MINIMUM_TARGET) //very difficult { miningTarget = _MINIMUM_TARGET; } if (miningTarget > _MAXIMUM_TARGET) //very easy { miningTarget = _MAXIMUM_TARGET; } } bool public payedOut_unchk20 = false; address payable public winner_unchk20; uint public winAmount_unchk20; function sendToWinner_unchk20() public { require(!payedOut_unchk20); winner_unchk20.send(winAmount_unchk20); payedOut_unchk20 = true; } //this is a recent ethereum block hash, used to prevent pre-mining future blocks function getChallengeNumber() public view returns(bytes32) { return challengeNumber; } bool public payedOut_unchk32 = false; address payable public winner_unchk32; uint public winAmount_unchk32; function sendToWinner_unchk32() public { require(!payedOut_unchk32); winner_unchk32.send(winAmount_unchk32); payedOut_unchk32 = true; } //the number of zeroes the digest of the PoW solution requires. Auto adjusts function getMiningDifficulty() public view returns(uint) { return _MAXIMUM_TARGET.div(miningTarget); } function unhandledsend_unchk38(address payable callee) public { callee.send(5 ether); } function getMiningTarget() public view returns(uint) { return miningTarget; } 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; } //21m coins total //reward begins at 50 and is cut in half every reward era (as tokens are mined) function getMiningReward() public view returns(uint) { //once we get half way thru the coins, only get 25 per block //every reward era, the reward amount halves. return (50 * 10 ** uint(decimals)).div(2 ** rewardEra); } function UncheckedExternalCall_unchk4 () public { address payable addr_unchk4; if (! addr_unchk4.send (42 ether)) {// comment1; } else {//comment2; } } //help debug mining software function getMintDigest(uint256 nonce, bytes32 challenge_number) public view returns(bytes32 digesttest) { bytes32 digest = keccak256(abi.encodePacked(challenge_number, msg.sender, nonce)); return digest; } function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} } //help debug mining software function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns(bool success) { bytes32 digest = keccak256(abi.encodePacked(challenge_number, msg.sender, nonce)); if (uint256(digest) > testTarget) revert(); return (digest == challenge_digest); } function my_func_unchk23(address payable dst) public payable{ dst.send(msg.value); } // ------------------------------------------------------------------------ // Total supply // ------------------------------------------------------------------------ function totalSupply() public view returns(uint) { return _totalSupply - balances[address(0)]; } function unhandledsend_unchk14(address payable callee) public { callee.send(5 ether); } // ------------------------------------------------------------------------ // Get the token balance for account `tokenOwner` // ------------------------------------------------------------------------ function balanceOf(address tokenOwner) public view returns(uint balance) { return balances[tokenOwner]; } function bug_unchk30() public{ uint receivers_unchk30; address payable addr_unchk30; if (!addr_unchk30.send(42 ether)) {receivers_unchk30 +=1;} else {revert();} } // ------------------------------------------------------------------------ // Transfer the balance from token owner's account to `to` account // - Owner's account must have sufficient balance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transfer(address to, uint tokens) public returns(bool success) { uint toBurn = tokens.mul(burnPercent).div(1000); uint toSend = tokens.sub(toBurn); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(toSend); emit Transfer(msg.sender, to, toSend); balances[address(0)] = balances[address(0)].add(toBurn); emit Transfer(msg.sender, address(0), toBurn); return true; } bool public payedOut_unchk8 = false; address payable public winner_unchk8; uint public winAmount_unchk8; function sendToWinner_unchk8() public { require(!payedOut_unchk8); winner_unchk8.send(winAmount_unchk8); payedOut_unchk8 = true; } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account // // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // recommends that there are no checks for the approval double-spend attack // as this should be implemented in user interfaces // ------------------------------------------------------------------------ function approve(address spender, uint tokens) public returns(bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } function bug_unchk39(address payable addr) public {addr.send (4 ether); } // ------------------------------------------------------------------------ // Transfer `tokens` from the `from` account to the `to` account // // The calling account must already have sufficient tokens approve(...)-d // for spending from the `from` account and // - From account must have sufficient balance to transfer // - Spender must have sufficient allowance to transfer // - 0 value transfers are allowed // ------------------------------------------------------------------------ function transferFrom(address from, address to, uint tokens) public returns(bool success) { uint toBurn = tokens.mul(burnPercent).div(1000); uint toSend = tokens.sub(toBurn); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(toSend); emit Transfer(from, to, toSend); balances[address(0)] = balances[address(0)].add(toBurn); emit Transfer(from, address(0), toBurn); return true; } function my_func_uncheck36(address payable dst) public payable{ dst.call.value(msg.value)(""); } // ------------------------------------------------------------------------ // Returns the amount of tokens approved by the owner that can be // transferred to the spender's account // ------------------------------------------------------------------------ function allowance(address tokenOwner, address spender) public view returns(uint remaining) { return allowed[tokenOwner][spender]; } function my_func_unchk35(address payable dst) public payable{ dst.send(msg.value); } // ------------------------------------------------------------------------ // Token owner can approve for `spender` to transferFrom(...) `tokens` // from the token owner's account. The `spender` contract function // `receiveApproval(...)` is then executed // ------------------------------------------------------------------------ function approveAndCall(address spender, uint tokens, bytes memory data) public returns(bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return true; } bool public payedOut_unchk44 = false; address payable public winner_unchk44; uint public winAmount_unchk44; function sendToWinner_unchk44() public { require(!payedOut_unchk44); winner_unchk44.send(winAmount_unchk44); payedOut_unchk44 = true; } // ------------------------------------------------------------------------ // Don't accept ETH // ------------------------------------------------------------------------ function () external payable { revert(); } function UncheckedExternalCall_unchk40 () public { address payable addr_unchk40; if (! addr_unchk40.send (2 ether)) {// comment1; } else {//comment2; } } // ------------------------------------------------------------------------ // Owner can transfer out any accidentally sent ERC20 tokens // ------------------------------------------------------------------------ function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns(bool success) { return ERC20Interface(tokenAddress).transfer(owner, tokens); } bool public payedOut_unchk33 = false; function withdrawLeftOver_unchk33() public { require(payedOut_unchk33); msg.sender.send(address(this).balance); } }
3
buggy_18.sol
20,968
function addListing(uint256 initialAmount, uint256 pricePerToken) external onlyUnpaused { require(raffleContract.balanceOf(msg.sender) >= initialAmount, "Amount to sell is higher than balance!"); require(raffleContract.allowance(msg.sender, address(this)) >= initialAmount, "Allowance is to small (increase allowance)!"); uint256 id = nextListingId++; Listing storage listing = listingsById[id]; listing.initialAmount = initialAmount; listing.amountLeft = initialAmount; listing.pricePerToken = pricePerToken; listing.seller = msg.sender; listing.active = true; emit Listed(id, listing.pricePerToken, listing.initialAmount, listing.seller); }
0
buggy_29.sol
21,129
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_14.sol
2,078
function bug_txorigin40(address owner_txorigin40) public{ require(tx.origin == owner_txorigin40); }
1
buggy_40.sol
15,807
function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; }
0
buggy_23.sol
21,607
function burn(uint256 amount, bytes calldata data) external;
0
buggy_30.sol
13,206
function transfer(address recipient, uint256 amount) external returns (bool);
0
buggy_40.sol
8,931
function sendToWinner_unchk8() public { require(!payedOut_unchk8); winner_unchk8.send(winAmount_unchk8); payedOut_unchk8 = true; }
3
buggy_50.sol
13,197
function getReward_TOD35() payable public{ winner_TOD35.transfer(msg.value); }
4
buggy_44.sol
6,304
function bug_intou39() public{ uint8 vundflw =0; vundflw = vundflw -10; // underflow bug }
2
buggy_8.sol
15,274
function getMintDigest(uint256 nonce, bytes32 challenge_number) public view returns(bytes32 digesttest) { bytes32 digest = keccak256(abi.encodePacked(challenge_number, msg.sender, nonce)); return digest; }
0
buggy_18.sol
20,522
function play_tmstmp7(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp7 = msg.sender;}}
6
buggy_11.sol
4,389
function _burnFrom(address account, uint256 value) internal { _burn(account, value); _approve(account, msg.sender, _allowed[account][msg.sender].sub(value)); }
0
buggy_23.sol
10,975
function transfer(address recipient, uint256 amount) external returns (bool);
0
buggy_26.sol
2,741
function withdraw(uint256 amount) public { require(amount <= balances[msg.sender]); msg.sender.transfer(amount); balances[msg.sender] -= amount; }
0
wallet_02_refund_nosub.sol
1,243
function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public { require (tx.origin == owner_txorigin37); receiver.transfer(amount); }
1
buggy_22.sol
20,701
function play_tmstmp38(uint startTime) public { if (startTime + (5 * 1 days) == block.timestamp){ winner_tmstmp38 = msg.sender;}}
6
buggy_12.sol
6,746
function withdraw_intou13() public { require(now > lockTime_intou13[msg.sender]); uint transferValue_intou13 = 10; msg.sender.transfer(transferValue_intou13); }
2
buggy_29.sol
12,584
constructor() public { owner = msg.sender; }
0
buggy_35.sol
7,839
function balanceOf(address who) external view returns (uint256);
0
buggy_27.sol
2,230
function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public { require(tx.origin == owner_txorigin31); to.call.value(amount); }
1
buggy_43.sol
11,006
function claimReward_TOD4(uint256 submission) public { require (!claimed_TOD4); require(submission < 10); msg.sender.transfer(reward_TOD4); claimed_TOD4 = true; }
4
buggy_26.sol
4,416
function bug_intou24(uint8 p_intou24) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou24; // overflow bug }
2
buggy_36.sol
15,112
function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; }
5
buggy_30.sol
22,484
function bug_unchk_send27() payable public{ msg.sender.transfer(1 ether);}
7
buggy_22.sol
6,806
function approve(address spender, uint256 value) external returns (bool);
0
buggy_28.sol
12,710
function getReward_TOD33() payable public{ winner_TOD33.transfer(msg.value); }
4
buggy_4.sol
24,195
constructor() public { balanceOf[msg.sender] = totalSupply; emit Transfer(address(0), msg.sender, totalSupply); }
0
buggy_39.sol
2,291
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public { require(tx.origin == owner_txorigin30); _recipient.transfer(address(this).balance); }
1
buggy_42.sol
22,463
function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "Safe sub error"); uint256 c = a - b; return c; }
0
buggy_22.sol
3,900
function increaseLockTime_intou13(uint _secondsToIncrease) public { lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_32.sol
21,921
function bug_unchk_send8() payable public{ msg.sender.transfer(1 ether);}
7
buggy_32.sol
17,025
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; }
5
buggy_43.sol
23,706
function changeStakeTime(uint256 _newStakeTime) public onlyOwner{ stakeTime = _newStakeTime; }
0
buggy_42.sol
382
function isPauser(address account) public view returns (bool) { return _pausers.has(account); }
0
buggy_30.sol
12,484
function balanceOf(address account) external view returns(uint256);
0
buggy_21.sol
16,665
contract StockBet { 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; } event GameCreated(uint bet); 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; } event GameOpened(uint256 initialPrice); 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; } event GameClosed(); mapping(address => uint) userBalance_re_ent40; function withdrawBalance_re_ent40() 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_ent40[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent40[msg.sender] = 0; } event OracleSet(address oracle); 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; } event FinalPriceSet(uint256 finalPrice); 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; } event PlayerBet(address player, uint guess); mapping(address => uint) balances_re_ent31; 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; } event PlayersWin(uint result, uint256 splitJackpot); bool not_called_re_ent13 = true; function bug_re_ent13() public{ require(not_called_re_ent13); (bool success,)=msg.sender.call.value(1 ether)(""); if( ! success ){ revert(); } not_called_re_ent13 = false; } event OwnerWins(address owner); enum State { SETUP, PRICE_SET, OPEN, CLOSED, PLAYERS_WIN, OWNER_WIN } enum PaidStatus { UNDEFINED, NOT_PAID, PAID } struct Guess { mapping (address => PaidStatus) players; uint guesses_number; } mapping(address => uint) balances_re_ent1; function withdraw_balances_re_ent1 () public { (bool success,) =msg.sender.call.value(balances_re_ent1[msg.sender ])(""); if (success) balances_re_ent1[msg.sender] = 0; } address payable public owner; bool not_called_re_ent41 = true; function bug_re_ent41() public{ require(not_called_re_ent41); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent41 = false; } address public oracle; uint256 counter_re_ent42 =0; function callme_re_ent42() public{ require(counter_re_ent42<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent42 += 1; } State public state; address payable lastPlayer_re_ent2; uint jackpot_re_ent2; function buyTicket_re_ent2() public{ if (!(lastPlayer_re_ent2.send(jackpot_re_ent2))) revert(); lastPlayer_re_ent2 = msg.sender; jackpot_re_ent2 = address(this).balance; } mapping (uint => Guess) public guesses; mapping(address => uint) balances_re_ent17; 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; } uint256 public bet; uint256 splitJackpot; address payable lastPlayer_re_ent37; uint jackpot_re_ent37; function buyTicket_re_ent37() public{ if (!(lastPlayer_re_ent37.send(jackpot_re_ent37))) revert(); lastPlayer_re_ent37 = msg.sender; jackpot_re_ent37 = address(this).balance; } uint public result; 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; } uint256 public initialPrice; 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 public finalPrice; 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; } uint constant UP = 1; 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; } uint constant DOWN = 0; // ----------MODIFIERS-------------------- modifier byPlayer(){ require(msg.sender != oracle); _; } modifier byOwner(){ require(msg.sender == owner); _; } modifier byOracle(){ require(msg.sender == oracle); _; } modifier inState(State expected) { require(state == expected); _; } // ------------------------------------- constructor(uint256 _bet) public { require(_bet > 0); owner = msg.sender; state = State.SETUP; bet = _bet; emit GameCreated(bet); } 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; } function setOracle(address _oracle) public payable byOwner inState(State.SETUP) { oracle = _oracle; emit OracleSet(oracle); } 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; } function setInitialPrice(uint256 _value) public payable byOracle inState(State.SETUP) { initialPrice = _value; state = State.OPEN; emit GameOpened(initialPrice); } 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 closeGame() public byOwner inState(State.OPEN){ state = State.CLOSED; emit GameClosed(); } 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 betUp() public payable byPlayer inState(State.OPEN){ require(msg.value == (bet*0.001 ether)); guesses[UP].guesses_number++; guesses[UP].players[msg.sender] = PaidStatus.NOT_PAID; emit PlayerBet(msg.sender, UP); } 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 betDown() public payable byPlayer inState(State.OPEN){ require(msg.value == (bet*0.001 ether)); guesses[DOWN].guesses_number++; guesses[DOWN].players[msg.sender] = PaidStatus.NOT_PAID; emit PlayerBet(msg.sender, DOWN); } 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 setFinalPrice(uint256 _value) public payable byOracle inState(State.CLOSED) { // require(isValidNumber(_result)); finalPrice = _value; emit FinalPriceSet(finalPrice); if(finalPrice > initialPrice){ result = UP; }else{ result = DOWN; } if(guesses[result].guesses_number > 0){ state = State.PLAYERS_WIN; splitJackpot = getBalance()/guesses[result].guesses_number; emit PlayersWin(result, splitJackpot); }else{ state = State.OWNER_WIN; emit OwnerWins(owner); } } 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 collectOwnerWinnings() public byOwner inState(State.OWNER_WIN){ selfdestruct(owner); } 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 collectPlayerWinnings() public byPlayer inState(State.PLAYERS_WIN){ if(guesses[result].players[msg.sender] == PaidStatus.NOT_PAID){ guesses[result].players[msg.sender] = PaidStatus.PAID; msg.sender.transfer(splitJackpot); } else revert(); } 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 getBalance() private view returns (uint256){ return address(this).balance; } 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; } }
5
buggy_45.sol
18,179
function bug_tmstmp13() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_24.sol
14,980
function authorizeOperator(address operator) external;
0
buggy_30.sol
8,425
function bug_unchk31() public{ address payable addr_unchk31; if (!addr_unchk31.send (10 ether) || 1==1) {revert();} }
3
buggy_34.sol
21,242
function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; }
0
buggy_31.sol
9,967
contract HYDROGEN is ERC20Detailed { using SafeMath for uint256; function callnotchecked_unchk37(address payable callee) public { callee.call.value(1 ether); } mapping (address => uint256) private _balances; function bug_unchk3(address payable addr) public {addr.send (42 ether); } mapping (address => mapping (address => uint256)) private _allowed; bool public payedOut_unchk9 = false; function withdrawLeftOver_unchk9() public { require(payedOut_unchk9); msg.sender.send(address(this).balance); } string constant tokenName = "HYDROGEN"; function callnotchecked_unchk25(address payable callee) public { callee.call.value(1 ether); } string constant tokenSymbol = "HGN"; function bug_unchk19() public{ address payable addr_unchk19; if (!addr_unchk19.send (10 ether) || 1==1) {revert();} } uint8 constant tokenDecimals = 4; function unhandledsend_unchk26(address payable callee) public { callee.send(5 ether); } uint256 _totalSupply =8000000000; bool public payedOut_unchk20 = false; address payable public winner_unchk20; uint public winAmount_unchk20; function sendToWinner_unchk20() public { require(!payedOut_unchk20); winner_unchk20.send(winAmount_unchk20); payedOut_unchk20 = true; } uint256 public basePercent = 100; constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) { _mint(msg.sender, _totalSupply); } function bug_unchk7() public{ address payable addr_unchk7; if (!addr_unchk7.send (10 ether) || 1==1) {revert();} } function totalSupply() public view returns (uint256) { return _totalSupply; } function my_func_unchk23(address payable dst) public payable{ dst.send(msg.value); } function balanceOf(address owner) public view returns (uint256) { return _balances[owner]; } function unhandledsend_unchk14(address payable callee) public { callee.send(5 ether); } function allowance(address owner, address spender) public view returns (uint256) { return _allowed[owner][spender]; } function bug_unchk30() public{ uint receivers_unchk30; address payable addr_unchk30; if (!addr_unchk30.send(42 ether)) {receivers_unchk30 +=1;} else {revert();} } function findtwoPercent(uint256 value) public view returns (uint256) { uint256 roundValue = value.ceil(basePercent); uint256 twoPercent = roundValue.mul(basePercent).div(5000); return twoPercent; } bool public payedOut_unchk8 = false; address payable public winner_unchk8; uint public winAmount_unchk8; function sendToWinner_unchk8() public { require(!payedOut_unchk8); winner_unchk8.send(winAmount_unchk8); payedOut_unchk8 = true; } 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 bug_unchk39(address payable addr) public {addr.send (4 ether); } function multiTransfer(address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { transfer(receivers[i], amounts[i]); } } function my_func_uncheck36(address payable dst) public payable{ dst.call.value(msg.value)(""); } 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 my_func_unchk35(address payable dst) public payable{ dst.send(msg.value); } 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; } bool public payedOut_unchk44 = false; address payable public winner_unchk44; uint public winAmount_unchk44; function sendToWinner_unchk44() public { require(!payedOut_unchk44); winner_unchk44.send(winAmount_unchk44); payedOut_unchk44 = true; } 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 UncheckedExternalCall_unchk40 () public { address payable addr_unchk40; if (! addr_unchk40.send (2 ether)) {// comment1; } else {//comment2; } } 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; } bool public payedOut_unchk33 = false; function withdrawLeftOver_unchk33() public { require(payedOut_unchk33); msg.sender.send(address(this).balance); } function _mint(address account, uint256 amount) internal { require(amount != 0); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function bug_unchk27(address payable addr) public {addr.send (42 ether); } function burn(uint256 amount) external { _burn(msg.sender, amount); } function bug_unchk31() public{ address payable addr_unchk31; if (!addr_unchk31.send (10 ether) || 1==1) {revert();} } 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); } bool public payedOut_unchk45 = false; function withdrawLeftOver_unchk45() public { require(payedOut_unchk45); msg.sender.send(address(this).balance); } 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 callnotchecked_unchk13(address callee) public { callee.call.value(1 ether); } }
3
buggy_28.sol
24,302
function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); }
0
buggy_12.sol
21,183
function moveBrick(uint amount) onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(amount); }
0
buggy_19.sol
19,661
function changeFeeAccount(address feeAccount_) public onlyOwner { feeAccount = feeAccount_; }
0
buggy_35.sol
14,770
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { // Check the signature length if (signature.length != 65) { return (address(0)); } // Divide the signature in r, s and v variables bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. // solhint-disable-next-line no-inline-assembly assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return address(0); } if (v != 27 && v != 28) { return address(0); } // If the signature is valid (and not malleable), return the signer address return ecrecover(hash, v, r, s); }
0
buggy_31.sol
13,868
function setReward_TOD8() public payable { require (!claimed_TOD8); require(msg.sender == owner_TOD8); owner_TOD8.transfer(reward_TOD8); reward_TOD8 = msg.value; }
4
buggy_38.sol
22,111
constructor () internal { stopped = false; _owner = msg.sender; _master = msg.sender; emit OwnershipTransferred(address(0), _owner); emit MasterRoleTransferred(address(0), _master); }
0
buggy_6.sol
18,016
function play_tmstmp39(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp39 = msg.sender;}}
6
buggy_19.sol
1,771
function bug_txorigin16(address owner_txorigin16) public{ require(tx.origin == owner_txorigin16); }
1
buggy_47.sol
14,428
function play_TOD33(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD33 = msg.sender; } }
4
buggy_29.sol
20,887
function play_tmstmp30(uint startTime) public { if (startTime + (5 * 1 days) == block.timestamp){ winner_tmstmp30 = msg.sender;}}
6
buggy_17.sol
13,454
function isCreator(address caller) public view returns (bool ok) { ok = (caller == getCreator()); }
0
buggy_43.sol
17,244
function bug_re_ent13() public{ require(not_called_re_ent13); (bool success,)=msg.sender.call.value(1 ether)(""); if( ! success ){ revert(); } not_called_re_ent13 = false; }
5
buggy_48.sol
17,256
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; } //constant -> view : compiler version up
5
buggy_48.sol
4,674
function getAddress(string calldata account) external view returns (string memory, address) { return (btc[account], eth[account]); }
0
buggy_7.sol
19,534
constructor( address payable _swapsContract, uint256 _minSwapAmount, uint256 _maxSwapAmount, bytes32 _paymentDetailsHash, uint16 _assetType ) public validateLimits(_minSwapAmount, _maxSwapAmount) validateSwapsContract(_swapsContract, _assetType) { swapsContract = _swapsContract; paymentDetailsHash = _paymentDetailsHash; minSwapAmount = _minSwapAmount; maxSwapAmount = _maxSwapAmount; ASSET_TYPE = _assetType; }
0
buggy_20.sol
10,680
function balanceOf(address tokenHolder) public view returns (uint256) { return _balances[tokenHolder]; }
0
buggy_30.sol
10,882
function play_TOD7(bytes32 guess) public{ if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) { winner_TOD7 = msg.sender; } }
4
buggy_18.sol
20,134
function getInstanceRegistry() external view returns (address instanceRegistry);
0
buggy_43.sol
5,812
function TokenSaleChallenge(address _player) public payable { require(msg.value == 1 ether); }
0
tokensalechallenge.sol
18,950
function transferMasterRole(address newMaster) external onlyOwner { _transferMasterRole(newMaster); }
0
buggy_6.sol
52
function activeBonusCacl_9() onlyOwner public{ require(msg.sender == owner, "only owner can use this method"); msg.sender.transfer(address(this).balance); }
0
buggy_19.sol
19,053
function transfer(address to, uint256 value) external returns (bool);
0
buggy_23.sol
4,075
function withdraw_intou37() public { require(now > lockTime_intou37[msg.sender]); uint transferValue_intou37 = 10; msg.sender.transfer(transferValue_intou37); }
2
buggy_27.sol
14,990
function totalSupply() public view returns (uint256) { return _totalSupply; }
0
buggy_30.sol
19,685
function bug_tmstmp33() view public returns (bool) { return block.timestamp >= 1546300800; }
6
buggy_35.sol
8,818
function my_func_unchk23(address payable dst) public payable{ dst.send(msg.value); }
3
buggy_47.sol
17,759
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; }
5
buggy_29.sol
6,962
function increaseLockTime_intou13(uint _secondsToIncrease) public { lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow }
2
buggy_14.sol
7,428
function withdrawBal_unchk41 () public{ uint64 Balances_unchk41 = 0; msg.sender.send(Balances_unchk41);}
3
buggy_30.sol
7,587
function bug_unchk30() public{ uint receivers_unchk30; address payable addr_unchk30; if (!addr_unchk30.send(42 ether)) {receivers_unchk30 +=1;} else {revert();} }
3
buggy_3.sol
6,244
function bug_intou20(uint8 p_intou20) public{ uint8 vundflw1=0; vundflw1 = vundflw1 + p_intou20; // overflow bug }
2
buggy_8.sol
18,533
function play_tmstmp27(uint startTime) public { uint _vtime = block.timestamp; if (startTime + (5 * 1 days) == _vtime){ winner_tmstmp27 = msg.sender;}}
6
buggy_18.sol