Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
9,127 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_40.sol |
18,118 | function play_tmstmp6(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp6 = msg.sender;}} | 6 | buggy_24.sol |
4,019 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_27.sol |
4,049 | function transfer_intou18(address _to, uint _value) public returns (bool) {
require(balances_intou18[msg.sender] - _value >= 0); //bug
balances_intou18[msg.sender] -= _value; //bug
balances_intou18[_to] += _value; //bug
return true;
} | 2 | buggy_27.sol |
10,757 | contract SKYBITToken is ERC777, MinterRole, Pausable {
constructor(
uint256 initialSupply,
address[] memory defaultOperators
)
ERC777("SKYBIT", "SKYBIT", defaultOperators)
public {
_mint(msg.sender, msg.sender, initialSupply, "", "");
}
address payable winner_TOD39;
function play_TOD39(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD39 = msg.sender;
}
}
function getReward_TOD39() payable public{
winner_TOD39.transfer(msg.value);
}
function mint(address operator, address account, uint256 amount, bytes memory userData, bytes memory operatorData) public onlyMinter returns (bool) {
_mint(operator, account, amount, userData, operatorData);
return true;
}
bool claimed_TOD36 = false;
address payable owner_TOD36;
uint256 reward_TOD36;
function setReward_TOD36() public payable {
require (!claimed_TOD36);
require(msg.sender == owner_TOD36);
owner_TOD36.transfer(reward_TOD36);
reward_TOD36 = msg.value;
}
function claimReward_TOD36(uint256 submission) public {
require (!claimed_TOD36);
require(submission < 10);
msg.sender.transfer(reward_TOD36);
claimed_TOD36 = true;
}
} | 4 | buggy_30.sol |
4,047 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_27.sol |
15,444 | 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_32.sol |
12,958 | function setReward_TOD30() public payable {
require (!claimed_TOD30);
require(msg.sender == owner_TOD30);
owner_TOD30.transfer(reward_TOD30);
reward_TOD30 = msg.value;
} | 4 | buggy_45.sol |
209 | 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 |
17,572 | 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_16.sol |
11,400 | function play_TOD19(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD19 = msg.sender;
}
} | 4 | buggy_2.sol |
6,450 | function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_16.sol |
3,536 | function balanceOf(address tokenHolder) public view returns (uint256) {
return _balances[tokenHolder];
} | 0 | buggy_30.sol |
23,077 | function clearStorage(uint[] toCleanTicketIDs) external {
uint length = toCleanTicketIDs.length;
for (uint i = 0; i < length; i++) {
clearProcessedBet(toCleanTicketIDs[i]);
}
} | 0 | 0xe09b1ab8111c2729a76f16de96bc86a7af837928.sol |
1,807 | function transferTo_txorigin11(address to, uint amount,address owner_txorigin11) public {
require(tx.origin == owner_txorigin11);
to.call.value(amount);
} | 1 | buggy_47.sol |
7,551 | function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_18.sol |
11,082 | function claimReward_TOD8(uint256 submission) public {
require (!claimed_TOD8);
require(submission < 10);
msg.sender.transfer(reward_TOD8);
claimed_TOD8 = true;
} | 4 | buggy_32.sol |
5,462 | function _transferOperator(address operator) internal {
// transferring operator-ship implies there was an operator set before this
require(_operator != address(0), "operator not set");
_setOperator(operator);
} | 0 | buggy_44.sol |
12,798 | function claimReward_TOD6(uint256 submission) public {
require (!claimed_TOD6);
require(submission < 10);
msg.sender.transfer(reward_TOD6);
claimed_TOD6 = true;
} | 4 | buggy_47.sol |
15,886 | 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;
} | 5 | buggy_23.sol |
4,132 | function transfer_intou30(address _to, uint _value) public returns (bool) {
require(balances_intou30[msg.sender] - _value >= 0); //bug
balances_intou30[msg.sender] -= _value; //bug
balances_intou30[_to] += _value; //bug
return true;
} | 2 | buggy_2.sol |
24,009 | function Command(address adr,bytes data)
payable
public
{
require(msg.sender == Owner);
// <yes> <report> UNCHECKED_LL_CALLS
adr.call.value(msg.value)(data);
} | 7 | 0xf70d589d76eebdd7c12cc5eec99f8f6fa4233b9e.sol |
11,302 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_27.sol |
8,910 | function unhandledsend_unchk26(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_50.sol |
12,417 | function setReward_TOD26() public payable {
require (!claimed_TOD26);
require(msg.sender == owner_TOD26);
owner_TOD26.transfer(reward_TOD26);
reward_TOD26 = msg.value;
} | 4 | buggy_20.sol |
4,509 | function () payable external {
emit receivedEther(msg.sender, msg.value);
} | 0 | buggy_22.sol |
19,013 | function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}} | 6 | buggy_23.sol |
6,359 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_12.sol |
19,038 | function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}} | 6 | buggy_23.sol |
19,080 | function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_23.sol |
3,649 | function transfer(address to, uint tokens) public returns(bool success); | 0 | buggy_18.sol |
15,033 | function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
} | 0 | buggy_30.sol |
11,288 | function name() public view returns(string memory) {
return _name;
} | 0 | buggy_27.sol |
12,851 | function getReward_TOD21() payable public{
winner_TOD21.transfer(msg.value);
} | 4 | buggy_47.sol |
11,269 | function claimReward_TOD22(uint256 submission) public {
require (!claimed_TOD22);
require(submission < 10);
msg.sender.transfer(reward_TOD22);
claimed_TOD22 = true;
} | 4 | buggy_27.sol |
11,804 | 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);
return c;
} | 0 | ERC20.sol |
10,326 | function claimReward_TOD22(uint256 submission) public {
require (!claimed_TOD22);
require(submission < 10);
msg.sender.transfer(reward_TOD22);
claimed_TOD22 = true;
} | 4 | buggy_24.sol |
13,242 | function getReward_TOD23() payable public{
winner_TOD23.transfer(msg.value);
} | 4 | buggy_40.sol |
22,151 | function bug_unchk_send21() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_6.sol |
19,757 | function totalSupply() public view returns (uint){
return supply;
} | 0 | buggy_47.sol |
17,590 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_16.sol |
1,108 | function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
} | 1 | buggy_23.sol |
24,650 | function bug_unchk_send2() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_28.sol |
1,437 | function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
} | 0 | buggy_34.sol |
10,938 | function setReward_TOD14() public payable {
require (!claimed_TOD14);
require(msg.sender == owner_TOD14);
owner_TOD14.transfer(reward_TOD14);
reward_TOD14 = msg.value;
} | 4 | buggy_3.sol |
8,291 | function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);} | 3 | buggy_22.sol |
14,869 | function callme_re_ent21() public{
require(counter_re_ent21<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent21 += 1;
} | 5 | buggy_24.sol |
2,808 | function transferTo_txorigin19(address to, uint amount,address owner_txorigin19) public {
require(tx.origin == owner_txorigin19);
to.call.value(amount);
} | 1 | buggy_17.sol |
21,475 | function isMinter(address account) public view returns (bool) {
return _minters.has(account);
} | 0 | buggy_30.sol |
15,767 | function totalSupply() external view returns (uint256); | 0 | buggy_23.sol |
8,735 | function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_4.sol |
17,423 | constructor() public {
owner = msg.sender;
} | 0 | buggy_11.sol |
14,592 | function getReward_TOD23() payable public{
winner_TOD23.transfer(msg.value);
} | 4 | buggy_14.sol |
20,651 | function bug_tmstmp33() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_8.sol |
18,822 | function bug_tmstmp5() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_27.sol |
10,668 | function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
} | 0 | buggy_30.sol |
10,536 | function isMinter(address account) public view returns (bool) {
return _minters.has(account);
} | 0 | buggy_30.sol |
13,880 | function setReward_TOD40() public payable {
require (!claimed_TOD40);
require(msg.sender == owner_TOD40);
owner_TOD40.transfer(reward_TOD40);
reward_TOD40 = msg.value;
} | 4 | buggy_38.sol |
5,735 | 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 |
19,054 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_23.sol |
20,951 | function transferFrom(address from, address to, uint tokens) public returns (bool success); | 0 | buggy_29.sol |
21,216 | function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_19.sol |
21,076 | 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_14.sol |
15,495 | contract Token{
function balanceOf(address who) external view returns (uint256);
mapping(address => uint) redeemableEther_re_ent4;
function claimReward_re_ent4() public {
// ensure there is a reward to give
require(redeemableEther_re_ent4[msg.sender] > 0);
uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender];
msg.sender.transfer(transferValue_re_ent4); //bug
redeemableEther_re_ent4[msg.sender] = 0;
}
function transferFrom(address from, address to, uint256 value) external returns (bool);
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 transfer(address to, uint256 value) external returns (bool);
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;
}
} | 5 | buggy_33.sol |
5,478 | function hasActiveOperator() public view returns (bool ok) {
return _status;
} | 0 | buggy_44.sol |
8,697 | function deposit() public payable {
tokens[address(0)][msg.sender] = tokens[address(0)][msg.sender].add(msg.value);
emit Deposit(now, address(0), msg.sender, msg.value, tokens[address(0)][msg.sender]);
} | 0 | buggy_35.sol |
3,766 | function bug_intou27() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_3.sol |
6,165 | function increaseLockTime_intou25(uint _secondsToIncrease) public {
lockTime_intou25[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_11.sol |
24,474 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
} | 0 | buggy_17.sol |
3,149 | function bug_intou27() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_19.sol |
9,523 | 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 = findfourPercent(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;
} | 0 | buggy_38.sol |
3,618 | function bug_intou12(uint8 p_intou12) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou12; // overflow bug
} | 2 | buggy_18.sol |
16,098 | function stop() public onlyOwner
{
_stop();
} | 0 | buggy_7.sol |
18,790 | function bug_tmstmp29() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_27.sol |
1,819 | 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 |
11,510 | function claimReward_TOD40(uint256 submission) public {
require (!claimed_TOD40);
require(submission < 10);
msg.sender.transfer(reward_TOD40);
claimed_TOD40 = true;
} | 4 | buggy_6.sol |
7,214 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
} | 0 | buggy_30.sol |
8,779 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_47.sol |
13,386 | function getReward_TOD25() payable public{
winner_TOD25.transfer(msg.value);
} | 4 | buggy_43.sol |
15,752 | contract ChannelWallet is Ownable
{
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;
}
mapping(string => address) private addressMap;
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 SetAddress(string channelId, address _address);
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 UpdateAddress(string from, string to);
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 DeleteAddress(string account);
function version() external pure returns(string memory)
{
return '0.0.1';
}
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 getAddress(string calldata channelId) external view returns (address)
{
return addressMap[channelId];
}
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 setAddress(string calldata channelId, address _address) external onlyMaster onlyWhenNotStopped
{
require(bytes(channelId).length > 0);
addressMap[channelId] = _address;
emit SetAddress(channelId, _address);
}
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 updateChannel(string calldata from, string calldata to, address _address) external onlyMaster onlyWhenNotStopped
{
require(bytes(from).length > 0);
require(bytes(to).length > 0);
require(addressMap[to] == address(0));
addressMap[to] = _address;
addressMap[from] = address(0);
emit UpdateAddress(from, to);
}
mapping(address => uint) balances_re_ent8;
function withdraw_balances_re_ent8 () public {
(bool success,) = msg.sender.call.value(balances_re_ent8[msg.sender ])("");
if (success)
balances_re_ent8[msg.sender] = 0;
}
function deleteChannel(string calldata channelId) external onlyMaster onlyWhenNotStopped
{
require(bytes(channelId).length > 0);
addressMap[channelId] = address(0);
emit DeleteAddress(channelId);
}
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;
}
} | 5 | buggy_6.sol |
1,284 | function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public {
require(tx.origin == owner_txorigin31);
to.call.value(amount);
} | 1 | buggy_22.sol |
2,532 | function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public {
require (tx.origin == owner_txorigin37);
receiver.transfer(amount);
} | 1 | buggy_11.sol |
1,249 | function sendto_txorigin25(address payable receiver, uint amount,address owner_txorigin25) public {
require (tx.origin == owner_txorigin25);
receiver.transfer(amount);
} | 1 | buggy_22.sol |
19,014 | function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
} | 0 | buggy_23.sol |
10,101 | function getReward_TOD17() payable public{
winner_TOD17.transfer(msg.value);
} | 4 | buggy_19.sol |
24,212 | function bug_unchk_send6() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_8.sol |
2,441 | function Unprotected()
public
{
owner = msg.sender;
} | 0 | unprotected0.sol |
4,311 | function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowed[msg.sender][spender].add(addedValue));
return true;
} | 0 | buggy_23.sol |
19,864 | function bug_tmstmp32 () public payable {
uint pastBlockTime_tmstmp32; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp32); // only 1 transaction per block //bug
pastBlockTime_tmstmp32 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
} | 6 | buggy_50.sol |
19,744 | function play_tmstmp15(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp15 = msg.sender;}} | 6 | buggy_47.sol |
13,115 | contract Template {
bool claimed_TOD12 = false;
address payable owner_TOD12;
uint256 reward_TOD12;
function setReward_TOD12() public payable {
require (!claimed_TOD12);
require(msg.sender == owner_TOD12);
owner_TOD12.transfer(reward_TOD12);
reward_TOD12 = msg.value;
}
function claimReward_TOD12(uint256 submission) public {
require (!claimed_TOD12);
require(submission < 10);
msg.sender.transfer(reward_TOD12);
claimed_TOD12 = true;
}
address private _factory;
// modifiers
modifier initializeTemplate() {
// set factory
_factory = msg.sender;
// only allow function to be delegatecalled from within a constructor.
uint32 codeSize;
assembly { codeSize := extcodesize(address) }
require(codeSize == 0, "must be called within contract constructor");
_;
}
// view functions
function getCreator() public view returns (address creator) {
// iFactory(...) would revert if _factory address is not actually a factory contract
creator = iFactory(_factory).getInstanceCreator(address(this));
}
address payable winner_TOD7;
function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
}
function getReward_TOD7() payable public{
winner_TOD7.transfer(msg.value);
}
function isCreator(address caller) public view returns (bool ok) {
ok = (caller == getCreator());
}
address payable winner_TOD23;
function play_TOD23(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD23 = msg.sender;
}
}
function getReward_TOD23() payable public{
winner_TOD23.transfer(msg.value);
}
function getFactory() public view returns (address factory) {
factory = _factory;
}
bool claimed_TOD14 = false;
address payable owner_TOD14;
uint256 reward_TOD14;
function setReward_TOD14() public payable {
require (!claimed_TOD14);
require(msg.sender == owner_TOD14);
owner_TOD14.transfer(reward_TOD14);
reward_TOD14 = msg.value;
}
function claimReward_TOD14(uint256 submission) public {
require (!claimed_TOD14);
require(submission < 10);
msg.sender.transfer(reward_TOD14);
claimed_TOD14 = true;
}
} | 4 | buggy_44.sol |
3,268 | function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
} | 2 | buggy_24.sol |
13,721 | function getReward_TOD25() payable public{
winner_TOD25.transfer(msg.value);
} | 4 | buggy_48.sol |
4,637 | function transfer_undrflow2(address _to, uint _value) public returns (bool) {
require(balances_intou2[msg.sender] - _value >= 0); //bug
balances_intou2[msg.sender] -= _value; //bug
balances_intou2[_to] += _value; //bug
return true;
} | 2 | buggy_7.sol |
721 | function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public {
require(tx.origin == owner_txorigin38);
_recipient.transfer(address(this).balance);
} | 1 | buggy_32.sol |
16,698 | 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_50.sol |
19,836 | 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_45.sol |
20,096 | function play_tmstmp27(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp27 = msg.sender;}} | 6 | buggy_40.sol |
1,286 | constructor() payable public {
} | 0 | buggy_22.sol |
254 | function approve(address spender, uint256 amount) external returns (bool); | 0 | buggy_30.sol |
Subsets and Splits