Unnamed: 0
int64
0
3.2k
func
stringlengths
19
4.9k
target
bool
2 classes
project
stringlengths
11
46
1,700
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); }
false
buggy_45.sol
1,701
function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; }
true
buggy_45.sol
1,702
function setFinalPrice(uint256 _value) public payable byOracle inState(State.CLOSED) { 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); } }
false
buggy_45.sol
1,703
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; }
true
buggy_45.sol
1,704
function collectOwnerWinnings() public byOwner inState(State.OWNER_WIN){ selfdestruct(owner); }
false
buggy_45.sol
1,705
function callme_re_ent14() public{ require(counter_re_ent14<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent14 += 1; }
true
buggy_45.sol
1,706
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(); }
false
buggy_45.sol
1,707
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; }
true
buggy_45.sol
1,708
function getBalance() private view returns (uint256){ return address(this).balance; }
false
buggy_45.sol
1,709
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; }
true
buggy_45.sol
1,710
function transfer(address to, uint amount) { if (userBalances[msg.sender] >= amount) { userBalances[to] += amount; userBalances[msg.sender] -= amount; } }
false
reentrancy_cross_function.sol
1,711
function withdrawBalance() public { uint amountToWithdraw = userBalances[msg.sender]; (bool success, ) = msg.sender.call.value(amountToWithdraw)(""); require(success); userBalances[msg.sender] = 0; }
true
reentrancy_cross_function.sol
1,712
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; }
true
buggy_50.sol
1,713
function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public { require(balances_re_ent17[msg.sender] >= _weiToWithdraw); (bool success,)=msg.sender.call.value(_weiToWithdraw)(""); require(success); balances_re_ent17[msg.sender] -= _weiToWithdraw; }
true
buggy_50.sol
1,714
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; }
true
buggy_50.sol
1,715
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public { require(balances_re_ent3[msg.sender] >= _weiToWithdraw); (bool success,)= msg.sender.call.value(_weiToWithdraw)(""); require(success); balances_re_ent3[msg.sender] -= _weiToWithdraw; }
true
buggy_50.sol
1,716
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; }
true
buggy_50.sol
1,717
function claimReward_re_ent25() public { require(redeemableEther_re_ent25[msg.sender] > 0); uint transferValue_re_ent25 = redeemableEther_re_ent25[msg.sender]; msg.sender.transfer(transferValue_re_ent25); redeemableEther_re_ent25[msg.sender] = 0; }
true
buggy_50.sol
1,718
function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public { require(balances_re_ent31[msg.sender] >= _weiToWithdraw); require(msg.sender.send(_weiToWithdraw)); balances_re_ent31[msg.sender] -= _weiToWithdraw; }
true
buggy_50.sol
1,719
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; }
true
buggy_50.sol
1,720
function withdrawBalance_re_ent19() public{ if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){ revert(); } userBalance_re_ent19[msg.sender] = 0; }
true
buggy_50.sol
1,721
function gethashfee() external view returns(uint) { return hashfee; }
false
buggy_50.sol
1,722
function withdrawBalance_re_ent26() public{ (bool success,)= msg.sender.call.value(userBalance_re_ent26[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent26[msg.sender] = 0; }
true
buggy_50.sol
1,723
function sethashfee(uint newfee) external onlyManager { require(newfee >= 0); hashfee = newfee; }
false
buggy_50.sol
1,724
function bug_re_ent20() public{ require(not_called_re_ent20); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent20 = false; }
true
buggy_50.sol
1,725
function getchangehashownerfee() external view returns(uint) { return changehashownerfee; }
false
buggy_50.sol
1,726
function claimReward_re_ent32() public { require(redeemableEther_re_ent32[msg.sender] > 0); uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender]; msg.sender.transfer(transferValue_re_ent32); redeemableEther_re_ent32[msg.sender] = 0; }
true
buggy_50.sol
1,727
function setchangehashownerfee(uint newfee) external onlyManager { require(newfee >= 0); changehashownerfee = newfee; }
false
buggy_50.sol
1,728
function withdrawFunds_re_ent38 (uint256 _weiToWithdraw) public { require(balances_re_ent38[msg.sender] >= _weiToWithdraw); require(msg.sender.send(_weiToWithdraw)); balances_re_ent38[msg.sender] -= _weiToWithdraw; }
true
buggy_50.sol
1,729
function getcontractactive() external view returns (bool) { return contractactive; }
false
buggy_50.sol
1,730
function claimReward_re_ent4() public { require(redeemableEther_re_ent4[msg.sender] > 0); uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender]; msg.sender.transfer(transferValue_re_ent4); redeemableEther_re_ent4[msg.sender] = 0; }
true
buggy_50.sol
1,731
function setcontractactive(bool contactive) external onlyManager { contractactive = contactive; }
false
buggy_50.sol
1,732
function callme_re_ent7() public{ require(counter_re_ent7<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent7 += 1; }
true
buggy_50.sol
1,733
function getmanager() external view returns(address) { return manager; }
false
buggy_50.sol
1,734
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; }
true
buggy_50.sol
1,735
function setmanager(address payable newmngr) external onlyManager { require(newmngr.balance > 0); manager = newmngr; }
false
buggy_50.sol
1,736
function callme_re_ent14() public{ require(counter_re_ent14<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent14 += 1; }
true
buggy_50.sol
1,737
function getcontractbalance() public view returns(uint) { return address(this).balance; }
false
buggy_50.sol
1,738
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; }
true
buggy_50.sol
1,739
function transfercontractbalance() external onlyManager { uint cb = address(this).balance; require(cb > 0); manager.transfer(cb); }
false
buggy_50.sol
1,740
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; }
true
buggy_50.sol
1,741
function getHashOwnersCount(bytes32 hash) public view returns(uint) { return HashList[hash].length; }
false
buggy_50.sol
1,742
function claimReward_re_ent39() public { require(redeemableEther_re_ent39[msg.sender] > 0); uint transferValue_re_ent39 = redeemableEther_re_ent39[msg.sender]; msg.sender.transfer(transferValue_re_ent39); redeemableEther_re_ent39[msg.sender] = 0; }
true
buggy_50.sol
1,743
function getNumberofHashesRegistered() external view returns(uint) { return HashListLength; }
false
buggy_50.sol
1,744
function withdraw_balances_re_ent36 () public { if (msg.sender.send(balances_re_ent36[msg.sender ])) balances_re_ent36[msg.sender] = 0; }
true
buggy_50.sol
1,745
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); }
false
buggy_50.sol
1,746
function callme_re_ent35() public{ require(counter_re_ent35<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent35 += 1; }
true
buggy_50.sol
1,747
function registerHash(bytes32 hash) external payable { require(contractactive == true); require(getHashOwnersCount(hash) == 0); require(msg.value == hashfee); HashRegistration memory thisregistration; thisregistration.owner = msg.sender; thisregistration.registrationtime = now; HashList[hash].push(thisregistration); HashListLength++; emit RegisterHashEvent(thisregistration.owner, hash, thisregistration.registrationtime); }
false
buggy_50.sol
1,748
function withdrawBalance_re_ent40() public{ (bool success,)=msg.sender.call.value(userBalance_re_ent40[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent40[msg.sender] = 0; }
true
buggy_50.sol
1,749
function changeHashOwnership(bytes32 hash, address newowner) external payable { require(contractactive == true); uint owncount = getHashOwnersCount(hash); require(owncount > 0); require(msg.sender == HashList[hash][owncount - 1].owner); require(msg.value == changehashownerfee); HashRegistration memory thisregistration; thisregistration.owner = newowner; thisregistration.registrationtime = now; HashList[hash].push(thisregistration); emit ChangeHashOwnershipEvent(msg.sender, thisregistration.owner, hash, thisregistration.registrationtime); }
false
buggy_50.sol
1,750
function withdrawBalance_re_ent33() public{ (bool success,)= msg.sender.call.value(userBalance_re_ent33[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent33[msg.sender] = 0; }
true
buggy_50.sol
1,751
function bug_re_ent27() public{ require(not_called_re_ent27); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent27 = false; }
true
buggy_50.sol
1,752
function withdrawBalance_re_ent40() public{ (bool success,)=msg.sender.call.value(userBalance_re_ent40[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent40[msg.sender] = 0; }
true
buggy_44.sol
1,753
function _setMetadata(bytes memory metadata) internal { emit MetadataSet(metadata); }
false
buggy_44.sol
1,754
function bug_re_ent41() public{ require(not_called_re_ent41); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent41 = false; }
true
buggy_44.sol
1,755
function withdrawBalance_re_ent12() public{ if( ! (msg.sender.send(userBalance_re_ent12[msg.sender]) ) ){ revert(); } userBalance_re_ent12[msg.sender] = 0; }
true
buggy_44.sol
1,756
function claimReward_re_ent11() public { require(redeemableEther_re_ent11[msg.sender] > 0); uint transferValue_re_ent11 = redeemableEther_re_ent11[msg.sender]; msg.sender.transfer(transferValue_re_ent11); redeemableEther_re_ent11[msg.sender] = 0; }
true
buggy_44.sol
1,757
function withdrawBalance_re_ent33() public{ (bool success,)= msg.sender.call.value(userBalance_re_ent33[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent33[msg.sender] = 0; }
true
buggy_44.sol
1,758
function _setOperator(address operator) internal { require(_operator != operator, "cannot set same operator"); _operator = operator; emit OperatorUpdated(operator, hasActiveOperator()); }
false
buggy_44.sol
1,759
function callme_re_ent42() public{ require(counter_re_ent42<=5); if( ! (msg.sender.send(10 ether) ) ){ revert(); } counter_re_ent42 += 1; }
true
buggy_44.sol
1,760
function _transferOperator(address operator) internal { require(_operator != address(0), "operator not set"); _setOperator(operator); }
false
buggy_44.sol
1,761
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; }
true
buggy_44.sol
1,762
function _renounceOperator() internal { require(hasActiveOperator(), "only when operator active"); _operator = address(0); _status = false; emit OperatorUpdated(address(0), false); }
false
buggy_44.sol
1,763
function withdrawFunds_re_ent17 (uint256 _weiToWithdraw) public { require(balances_re_ent17[msg.sender] >= _weiToWithdraw); (bool success,)=msg.sender.call.value(_weiToWithdraw)(""); require(success); balances_re_ent17[msg.sender] -= _weiToWithdraw; }
true
buggy_44.sol
1,764
function _activateOperator() internal { require(!hasActiveOperator(), "only when operator not active"); _status = true; emit OperatorUpdated(_operator, true); }
false
buggy_44.sol
1,765
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; }
true
buggy_44.sol
1,766
function _deactivateOperator() internal { require(hasActiveOperator(), "only when operator active"); _status = false; emit OperatorUpdated(_operator, false); }
false
buggy_44.sol
1,767
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public { require(balances_re_ent3[msg.sender] >= _weiToWithdraw); (bool success,)= msg.sender.call.value(_weiToWithdraw)(""); require(success); balances_re_ent3[msg.sender] -= _weiToWithdraw; }
true
buggy_44.sol
1,768
function getOperator() public view returns (address operator) { operator = _operator; }
false
buggy_44.sol
1,769
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; }
true
buggy_44.sol
1,770
function isOperator(address caller) public view returns (bool ok) { return (caller == getOperator()); }
false
buggy_44.sol
1,771
function claimReward_re_ent25() public { require(redeemableEther_re_ent25[msg.sender] > 0); uint transferValue_re_ent25 = redeemableEther_re_ent25[msg.sender]; msg.sender.transfer(transferValue_re_ent25); redeemableEther_re_ent25[msg.sender] = 0; }
true
buggy_44.sol
1,772
function hasActiveOperator() public view returns (bool ok) { return _status; }
false
buggy_44.sol
1,773
function withdrawBalance_re_ent19() public{ if( ! (msg.sender.send(userBalance_re_ent19[msg.sender]) ) ){ revert(); } userBalance_re_ent19[msg.sender] = 0; }
true
buggy_44.sol
1,774
function isActiveOperator(address caller) public view returns (bool ok) { return (isOperator(caller) && hasActiveOperator()); }
false
buggy_44.sol
1,775
function withdrawBalance_re_ent26() public{ (bool success,)= msg.sender.call.value(userBalance_re_ent26[msg.sender])(""); if( ! success ){ revert(); } userBalance_re_ent26[msg.sender] = 0; }
true
buggy_44.sol
1,776
function bug_re_ent27() public{ require(not_called_re_ent27); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent27 = false; }
true
buggy_44.sol
1,777
function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public { require(balances_re_ent31[msg.sender] >= _weiToWithdraw); require(msg.sender.send(_weiToWithdraw)); balances_re_ent31[msg.sender] -= _weiToWithdraw; }
true
buggy_44.sol
1,778
function _setMultiHashFormat(uint8 hashFunction, uint8 digestSize) internal { emit HashFormatSet(hashFunction, digestSize); }
false
buggy_44.sol
1,779
function bug_re_ent20() public{ require(not_called_re_ent20); if( ! (msg.sender.send(1 ether) ) ){ revert(); } not_called_re_ent20 = false; }
true
buggy_44.sol
1,780
function _submitHash(bytes32 hash) internal { emit HashSubmitted(hash); }
false
buggy_44.sol
1,781
function claimReward_re_ent32() public { require(redeemableEther_re_ent32[msg.sender] > 0); uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender]; msg.sender.transfer(transferValue_re_ent32); redeemableEther_re_ent32[msg.sender] = 0; }
true
buggy_44.sol
1,782
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; }
false
buggy_44.sol
1,783
function withdrawFunds_re_ent38 (uint256 _weiToWithdraw) public { require(balances_re_ent38[msg.sender] >= _weiToWithdraw); require(msg.sender.send(_weiToWithdraw)); balances_re_ent38[msg.sender] -= _weiToWithdraw; }
true
buggy_44.sol
1,784
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 })); }
false
buggy_44.sol
1,785
function claimReward_re_ent4() public { require(redeemableEther_re_ent4[msg.sender] > 0); uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender]; msg.sender.transfer(transferValue_re_ent4); redeemableEther_re_ent4[msg.sender] = 0; }
true
buggy_44.sol
1,786
function create(bytes calldata initData) external returns (address instance);
false
buggy_44.sol
1,787
function createSalty(bytes calldata initData, bytes32 salt) external returns (address instance);
false
buggy_44.sol
1,788
function getInitSelector() external view returns (bytes4 initSelector);
false
buggy_44.sol
1,789
function getInstanceRegistry() external view returns (address instanceRegistry);
false
buggy_44.sol
1,790
function getTemplate() external view returns (address template);
false
buggy_44.sol
1,791
function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance);
false
buggy_44.sol
1,792
function getNextInstance(bytes calldata) external view returns (address instance);
false
buggy_44.sol
1,793
function getInstanceCreator(address instance) external view returns (address creator);
false
buggy_44.sol
1,794
function getInstanceType() external view returns (bytes4 instanceType);
false
buggy_44.sol
1,795
function getInstanceCount() external view returns (uint256 count);
false
buggy_44.sol
1,796
function getInstance(uint256 index) external view returns (address instance);
false
buggy_44.sol
1,797
function getInstances() external view returns (address[] memory instances);
false
buggy_44.sol
1,798
function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances);
false
buggy_44.sol
1,799
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; }
true
buggy_44.sol