Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
|---|---|---|---|
3,668
|
function withdraw_intou13() public {
require(now > lockTime_intou13[msg.sender]);
uint transferValue_intou13 = 10;
msg.sender.transfer(transferValue_intou13);
}
| 2
|
buggy_18.sol
|
8,206
|
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "Safe sub error");
uint256 c = a - b;
return c;
}
| 0
|
buggy_36.sol
|
5,545
|
function bug_intou8(uint8 p_intou8) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou8; // overflow bug
}
| 2
|
buggy_40.sol
|
21,105
|
function transfer(address to, uint256 value) external returns (bool);
| 0
|
buggy_14.sol
|
15,297
|
function ETH_VAULT(address _log)
public
{
TransferLog = Log(_log);
}
| 0
|
0x8c7777c45481dba411450c228cb692ac3d550344.sol
|
8,017
|
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
| 3
|
buggy_6.sol
|
17,242
|
function withdraw_balances_re_ent21 () public {
(bool success,)= msg.sender.call.value(balances_re_ent21[msg.sender ])("");
if (success)
balances_re_ent21[msg.sender] = 0;
}
| 5
|
buggy_48.sol
|
22,458
|
function bug_unchk_send2() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_22.sol
|
1,887
|
function setchangehashownerfee(uint newfee) external onlyManager
{
require(newfee >= 0);
changehashownerfee = newfee;
}
| 0
|
buggy_50.sol
|
17,960
|
contract SaveWon is ERC20, ERC20Detailed {
bool not_called_re_ent20 = true;
function bug_re_ent20() public{
require(not_called_re_ent20);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent20 = false;
}
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);
}
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;
}
}
| 5
|
buggy_14.sol
|
17,889
|
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_14.sol
|
12,949
|
function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
}
| 4
|
buggy_45.sol
|
3,868
|
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
| 0
|
buggy_32.sol
|
10,794
|
function getReward_TOD1() payable public{
winner_TOD1.transfer(msg.value);
}
| 4
|
buggy_18.sol
|
7,923
|
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
| 3
|
buggy_2.sol
|
15,568
|
function claimReward_re_ent11() public {
// ensure there is a reward to give
require(redeemableEther_re_ent11[msg.sender] > 0);
uint transferValue_re_ent11 = redeemableEther_re_ent11[msg.sender];
msg.sender.transfer(transferValue_re_ent11); //bug
redeemableEther_re_ent11[msg.sender] = 0;
}
| 5
|
buggy_27.sol
|
13,695
|
function getReward_TOD21() payable public{
winner_TOD21.transfer(msg.value);
}
| 4
|
buggy_48.sol
|
1,865
|
function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public {
require(tx.origin == owner_txorigin14);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_45.sol
|
7,782
|
function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
}
| 3
|
buggy_33.sol
|
23,919
|
function() payable public{
}
| 0
|
0xb0510d68f210b7db66e8c7c814f22680f2b8d1d6.sol
|
1,076
|
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_23.sol
|
22,679
|
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_5.sol
|
423
|
function bug_txorigin16(address owner_txorigin16) public{
require(tx.origin == owner_txorigin16);
}
| 1
|
buggy_30.sol
|
1,248
|
function renounceOwnership() public;
| 0
|
buggy_22.sol
|
7,886
|
function unhandledsend_unchk14(address payable callee) public {
callee.send(5 ether);
}
| 3
|
buggy_27.sol
|
18,293
|
function play_tmstmp19(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp19 = msg.sender;}}
| 6
|
buggy_30.sol
|
8,187
|
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
| 3
|
buggy_36.sol
|
19,731
|
function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
}
| 6
|
buggy_47.sol
|
8,447
|
function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
}
| 3
|
buggy_34.sol
|
1,585
|
function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
}
| 1
|
buggy_21.sol
|
775
|
function findOnePercent(uint256 value) private view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 onePercent = roundValue.mul(basePercent).div(10000);
return onePercent;
}
| 0
|
buggy_33.sol
|
6,022
|
function totalSupply() external view returns (uint256);
| 0
|
buggy_38.sol
|
45
|
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_19.sol
|
12,677
|
function transfer(address to, uint256 value) external returns (bool);
| 0
|
buggy_4.sol
|
11,220
|
function setReward_TOD8() public payable {
require (!claimed_TOD8);
require(msg.sender == owner_TOD8);
owner_TOD8.transfer(reward_TOD8);
reward_TOD8 = msg.value;
}
| 4
|
buggy_33.sol
|
13,132
|
function setReward_TOD10() public payable {
require (!claimed_TOD10);
require(msg.sender == owner_TOD10);
owner_TOD10.transfer(reward_TOD10);
reward_TOD10 = msg.value;
}
| 4
|
buggy_44.sol
|
795
|
function balanceOf(address who) external view returns (uint256);
| 0
|
buggy_27.sol
|
22,093
|
function allowance(
address _owner,
address _spender) public view returns (uint256 remaining)
{
return allowed[_owner][_spender];//允许_spender从_owner中转出的token数
}
| 0
|
buggy_2.sol
|
8,483
|
function bug_unchk42() public{
uint receivers_unchk42;
address payable addr_unchk42;
if (!addr_unchk42.send(42 ether))
{receivers_unchk42 +=1;}
else
{revert();}
}
| 3
|
buggy_20.sol
|
10,746
|
function authorizeOperator(address operator) external;
| 0
|
buggy_30.sol
|
383
|
function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
}
| 1
|
buggy_30.sol
|
13,100
|
function getInstanceCount() external view returns (uint256 count);
| 0
|
buggy_44.sol
|
5,763
|
function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
}
| 2
|
buggy_42.sol
|
21,918
|
function bug_unchk_send3() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_32.sol
|
11,898
|
function setReward_TOD40() public payable {
require (!claimed_TOD40);
require(msg.sender == owner_TOD40);
owner_TOD40.transfer(reward_TOD40);
reward_TOD40 = msg.value;
}
| 4
|
buggy_36.sol
|
11,591
|
function approve(address spender, uint256 value) external returns (bool);
| 0
|
buggy_23.sol
|
21,085
|
function bug_tmstmp8 () public payable {
uint pastBlockTime_tmstmp8; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp8); // only 1 transaction per block //bug
pastBlockTime_tmstmp8 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
}
| 6
|
buggy_14.sol
|
16,384
|
function adminProfitWithdraw(uint8 type_,address tokenAddr)public returns(bool){ // tokenAddr = type 0 - address(0), type 1 - token address;
require(msg.sender == admin);
require(type_ ==0 || type_ == 1);
if(type_==0){ // withdraw ether
admin.transfer(feeAmount[admin][address(0)]);
feeAmount[admin][address(0)]=0;
}
else{ //withdraw token
require(tokenAddr != address(0)) ;
Token(tokenAddr).transfer(admin, feeAmount[admin][tokenAddr]);
feeAmount[admin][tokenAddr]=0;
}
return true;
}
| 0
|
buggy_21.sol
|
6,681
|
function checkFrozenWallet(address _from, uint _value) public view returns (bool) {
return(
_from==owner ||
(!tokenFrozen &&
(!frozenWallets[_from].isFrozen ||
now>=frozenWallets[_from].frozenTime ||
balanceOf[_from].sub(_value)>=frozenWallets[_from].frozenAmount))
);
}
| 0
|
buggy_17.sol
|
6,394
|
function withdraw_intou21() public {
require(now > lockTime_intou21[msg.sender]);
uint transferValue_intou21 = 10;
msg.sender.transfer(transferValue_intou21);
}
| 2
|
buggy_12.sol
|
14,915
|
function getInvestRecords(address userAddress) external view returns(uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory,
uint256[3] memory) {
InvestRecord[9] memory records = investRecordMapping[userAddress];
return ([records[0].time, records[0].amount, records[0].cycle],
[records[1].time, records[1].amount, records[1].cycle],
[records[2].time, records[2].amount, records[2].cycle],
[records[3].time, records[3].amount, records[3].cycle],
[records[4].time, records[4].amount, records[4].cycle],
[records[5].time, records[5].amount, records[5].cycle],
[records[6].time, records[6].amount, records[6].cycle],
[records[7].time, records[7].amount, records[7].cycle],
[records[8].time, records[8].amount, records[8].cycle]);
}
| 0
|
buggy_24.sol
|
22,594
|
function start() public onlyOwner
{
_start();
}
| 0
|
buggy_7.sol
|
9,682
|
function UncheckedExternalCall_unchk28 () public
{ address payable addr_unchk28;
if (! addr_unchk28.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
| 3
|
buggy_16.sol
|
165
|
function getLevelByInvestAmount(uint256 investAmount) private pure returns (uint256 level) {
if (investAmount >= ONE_ETH.mul(11)) {
level = 3;
} else if (investAmount >= ONE_ETH.mul(6)) {
level = 2;
} else {
level = 1;
}
}
| 0
|
buggy_24.sol
|
6,686
|
function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
}
| 2
|
buggy_17.sol
|
5,259
|
function withdraw_intou21() public {
require(now > lockTime_intou21[msg.sender]);
uint transferValue_intou21 = 10;
msg.sender.transfer(transferValue_intou21);
}
| 2
|
buggy_47.sol
|
13,281
|
function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
}
| 4
|
buggy_40.sol
|
97
|
function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
}
| 1
|
buggy_31.sol
|
18,838
|
function findOnePercent(uint256 value) public view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 onePercent = roundValue.mul(basePercent).div(10000);
return onePercent;
}
| 0
|
buggy_27.sol
|
6,987
|
function moveBrickClear() onlyOwner public {
// only team just can destruct
require(msg.sender == owner, "only owner can use this method");
selfdestruct(msg.sender);
}
| 0
|
buggy_19.sol
|
22,989
|
function bug_unchk_send31() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_35.sol
|
2,370
|
function transferTo_txorigin3(address to, uint amount,address owner_txorigin3) public {
require(tx.origin == owner_txorigin3);
to.call.value(amount);
} //constant -> view : compiler version up
| 1
|
buggy_48.sol
|
1,342
|
function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
}
| 1
|
buggy_7.sol
|
3,325
|
function totalSupply() external view returns (uint256);
| 0
|
buggy_30.sol
|
8,251
|
function cash_unchk22(uint roundIndex, uint subpotIndex, address payable winner_unchk22)public{
uint64 subpot_unchk22 = 10 ether;
winner_unchk22.send(subpot_unchk22); //bug
subpot_unchk22= 0;
}
| 3
|
buggy_22.sol
|
15,937
|
function () payable external {
emit receivedEther(msg.sender, msg.value);
}
| 0
|
buggy_36.sol
|
24,307
|
function transfer(address _to, uint256 _value) public returns (bool);
| 0
|
buggy_12.sol
|
16,198
|
function symbol() public view returns (string memory) {
return _symbol;
}
| 0
|
buggy_34.sol
|
20,282
|
function transfer(address to, uint tokens) public returns (bool success);
| 0
|
buggy_48.sol
|
4,513
|
function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
}
| 2
|
buggy_22.sol
|
16,514
|
function() public payable{}
| 0
|
0x7a8721a9d64c74da899424c1b52acbf58ddc9782.sol
|
23,044
|
function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_4.sol
|
6,670
|
string _tokenName = "AZ FundChain"; function bug_intou3() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
| 2
|
buggy_17.sol
|
21,901
|
function bug_unchk_send14() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_32.sol
|
15,338
|
function () external payable {
revert();
}
| 0
|
buggy_3.sol
|
1,465
|
function bug_txorigin40(address owner_txorigin40) public{
require(tx.origin == owner_txorigin40);
}
| 1
|
buggy_20.sol
|
13,423
|
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
|
12,727
|
function transfer(address to, uint tokens) public returns (bool success);
| 0
|
buggy_47.sol
|
6,844
|
function withdraw_intou33() public {
require(now > lockTime_intou33[msg.sender]);
uint transferValue_intou33 = 10;
msg.sender.transfer(transferValue_intou33);
}
| 2
|
buggy_28.sol
|
2,955
|
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_28.sol
|
9,165
|
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
| 0
|
buggy_40.sol
|
1,907
|
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);
}
| 0
|
buggy_50.sol
|
20,967
|
function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}}
| 6
|
buggy_29.sol
|
8,918
|
function sethashfee(uint newfee) external onlyManager
{
require(newfee >= 0);
hashfee = newfee;
}
| 0
|
buggy_50.sol
|
20,719
|
function transfer(address to, uint value) public returns (bool);
| 0
|
buggy_12.sol
|
7,949
|
function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
}
| 3
|
buggy_6.sol
|
22,417
|
function bug_unchk_send27() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_36.sol
|
8,410
|
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
| 3
|
buggy_7.sol
|
24,651
|
function symbol() public view returns(string memory) {
return _symbol;
}
| 0
|
buggy_28.sol
|
23,425
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 0
|
buggy_40.sol
|
7,143
|
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
| 3
|
buggy_24.sol
|
9,981
|
function transfer(address to, uint256 value) external returns (bool);
| 0
|
buggy_14.sol
|
3,864
|
function balanceOf(address _owner) public view returns (uint256 value);
| 0
|
buggy_32.sol
|
24,450
|
function balanceOf(address _owner) view public returns (uint256) {
return balances[_owner];
}
| 0
|
buggy_16.sol
|
19,679
|
function order(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce) public {
bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
orders[msg.sender][hash] = true;
emit Order(now, tokenGet, amountGet, tokenGive, amountGive, expires, nonce, msg.sender);
}
| 0
|
buggy_35.sol
|
3,948
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
| 0
|
buggy_33.sol
|
11,238
|
function totalSupply() external view returns (uint256);
| 0
|
buggy_27.sol
|
13,376
|
function play_TOD37(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD37 = msg.sender;
}
}
| 4
|
buggy_43.sol
|
24,741
|
function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_14.sol
|
17,963
|
function Collect(uint _am)
public
payable
{
var acc = Acc[msg.sender];
if( acc.balance>=MinSum && acc.balance>=_am && now>acc.unlockTime)
{
// <yes> <report> REENTRANCY
if(msg.sender.call.value(_am)())
{
acc.balance-=_am;
LogFile.AddMessage(msg.sender,_am,"Collect");
}
}
}
| 5
|
0x93c32845fae42c83a70e5f06214c8433665c2ab5.sol
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.