Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
19,437 | function calculateBonus(uint256 timeElasped , uint256 amount) public view returns(uint256){
uint256 totalDays = timeElasped.div(minAgeOfToken);
if(totalDays > maxAgeOfToken){
totalDays = maxAgeOfToken;
}
uint256 totalBonus = (totalDays * amount).div(perDayBonus);
return totalBonus;
} | 0 | buggy_34.sol |
406 | constructor(
string memory name,
string memory symbol,
address[] memory defaultOperators
) public {
_name = name;
_symbol = symbol;
_defaultOperatorsArray = defaultOperators;
for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {
_defaultOperators[_defaultOperatorsArray[i]] = true;
}
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC777Token"), address(this));
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC20Token"), address(this));
} | 0 | buggy_30.sol |
21,224 | function bug_unchk_send27() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_19.sol |
8,299 | function unhandledsend_unchk2(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_22.sol |
16,693 | function getcontractbalance() public view returns(uint)
{
return address(this).balance;
} | 0 | buggy_50.sol |
1,601 | function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
} | 1 | buggy_21.sol |
17,634 | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
} | 0 | buggy_17.sol |
1,756 | function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
} | 1 | buggy_47.sol |
7,047 | constructor () internal {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
} | 0 | buggy_31.sol |
14,729 | function joinFixed() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
125 | function bug_txorigin4(address owner_txorigin4) public{
require(tx.origin == owner_txorigin4);
} | 1 | buggy_25.sol |
11,117 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_32.sol |
4,461 | function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
} | 0 | buggy_36.sol |
16,044 | function callme_re_ent28() public{
require(counter_re_ent28<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent28 += 1;
} | 5 | buggy_22.sol |
11,055 | function allowance(address _owner, address _spender) public view returns (uint256 remaining); | 0 | buggy_32.sol |
24,255 | function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
} | 0 | buggy_8.sol |
10,279 | function getBalance() external view returns(uint){
return address(this).balance;
} | 0 | buggy_25.sol |
6,929 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_14.sol |
1,652 | function transferTo_txorigin27(address to, uint amount,address owner_txorigin27) public {
require(tx.origin == owner_txorigin27);
to.call.value(amount);
} | 1 | buggy_35.sol |
18,321 | function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}} | 6 | buggy_30.sol |
6,840 | 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;
} | 0 | buggy_28.sol |
6,203 | function bug_intou8(uint8 p_intou8) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou8; // overflow bug
} | 2 | buggy_39.sol |
3,632 | function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
} | 2 | buggy_18.sol |
24,709 | contract HYDROGEN is ERC20Detailed {
using SafeMath for uint256;
function bug_unchk_send15() payable public{
msg.sender.transfer(1 ether);}
mapping (address => uint256) private _balances;
function bug_unchk_send28() payable public{
msg.sender.transfer(1 ether);}
mapping (address => mapping (address => uint256)) private _allowed;
function bug_unchk_send21() payable public{
msg.sender.transfer(1 ether);}
string constant tokenName = "HYDROGEN";
function bug_unchk_send10() payable public{
msg.sender.transfer(1 ether);}
string constant tokenSymbol = "HGN";
function bug_unchk_send22() payable public{
msg.sender.transfer(1 ether);}
uint8 constant tokenDecimals = 4;
function bug_unchk_send12() payable public{
msg.sender.transfer(1 ether);}
uint256 _totalSupply =8000000000;
function bug_unchk_send11() payable public{
msg.sender.transfer(1 ether);}
uint256 public basePercent = 100;
constructor() public payable ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) {
_mint(msg.sender, _totalSupply);
}
function bug_unchk_send9() payable public{
msg.sender.transfer(1 ether);}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function bug_unchk_send25() payable public{
msg.sender.transfer(1 ether);}
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
function bug_unchk_send19() payable public{
msg.sender.transfer(1 ether);}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);}
function findtwoPercent(uint256 value) public view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 twoPercent = roundValue.mul(basePercent).div(5000);
return twoPercent;
}
function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);}
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_unchk_send32() payable public{
msg.sender.transfer(1 ether);}
function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
}
}
function bug_unchk_send4() payable public{
msg.sender.transfer(1 ether);}
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 bug_unchk_send7() payable public{
msg.sender.transfer(1 ether);}
function transferFrom(address from, address to, uint256 value) public returns (bool) {
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
uint256 tokensToBurn = findtwoPercent(value);
uint256 tokensToTransfer = value.sub(tokensToBurn);
_balances[to] = _balances[to].add(tokensToTransfer);
_totalSupply = _totalSupply.sub(tokensToBurn);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, tokensToTransfer);
emit Transfer(from, address(0), tokensToBurn);
return true;
}
function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);}
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 bug_unchk_send14() payable public{
msg.sender.transfer(1 ether);}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = (_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
function bug_unchk_send30() payable public{
msg.sender.transfer(1 ether);}
function _mint(address account, uint256 amount) internal {
require(amount != 0);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function bug_unchk_send8() payable public{
msg.sender.transfer(1 ether);}
function burn(uint256 amount) external {
_burn(msg.sender, amount);
}
function bug_unchk_send27() payable public{
msg.sender.transfer(1 ether);}
function _burn(address account, uint256 amount) internal {
require(amount != 0);
require(amount <= _balances[account]);
_totalSupply = _totalSupply.sub(amount);
_balances[account] = _balances[account].sub(amount);
emit Transfer(account, address(0), amount);
}
function bug_unchk_send31() payable public{
msg.sender.transfer(1 ether);}
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 bug_unchk_send13() payable public{
msg.sender.transfer(1 ether);}
} | 7 | buggy_28.sol |
17,633 | function claimReward_re_ent4() public {
// ensure there is a reward to give
require(redeemableEther_re_ent4[msg.sender] > 0);
uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender];
msg.sender.transfer(transferValue_re_ent4); //bug
redeemableEther_re_ent4[msg.sender] = 0;
} | 5 | buggy_17.sol |
17,517 | function balanceOf(address tokenOwner) public view returns (uint256 balance); | 0 | buggy_16.sol |
11,281 | function claimReward_TOD34(uint256 submission) public {
require (!claimed_TOD34);
require(submission < 10);
msg.sender.transfer(reward_TOD34);
claimed_TOD34 = true;
} | 4 | buggy_27.sol |
1,599 | function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
} | 1 | buggy_21.sol |
15,498 | function bug_re_ent27() public{
require(not_called_re_ent27);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent27 = false;
} | 5 | buggy_33.sol |
20,770 | function transferFrom(address from, address to, uint256 tokens) public returns (bool success); | 0 | buggy_16.sol |
9,338 | function UncheckedExternalCall_unchk40 () public
{ address payable addr_unchk40;
if (! addr_unchk40.send (2 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_42.sol |
5,007 | function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_21.sol |
16,844 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_40.sol |
17,461 | 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_11.sol |
9,777 | function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_17.sol |
3,336 | function tokensToSend(
address operator,
address from,
address to,
uint amount,
bytes calldata userData,
bytes calldata operatorData
) external; | 0 | buggy_30.sol |
9,628 | function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
} | 3 | buggy_39.sol |
14,266 | function setReward_TOD38() public payable {
require (!claimed_TOD38);
require(msg.sender == owner_TOD38);
owner_TOD38.transfer(reward_TOD38);
reward_TOD38 = msg.value;
} | 4 | buggy_17.sol |
7,976 | constructor () internal
{
stopped = false;
_owner = msg.sender;
_master = msg.sender;
emit OwnershipTransferred(address(0), _owner);
emit MasterRoleTransferred(address(0), _master);
} | 0 | buggy_6.sol |
2,503 | function findfourPercent(uint256 value) public view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 fourPercent = roundValue.mul(basePercent).div(2500);
return fourPercent;
} | 0 | buggy_38.sol |
19,300 | function owner() public view returns (address)
{
return _owner;
} | 0 | buggy_7.sol |
12,687 | function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
} | 4 | buggy_4.sol |
14,784 | function claimReward_re_ent4() public {
// ensure there is a reward to give
require(redeemableEther_re_ent4[msg.sender] > 0);
uint transferValue_re_ent4 = redeemableEther_re_ent4[msg.sender];
msg.sender.transfer(transferValue_re_ent4); //bug
redeemableEther_re_ent4[msg.sender] = 0;
} | 5 | buggy_31.sol |
12,416 | function availableFunds() public view returns (uint256); | 0 | buggy_20.sol |
21,636 | function bug_unchk_send8() payable public{
msg.sender.transfer(1 ether);} | 0 | buggy_18.sol |
8,952 | contract EventMetadata {
bool public payedOut_unchk33 = false;
function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
}
event MetadataSet(bytes metadata);
// state functions
function _setMetadata(bytes memory metadata) internal {
emit MetadataSet(metadata);
}
function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);}
} | 3 | buggy_44.sol |
22,656 | constructor () public {
owner = msg.sender;
} | 0 | buggy_5.sol |
10,548 | function _removeMinter(address account) internal {
_minters.remove(account);
emit MinterRemoved(account);
} | 0 | buggy_30.sol |
1,120 | function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
} | 0 | buggy_23.sol |
17,308 | function Initialized()
public
{
intitalized = true;
} | 0 | 0x561eac93c92360949ab1f1403323e6db345cbf31.sol |
18,853 | function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}} | 6 | buggy_27.sol |
14,605 | function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
} | 0 | buggy_14.sol |
14,631 | function play_TOD31(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD31 = msg.sender;
}
} | 4 | buggy_14.sol |
22,895 | function bug_unchk_send28() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_20.sol |
5,843 | function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_48.sol |
7,943 | function bug_unchk3(address payable addr) public
{addr.send (42 ether); } | 3 | buggy_6.sol |
22,585 | function bug_unchk_send22() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_7.sol |
20,659 | 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 | buggy_12.sol |
3,223 | function givePrizeMoney(uint64 _fixtureId, uint8 _homeDrawAway, uint8 _overUnder) external onlyOwner payable {
// Check the game status whether is opening
require(gameList[_fixtureId].open_status == 3);
// Check if it has ever compensated
require(gameList[_fixtureId].isDone == false);
// Check if it has any player who betted
require(betList[_fixtureId][0].player != address(0) );
// Give the prize money!
for (uint i= 0 ; i < betList[_fixtureId].length; i++){
uint16 selectedTeam = betList[_fixtureId][i].selectedTeam;
uint256 returnEth = (betList[_fixtureId][i].stake * betList[_fixtureId][i].odd) / 1000 ;
if ( (selectedTeam == 1 && _homeDrawAway == 1)
|| (selectedTeam == 2 && _homeDrawAway == 2)
|| (selectedTeam == 3 && _homeDrawAway == 3)
|| (selectedTeam == 4 && _overUnder == 1)
|| (selectedTeam == 5 && _overUnder == 2)
|| (selectedTeam == 6 && ( _homeDrawAway == 1 || _homeDrawAway == 2) )
|| (selectedTeam == 7 && ( _homeDrawAway == 1 || _homeDrawAway == 3) )
|| (selectedTeam == 8 && ( _homeDrawAway == 3 || _homeDrawAway == 2) )
){
betList[_fixtureId][i].player.transfer(returnEth);
}
}
// Change the game status.
gameList[_fixtureId].open_status = 5;
// It was paid.
gameList[_fixtureId].isDone = true; // 보상을 마쳤으므로 true로 변경.
emit GivePrizeMoney( _fixtureId, _homeDrawAway, _overUnder);
} | 0 | buggy_25.sol |
9,670 | function balanceOf(address tokenOwner) public view returns (uint256 balance); | 0 | buggy_16.sol |
9,539 | function bid() payable {
require(msg.value > currentBid);
//If the refund fails, the entire transaction reverts.
//Therefore a frontrunner who always fails will win
if (currentFrontrunner != 0) {
//E.g. if recipients fallback function is just revert()
// <yes> <report> DENIAL_OF_SERVICE
require(currentFrontrunner.send(currentBid));
}
currentFrontrunner = msg.sender;
currentBid = msg.value;
} | 3 | auction.sol |
7,216 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
return c;
} | 0 | buggy_30.sol |
12,218 | function play_TOD15(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD15 = msg.sender;
}
} | 4 | buggy_34.sol |
6,146 | function transfer_intou10(address _to, uint _value) public returns (bool) {
require(balances_intou10[msg.sender] - _value >= 0); //bug
balances_intou10[msg.sender] -= _value; //bug
balances_intou10[_to] += _value; //bug
return true;
} | 2 | buggy_11.sol |
12,966 | function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
} | 4 | buggy_50.sol |
23,854 | function totalSupply() public view returns (uint); | 0 | buggy_48.sol |
10,099 | function withdrawForUser(address payable _address,uint amount) onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
_address.transfer(amount);
} | 0 | buggy_19.sol |
23,954 | function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_9.sol |
18,481 | function allowance(address tokenOwner, address spender) public view returns(uint remaining); | 0 | buggy_18.sol |
17,295 | function()
public
payable
{
Put(0);
} | 0 | 0x7541b76cb60f4c60af330c208b0623b7f54bf615.sol |
1,791 | function balanceOf(address tokenOwner) public view returns (uint balance); | 0 | buggy_47.sol |
4,239 | 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_6.sol |
4,814 | function increaseLockTime_intou25(uint _secondsToIncrease) public {
lockTime_intou25[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_34.sol |
23,254 | function sethashfee(uint newfee) external onlyManager
{
require(newfee >= 0);
hashfee = newfee;
} | 0 | buggy_50.sol |
22,411 | function bug_unchk_send6() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_36.sol |
20,722 | function play_tmstmp26(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp26 = msg.sender;}} | 6 | buggy_12.sol |
22,443 | function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public {
Token t = Token(_token);
require(t.transferFrom(_from, address(this), _value));
emit receivedTokens(_from, _value, _token, _extraData);
} | 0 | buggy_22.sol |
2,815 | function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
} | 1 | buggy_17.sol |
12,476 | contract RampInstantEthPool is RampInstantPool {
bool claimed_TOD2 = false;
address payable owner_TOD2;
uint256 reward_TOD2;
function setReward_TOD2() public payable {
require (!claimed_TOD2);
require(msg.sender == owner_TOD2);
owner_TOD2.transfer(reward_TOD2);
reward_TOD2 = msg.value;
}
function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
}
uint16 internal constant ETH_TYPE_ID = 1;
constructor(
address payable _swapsContract,
uint256 _minSwapAmount,
uint256 _maxSwapAmount,
bytes32 _paymentDetailsHash
)
public
RampInstantPool(
_swapsContract, _minSwapAmount, _maxSwapAmount, _paymentDetailsHash, ETH_TYPE_ID
)
{}
bool claimed_TOD30 = false;
address payable owner_TOD30;
uint256 reward_TOD30;
function setReward_TOD30() public payable {
require (!claimed_TOD30);
require(msg.sender == owner_TOD30);
owner_TOD30.transfer(reward_TOD30);
reward_TOD30 = msg.value;
}
function claimReward_TOD30(uint256 submission) public {
require (!claimed_TOD30);
require(submission < 10);
msg.sender.transfer(reward_TOD30);
claimed_TOD30 = true;
}
function availableFunds() public view returns(uint256) {
return address(this).balance;
}
bool claimed_TOD8 = false;
address payable owner_TOD8;
uint256 reward_TOD8;
function setReward_TOD8() public payable {
require (!claimed_TOD8);
require(msg.sender == owner_TOD8);
owner_TOD8.transfer(reward_TOD8);
reward_TOD8 = msg.value;
}
function claimReward_TOD8(uint256 submission) public {
require (!claimed_TOD8);
require(submission < 10);
msg.sender.transfer(reward_TOD8);
claimed_TOD8 = true;
}
function withdrawFunds(
address payable _to,
uint256 _amount
) public onlyOwner returns (bool success) {
_to.transfer(_amount); // always throws on failure
return true;
}
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 sendFundsToSwap(
uint256 _amount
) public onlyActive onlySwapsContract isWithinLimits(_amount) returns(bool success) {
swapsContract.transfer(_amount); // always throws on failure
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;
}
/**
* This adapter can receive eth payments, but no other use of the fallback function is allowed.
*/
function () external payable {
require(msg.data.length == 0, "invalid pool function called");
if (msg.sender != swapsContract) {
emit ReceivedFunds(msg.sender, msg.value);
}
}
address payable winner_TOD35;
function play_TOD35(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD35 = msg.sender;
}
}
function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
}
} | 4 | buggy_20.sol |
14,073 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_16.sol |
7,456 | function isOperatorFor(address operator, address tokenHolder) external view returns (bool); | 0 | buggy_30.sol |
6,997 | function teamAddBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
17,468 | function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
} | 0 | buggy_11.sol |
19,378 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
} | 0 | buggy_5.sol |
10,695 | function claimReward_TOD16(uint256 submission) public {
require (!claimed_TOD16);
require(submission < 10);
msg.sender.transfer(reward_TOD16);
claimed_TOD16 = true;
} | 4 | buggy_30.sol |
10,669 | function play_TOD25(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD25 = msg.sender;
}
} | 4 | buggy_30.sol |
13,992 | constructor() public {
symbol = "FTB";
name = "ForTheBlockchain";
decimals = 8;
_totalSupply =100000000 * 10**(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
} | 0 | buggy_11.sol |
1,822 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_47.sol |
1,798 | function sendto_txorigin25(address payable receiver, uint amount,address owner_txorigin25) public {
require (tx.origin == owner_txorigin25);
receiver.transfer(amount);
} | 1 | buggy_47.sol |
4,400 | function increaseLockTime_intou9(uint _secondsToIncrease) public {
lockTime_intou9[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_23.sol |
1,677 | function balanceOf(address token, address user) public view returns (uint) {
return tokens[token][user];
} | 0 | buggy_35.sol |
16,105 | function withdrawFunds_re_ent38 (uint256 _weiToWithdraw) public {
require(balances_re_ent38[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
require(msg.sender.send(_weiToWithdraw)); //bug
balances_re_ent38[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_7.sol |
9,367 | function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
} | 0 | buggy_49.sol |
15,949 | function pause() public; | 0 | buggy_36.sol |
15,043 | 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_30.sol |
8,242 | function checkProposalCode(
uint proposalNumber,
address destination,
uint weiAmount,
bytes memory transactionBytecode
)
view public
returns (bool codeChecksOut)
{
Proposal storage p = proposals[proposalNumber];
return p.proposalHash == keccak256(abi.encodePacked(destination, weiAmount, transactionBytecode));
} | 0 | buggy_36.sol |
17,803 | 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_28.sol |
14,783 | contract Ownable {
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;
}
address private _owner;
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 OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _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;
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
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;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
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;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
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;
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
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;
}
} | 5 | buggy_31.sol |
4,373 | function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
} | 0 | buggy_23.sol |
16,295 | 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;
} | 5 | buggy_20.sol |
Subsets and Splits