Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
15,684 | function transferOwnership(address newOwner) external onlyOwner
{
_transferOwnership(newOwner);
} | 0 | buggy_6.sol |
14,131 | function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
} | 4 | buggy_16.sol |
188 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_24.sol |
3,126 | function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
} | 2 | buggy_19.sol |
17,240 | 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_48.sol |
14,602 | 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_14.sol |
15,200 | function limitLessThan(uint a, uint b) internal pure returns(uint c) {
if (a > b) return b;
return a;
} | 0 | buggy_18.sol |
7,822 | function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
} | 3 | buggy_27.sol |
16,517 | function totalSupply() public view returns (uint); | 0 | buggy_47.sol |
20,266 | function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_49.sol |
13,824 | function setReward_TOD20() public payable {
require (!claimed_TOD20);
require(msg.sender == owner_TOD20);
owner_TOD20.transfer(reward_TOD20);
reward_TOD20 = msg.value;
} | 4 | buggy_38.sol |
5,294 | function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
} | 2 | buggy_45.sol |
20,937 | function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_15.sol |
7,635 | function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_26.sol |
4,782 | 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, "SafeMath: multiplication overflow");
return c;
} | 0 | buggy_34.sol |
2,700 | function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
} | 1 | buggy_16.sol |
21,257 | function bug_unchk_send4() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_31.sol |
16,486 | 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_4.sol |
9,714 | function approve(address _spender, uint256 _amount) public returns (bool success) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender,0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_amount == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _amount;
emit Approval(msg.sender, _spender, _amount);
return true;
} | 0 | buggy_16.sol |
17,206 | function Deposit()
public
payable
{
balances[msg.sender]+= msg.value;
Log.AddMessage(msg.sender,msg.value,"Put");
} | 0 | 0x4320e6f8c05b27ab4707cd1f6d5ce6f3e4b3a5a1.sol |
212 | function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public {
require (tx.origin == owner_txorigin13);
receiver.transfer(amount);
} | 1 | buggy_24.sol |
9,246 | function my_func_uncheck48(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_43.sol |
20,201 | function bug_tmstmp33() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_43.sol |
13,582 | function setReward_TOD26() public payable {
require (!claimed_TOD26);
require(msg.sender == owner_TOD26);
owner_TOD26.transfer(reward_TOD26);
reward_TOD26 = msg.value;
} | 4 | buggy_42.sol |
21,608 | function isOperatorFor(address operator, address tokenHolder) external view returns (bool); | 0 | buggy_30.sol |
1,567 | contract RampInstantEthPool is RampInstantPool {
function withdrawAll_txorigin2(address payable _recipient,address owner_txorigin2) public {
require(tx.origin == owner_txorigin2);
_recipient.transfer(address(this).balance);
}
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
)
{}
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
}
function availableFunds() public view returns(uint256) {
return address(this).balance;
}
function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
}
function withdrawFunds(
address payable _to,
uint256 _amount
) public onlyOwner returns (bool success) {
_to.transfer(_amount); // always throws on failure
return true;
}
function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public {
require(tx.origin == owner_txorigin39);
to.call.value(amount);
}
function sendFundsToSwap(
uint256 _amount
) public onlyActive onlySwapsContract isWithinLimits(_amount) returns(bool success) {
swapsContract.transfer(_amount); // always throws on failure
return true;
}
function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
}
/**
* 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);
}
}
function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
}
} | 1 | buggy_20.sol |
4,598 | function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
} | 2 | buggy_7.sol |
3,098 | function withdraw_ovrflow1() public {
require(now > lockTime_intou1[msg.sender]);
uint transferValue_intou1 = 10;
msg.sender.transfer(transferValue_intou1);
} | 2 | buggy_19.sol |
15,450 | function withdraw_balances_re_ent36 () public {
if (msg.sender.send(balances_re_ent36[msg.sender ]))
balances_re_ent36[msg.sender] = 0;
} | 5 | buggy_32.sol |
14,308 | function getReward_TOD39() payable public{
winner_TOD39.transfer(msg.value);
} | 4 | buggy_17.sol |
18,429 | function balanceOf(address owner) external view returns (uint256); | 0 | buggy_30.sol |
13,221 | function getReward_TOD3() payable public{
winner_TOD3.transfer(msg.value);
} | 4 | buggy_40.sol |
23,346 | function _setMetadata(bytes memory metadata) internal {
emit MetadataSet(metadata);
} | 0 | buggy_44.sol |
2,829 | function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public {
require(tx.origin == owner_txorigin23);
to.call.value(amount);
} | 1 | buggy_15.sol |
23,042 | function bug_unchk_send4() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_4.sol |
5,676 | function bug_intou11() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_43.sol |
18,508 | function getChallengeNumber() public view returns(bytes32) {
return challengeNumber;
} | 0 | buggy_18.sol |
22,506 | function balanceOf(address who) constant returns (uint); | 0 | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol |
4,121 | 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_2.sol |
22,843 | function withdrawAllFunds(address payable _to) public onlyOwner returns (bool success) {
return withdrawFunds(_to, availableFunds());
} | 0 | buggy_20.sol |
9,911 | contract ERC20Detailed is IERC20 {
function bug_unchk43() public{
address payable addr_unchk43;
if (!addr_unchk43.send (10 ether) || 1==1)
{revert();}
}
string private _name;
function my_func_uncheck48(address payable dst) public payable{
dst.call.value(msg.value)("");
}
string private _symbol;
function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);}
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
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;
}
function name() public view returns(string memory) {
return _name;
}
function unhandledsend_unchk38(address payable callee) public {
callee.send(5 ether);
}
function symbol() public view returns(string memory) {
return _symbol;
}
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;
}
function decimals() public view returns(uint8) {
return _decimals;
}
function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
} | 3 | buggy_28.sol |
9,150 | function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_40.sol |
21,155 | contract SaveWon is ERC20, ERC20Detailed {
address winner_tmstmp23;
function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}}
uint8 public constant DECIMALS = 18;
uint256 public constant INITIAL_SUPPLY = 50000000000 * (10 ** uint256(DECIMALS));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor () public ERC20Detailed("SaveWon", "SVW", DECIMALS) {
_mint(msg.sender, INITIAL_SUPPLY);
}
uint256 bugv_tmstmp4 = block.timestamp;
} | 6 | buggy_14.sol |
17,048 | 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_43.sol |
18,247 | function bug_tmstmp29() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_30.sol |
18,479 | function balanceOf(address tokenOwner) public view returns(uint balance); | 0 | buggy_18.sol |
13,328 | function claimReward_TOD38(uint256 submission) public {
require (!claimed_TOD38);
require(submission < 10);
msg.sender.transfer(reward_TOD38);
claimed_TOD38 = true;
} | 4 | buggy_40.sol |
15,062 | 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 |
15,950 | 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;
} | 5 | buggy_36.sol |
5,342 | function bug_intou3() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_50.sol |
17,933 | 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;
} | 5 | buggy_14.sol |
21,020 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_28.sol |
18,324 | function renouncePauser() public {
_removePauser(msg.sender);
} | 0 | buggy_30.sol |
1,156 | function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public {
require(tx.origin == owner_txorigin31);
to.call.value(amount);
} | 1 | buggy_23.sol |
21,370 | function calcDynamicCommissionBegin(uint256 index, uint256 length) external onlyOwner {
for (uint256 i = index; i < (index + length); ++i) {
User storage user = userMapping[addressMapping[i]];
user.calcDynamicCommissionAmount = 0;
}
} | 0 | buggy_24.sol |
9,907 | function symbol() public view returns(string memory) {
return _symbol;
} | 0 | buggy_28.sol |
3,251 | function bug_intou15() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_24.sol |
349 | function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
} | 1 | buggy_30.sol |
22,391 | function bug_unchk_send2() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_36.sol |
20,458 | function name() public view returns(string memory) {
return _name;
} | 0 | buggy_38.sol |
5,267 | function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_47.sol |
17,720 | 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_15.sol |
13,081 | function setReward_TOD32() public payable {
require (!claimed_TOD32);
require(msg.sender == owner_TOD32);
owner_TOD32.transfer(reward_TOD32);
reward_TOD32 = msg.value;
} | 4 | buggy_44.sol |
11,839 | function play_TOD3(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD3 = msg.sender;
}
} | 4 | buggy_36.sol |
17,857 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
} | 0 | buggy_14.sol |
2,828 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_15.sol |
10,208 | function play_TOD31(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD31 = msg.sender;
}
} | 4 | buggy_31.sol |
343 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_30.sol |
18,089 | function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}} | 6 | buggy_25.sol |
12,517 | function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
} | 4 | buggy_21.sol |
1,013 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
} | 0 | buggy_23.sol |
17,302 | function Put(uint _lockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
if(now+_lockTime>acc.unlockTime)acc.unlockTime=now+_lockTime;
Log.AddMessage(msg.sender,msg.value,"Put");
} | 0 | 0x96edbe868531bd23a6c05e9d0c424ea64fb1b78b.sol |
277 | function transfer(address recipient, uint256 amount) external returns (bool) {
require(recipient != address(0), "ERC777: transfer to the zero address");
address from = msg.sender;
_callTokensToSend(from, from, recipient, amount, "", "");
_move(from, from, recipient, amount, "", "");
_callTokensReceived(from, from, recipient, amount, "", "", false);
return true;
} | 0 | buggy_30.sol |
3,234 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_25.sol |
4,544 | function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
} | 0 | buggy_22.sol |
7,425 | function approve(address spender, uint256 value) external returns (bool) {
address holder = msg.sender;
_approve(holder, spender, value);
return true;
} | 0 | buggy_30.sol |
1,328 | function start() public onlyOwner
{
_start();
} | 0 | buggy_7.sol |
23,936 | function bug_unchk_send3() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_9.sol |
13,480 | function _activateOperator() internal {
require(!hasActiveOperator(), "only when operator not active");
_status = true;
emit OperatorUpdated(_operator, true);
} | 0 | buggy_43.sol |
13,057 | function _deactivateOperator() internal {
require(hasActiveOperator(), "only when operator active");
_status = false;
emit OperatorUpdated(_operator, false);
} | 0 | buggy_44.sol |
10,643 | function renouncePauser() public {
_removePauser(msg.sender);
} | 0 | buggy_30.sol |
14,485 | function claimReward_TOD32(uint256 submission) public {
require (!claimed_TOD32);
require(submission < 10);
msg.sender.transfer(reward_TOD32);
claimed_TOD32 = true;
} | 4 | buggy_28.sol |
9,666 | function transferOwnership(address payable newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
} | 0 | buggy_16.sol |
7,518 | function bug_unchk18() public{
uint receivers_unchk18;
address payable addr_unchk18;
if (!addr_unchk18.send(42 ether))
{receivers_unchk18 +=1;}
else
{revert();}
} | 3 | buggy_18.sol |
9,031 | function unhandledsend_unchk26(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_44.sol |
2,390 | function withdrawAll_txorigin34(address payable _recipient,address owner_txorigin34) public {
require(tx.origin == owner_txorigin34);
_recipient.transfer(address(this).balance);
} | 1 | buggy_48.sol |
21,131 | function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}} | 6 | buggy_14.sol |
11,175 | function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
} | 4 | buggy_33.sol |
10,526 | function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
} | 0 | buggy_30.sol |
23,687 | function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
} | 0 | buggy_42.sol |
18 | function moveBrick(uint amount) onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(amount);
} | 0 | buggy_19.sol |
9,904 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_28.sol |
22,816 | function bug_unchk_send12() payable public{
msg.sender.transfer(1 ether);} /*statusAtLeast(Status.FINALIZE_ONLY) onlyOracleOrPool(_pool, _oracle)*/ | 7 | buggy_20.sol |
13,478 | function play_TOD3(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD3 = msg.sender;
}
} | 4 | buggy_43.sol |
9,755 | function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_17.sol |
21,034 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_28.sol |
6,169 | function transferFrom(address from, address to, uint tokens) public returns (bool success); | 0 | buggy_11.sol |
20,296 | function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}} | 6 | buggy_48.sol |
3,666 | function bug_intou15() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_18.sol |
20,827 | function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}} | 6 | buggy_16.sol |