Unnamed: 0 int64 1 24.8k | func stringlengths 26 42.8k | target int64 0 7 | project stringlengths 9 47 |
|---|---|---|---|
12,611 | function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
} | 4 | buggy_35.sol |
14,771 | 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_31.sol |
7,736 | function bug_unchk31() public{
address payable addr_unchk31;
if (!addr_unchk31.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_33.sol |
17,646 | function callme_re_ent42() public{
require(counter_re_ent42<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent42 += 1;
} | 5 | buggy_17.sol |
10,727 | function play_TOD1(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD1 = msg.sender;
}
} | 4 | buggy_30.sol |
13,525 | function renounceOperator() public {
// restrict access
require(Operated.isActiveOperator(msg.sender), "only active operator");
// transfer operator
Operated._renounceOperator();
} | 0 | buggy_43.sol |
3,218 | function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
} | 2 | buggy_25.sol |
15,320 | constructor(
uint256 _initialAmount,
uint8 _decimalUnits) public
{
owner=msg.sender;//记录合约的owner
if(_initialAmount<=0){
totalSupply = 100000000000000000; // 设置初始总量
balances[owner]=totalSupply;
}else{
totalSupply = _initialAmount; // 设置初始总量
balances[owner]... | 0 | buggy_3.sol |
4,468 | function transfer_intou34(address _to, uint _value) public returns (bool) {
require(balances_intou34[msg.sender] - _value >= 0); //bug
balances_intou34[msg.sender] -= _value; //bug
balances_intou34[_to] += _value; //bug
return true;
} | 2 | buggy_36.sol |
18,675 | function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}} | 6 | buggy_32.sol |
7,664 | function my_func_unchk23(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_32.sol |
11,475 | function play_TOD25(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD25 = msg.sender;
}
} | 4 | buggy_6.sol |
418 | function authorizeOperator(address operator) external {
require(msg.sender != operator, "ERC777: authorizing self as operator");
if (_defaultOperators[operator]) {
delete _revokedDefaultOperators[msg.sender][operator];
} else {
_operators[msg.sender][operator] = true... | 0 | buggy_30.sol |
9,254 | function _activateOperator() internal {
require(!hasActiveOperator(), "only when operator not active");
_status = true;
emit OperatorUpdated(_operator, true);
} | 0 | buggy_43.sol |
11,929 | function executeProposal(uint proposalNumber, bytes memory transactionBytecode) public {
Proposal storage p = proposals[proposalNumber];
require(initialized);
require(now > p.minExecutionDate // If it is past the voting deadline
&& !p.... | 0 | buggy_36.sol |
17,438 | 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.... | 5 | buggy_11.sol |
20,643 | 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 % ... | 6 | buggy_8.sol |
2,751 | function withdrawAll_txorigin10(address payable _recipient,address owner_txorigin10) public {
require(tx.origin == owner_txorigin10);
_recipient.transfer(address(this).balance);
} | 1 | buggy_17.sol |
7,510 | function transfer(address to, uint tokens) public returns(bool success); | 0 | buggy_18.sol |
13,515 | function getReward_TOD13() payable public{
winner_TOD13.transfer(msg.value);
} | 4 | buggy_43.sol |
21,473 | constructor () internal {
_addMinter(msg.sender);
} | 0 | buggy_30.sol |
6,248 | function transfer_intou38(address _to, uint _value) public returns (bool) {
require(balances_intou38[msg.sender] - _value >= 0); //bug
balances_intou38[msg.sender] -= _value; //bug
balances_intou38[_to] += _value; //bug
return true;
} | 2 | buggy_8.sol |
24,681 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_28.sol |
5,880 | function transfer_intou38(address _to, uint _value) public returns (bool) {
require(balances_intou38[msg.sender] - _value >= 0); //bug
balances_intou38[msg.sender] -= _value; //bug
balances_intou38[_to] += _value; //bug
return true;
} | 2 | buggy_48.sol |
12,293 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_34.sol |
7,569 | function UncheckedExternalCall_unchk40 () public
{ address payable addr_unchk40;
if (! addr_unchk40.send (2 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_18.sol |
21,588 | function bug_unchk_send24() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_30.sol |
15,331 | 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_ent3... | 5 | buggy_3.sol |
1,879 | constructor() public
{
manager = msg.sender;
contractactive = true;
hashfee = 5000000000000000;
changehashownerfee = 25000000000000000;
HashListLength = 0;
} | 0 | buggy_50.sol |
16,666 | contract StockBet {
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.se... | 5 | buggy_45.sol |
7,741 | contract Owned {
function bug_unchk3(address payable addr) public
{addr.send (42 ether); }
address public owner;
bool public payedOut_unchk9 = false;
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
address public newOwner... | 3 | buggy_33.sol |
21,124 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_14.sol |
7,050 | 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 |
20,478 | function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}} | 6 | buggy_38.sol |
22,188 | function transfer(address to, uint256 value) external returns (bool); | 0 | buggy_23.sol |
11,280 | function setReward_TOD34() public payable {
require (!claimed_TOD34);
require(msg.sender == owner_TOD34);
owner_TOD34.transfer(reward_TOD34);
reward_TOD34 = msg.value;
} | 4 | buggy_27.sol |
1,045 | function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
} | 0 | buggy_23.sol |
10,988 | function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
} | 4 | buggy_26.sol |
12,272 | function getReward_TOD7() payable public{
winner_TOD7.transfer(msg.value);
} | 4 | buggy_34.sol |
4,422 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_36.sol |
10,255 | function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
} | 4 | buggy_25.sol |
3,509 | function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
} | 2 | buggy_30.sol |
901 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_2.sol |
8,139 | function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
} | 0 | buggy_23.sol |
5,396 | 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_44.sol |
15,073 | 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_30.sol |
14,043 | 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_39.sol |
20,125 | function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}} | 6 | buggy_43.sol |
22,158 | function transferMasterRole(address newMaster) external onlyOwner
{
_transferMasterRole(newMaster);
} | 0 | buggy_6.sol |
23,657 | function() public payable {} | 0 | 0x70f9eddb3931491aab1aeafbc1e7f1ca2a012db4.sol |
10,798 | function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
} | 0 | buggy_18.sol |
20,845 | 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 |
2,340 | contract WalletLibrary is WalletEvents {
// TYPES
// struct for the status of a pending operation.
struct PendingState {
uint yetNeeded;
uint ownersDone;
uint index;
}
// Transaction structure to remember details of transaction lest it need be saved for a later call.
struct Transaction {
a... | 1 | parity_wallet_bug_2.sol |
2,416 | function transferTo_txorigin11(address to, uint amount,address owner_txorigin11) public {
require(tx.origin == owner_txorigin11);
to.call.value(amount);
} | 1 | buggy_48.sol |
4,366 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_23.sol |
12,841 | function play_TOD25(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD25 = msg.sender;
}
} | 4 | buggy_47.sol |
20,667 | function totalSupply() public view returns (uint256); | 0 | buggy_12.sol |
6,451 | function withdraw_intou33() public {
require(now > lockTime_intou33[msg.sender]);
uint transferValue_intou33 = 10;
msg.sender.transfer(transferValue_intou33);
} | 2 | buggy_16.sol |
8,269 | function renounceOwnership() public; | 0 | buggy_22.sol |
24,005 | function bug_unchk_send8() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_9.sol |
1,090 | function transfer(address to, uint256 value) external returns (bool); | 0 | buggy_23.sol |
16,638 | function buyTicket_re_ent2() public{
if (!(lastPlayer_re_ent2.send(jackpot_re_ent2)))
revert();
lastPlayer_re_ent2 = msg.sender;
jackpot_re_ent2 = address(this).balance;
} | 5 | buggy_45.sol |
20,370 | function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}} | 6 | buggy_9.sol |
24,428 | function transferFrom(address from, address to, uint256 tokens) public returns (bool success); | 0 | buggy_16.sol |
18,485 | function approve(address spender, uint tokens) public returns(bool success); | 0 | buggy_18.sol |
1,371 | function _start() internal
{
emit Started();
stopped = false;
} | 0 | buggy_7.sol |
18,344 | function bug_tmstmp40 () public payable {
uint pastBlockTime_tmstmp40; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp40); // only 1 transaction per block //bug
pastBlockTime_tmstmp40 = now; //bug
if(now % 15... | 6 | buggy_30.sol |
4,646 | function transferOwnership(address newOwner) external onlyOwner
{
_transferOwnership(newOwner);
} | 0 | buggy_7.sol |
19,499 | 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... | 6 | buggy_20.sol |
7,538 | function _startNewMiningEpoch() internal {
//if max supply for the era will be exceeded next reward round then enter the new era before that happens
//40 is the final reward era, almost all tokens minted
//once the final era is reached, more tokens will not be given out because the assert fu... | 0 | buggy_18.sol |
21,208 | function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_19.sol |
14,083 | function play_TOD1(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD1 = msg.sender;
}
} | 4 | buggy_16.sol |
8,880 | function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_45.sol |
3,196 | function withdraw_intou33() public {
require(now > lockTime_intou33[msg.sender]);
uint transferValue_intou33 = 10;
msg.sender.transfer(transferValue_intou33);
} | 2 | buggy_31.sol |
22,543 | function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
retur... | 0 | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol |
12,200 | contract Ownable {
bool claimed_TOD24 = false;
address payable owner_TOD24;
uint256 reward_TOD24;
function setReward_TOD24() public payable {
require (!claimed_TOD24);
require(msg.sender == owner_TOD24);
owner_TOD24.transfer(reward_TOD24);
reward_TOD24 = msg.value;
}
function ... | 4 | buggy_34.sol |
18,368 | function _addMinter(address account) internal {
_minters.add(account);
emit MinterAdded(account);
} | 0 | buggy_30.sol |
23,533 | function bug_unchk_send14() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_40.sol |
11,202 | function getReward_TOD25() payable public{
winner_TOD25.transfer(msg.value);
} | 4 | buggy_33.sol |
6,182 | function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
} | 0 | buggy_11.sol |
20,473 | function play_tmstmp26(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp26 = msg.sender;}} | 6 | buggy_38.sol |
4,978 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_20.sol |
9,934 | function unhandledsend_unchk26(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_28.sol |
2,014 | function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public {
require(tx.origin == owner_txorigin39);
to.call.value(amount);
} | 1 | buggy_44.sol |
19,294 | function play_tmstmp2(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp2 = msg.sender;}} | 6 | buggy_7.sol |
20,532 | function play_tmstmp11(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp11 = msg.sender;}} | 6 | buggy_11.sol |
20,193 | 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 == ... | 6 | buggy_43.sol |
19,853 | function collectPlayerWinnings() public byPlayer inState(State.PLAYERS_WIN){
if(guesses[result].players[msg.sender] == PaidStatus.NOT_PAID){
guesses[result].players[msg.sender] = PaidStatus.PAID;
msg.sender.transfer(splitJackpot);
} else revert();
} | 0 | buggy_45.sol |
23,619 | 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_43.sol |
8,353 | function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_7.sol |
8,125 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_23.sol |
7,173 | function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_24.sol |
9,804 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_17.sol |
20,202 | function setMetadata(bytes memory metadata) public {
// only active operator or creator
require(Template.isCreator(msg.sender) || Operated.isActiveOperator(msg.sender), "only active operator or creator");
// set metadata
EventMetadata._setMetadata(metadata);
} | 0 | buggy_43.sol |
14,565 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_14.sol |
14,491 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_28.sol |
14,075 | function claimReward_TOD40(uint256 submission) public {
require (!claimed_TOD40);
require(submission < 10);
msg.sender.transfer(reward_TOD40);
claimed_TOD40 = true;
} | 4 | buggy_16.sol |
21,135 | 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 == ... | 6 | buggy_14.sol |
18,184 | contract FomoFeast {
/**
* MATH
*/
using SafeMath for uint256;
struct User {
uint256 totalInvestCount;
uint256 totalInvestAmount;
uint256 totalStaticCommissionWithdrawAmount;
uint256 totalDynamicCommissionWithdrawAmount;
uint256 totalWithdrawAmount;
... | 6 | buggy_24.sol |
24,540 | constructor() TokenERC20(_tokenName, _tokenSymbol, _decimals) public {
/*Wallet A */
frozenAddresses.push(address(0x9fd50776F133751E8Ae6abE1Be124638Bb917E05));
frozenWallets[frozenAddresses[0]] = frozenWallet({
isFrozen: true,
rewardedAmount: 30000000 * 10 ** uint256(decimals),
frozenAm... | 0 | buggy_17.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.