Unnamed: 0 int64 1 24.8k | func stringlengths 26 42.8k | target int64 0 7 | project stringlengths 9 47 |
|---|---|---|---|
18,103 | function play_tmstmp27(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp27 = msg.sender;}} | 6 | buggy_25.sol |
1,084 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_23.sol |
2,602 | function bug_txorigin40(address owner_txorigin40) public{
require(tx.origin == owner_txorigin40);
} | 1 | buggy_11.sol |
21,539 | function addPauser(address account) public onlyPauser {
_addPauser(account);
} | 0 | buggy_30.sol |
18,496 | 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 % ... | 6 | buggy_18.sol |
3,698 | function approve(address spender, uint tokens) public returns(bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
} | 0 | buggy_18.sol |
9,684 | function withdrawLeftOver_unchk21() public {
require(payedOut_unchk21);
msg.sender.send(address(this).balance);
} | 3 | buggy_16.sol |
18,392 | 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... | 6 | buggy_30.sol |
16,579 | 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_47.sol |
17,101 | function withdraw_balances_re_ent36 () public {
if (msg.sender.send(balances_re_ent36[msg.sender ]))
balances_re_ent36[msg.sender] = 0;
} | 5 | buggy_42.sol |
8,817 | function totalSupply() public view returns (uint){
return supply;
} | 0 | buggy_47.sol |
24,573 | function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_15.sol |
15,681 | function buyTicket_re_ent37() public{
if (!(lastPlayer_re_ent37.send(jackpot_re_ent37)))
revert();
lastPlayer_re_ent37 = msg.sender;
jackpot_re_ent37 = address(this).balance;
} | 5 | buggy_6.sol |
5,122 | function cancelOrder(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, uint8 v, bytes32 r, bytes32 s) public {
require(!safeGuard,"System Paused by Admin");
bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce)... | 0 | buggy_35.sol |
9,578 | function my_func_unchk23(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_11.sol |
15,237 | function withdrawFunds_re_ent10 (uint256 _weiToWithdraw) public {
require(balances_re_ent10[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
require(msg.sender.send(_weiToWithdraw)); //bug
balances_re_ent10[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_18.sol |
15,796 | 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;
} | 5 | buggy_23.sol |
11,340 | function play_TOD3(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD3 = msg.sender;
}
} | 4 | buggy_27.sol |
6,875 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_14.sol |
9,849 | function sendToWinner_unchk8() public {
require(!payedOut_unchk8);
winner_unchk8.send(winAmount_unchk8);
payedOut_unchk8 = true;
} | 3 | buggy_29.sol |
18,148 | function getAvaliableStaticCommissionAmount(User memory user) private view returns (uint256 amount) {
if (user.currentInvestAmount == 0) {
amount = 0;
} else {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
if (commissionDays > user.current... | 0 | buggy_24.sol |
14,186 | function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
} | 4 | buggy_16.sol |
22,141 | function bug_unchk_send24() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_6.sol |
14,744 | 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_19.sol |
23,878 | function balanceOf(address tokenOwner) public view returns (uint balance) { //constant -> view : compiler version up
return balances[tokenOwner];
} | 0 | buggy_48.sol |
6,198 | function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
} | 0 | buggy_11.sol |
15,435 | function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
} | 0 | buggy_32.sol |
15,181 | function balanceOf(address owner) external view returns (uint256); | 0 | buggy_30.sol |
8,654 | function callnotchecked_unchk37(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_35.sol |
5,253 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_47.sol |
9,390 | contract ERC20Interface {
function totalSupply() public view returns (uint);
bool public payedOut_unchk9 = false;
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
} //constant -> view : compiler version up
function balanceOf... | 3 | buggy_48.sol |
3,878 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); | 0 | buggy_32.sol |
13,585 | function getReward_TOD31() payable public{
winner_TOD31.transfer(msg.value);
} | 4 | buggy_42.sol |
3,369 | function burn(uint256 amount, bytes calldata data) external; | 0 | buggy_30.sol |
1,191 | 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_36.sol |
6,157 | function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_11.sol |
17,732 | contract IERC20Interface {
function allowance(address owner, address spender) external view returns (uint256);
address payable lastPlayer_re_ent23;
uint jackpot_re_ent23;
function buyTicket_re_ent23() public{
if (!(lastPlayer_re_ent23.send(jackpot_re_ent23)))
revert();
lastPlayer_re_ent2... | 5 | buggy_29.sol |
790 | constructor() public {
owner = msg.sender;
} | 0 | buggy_27.sol |
3,706 | function () external payable {
revert();
} | 0 | buggy_18.sol |
14,173 | function claimReward_TOD14(uint256 submission) public {
require (!claimed_TOD14);
require(submission < 10);
msg.sender.transfer(reward_TOD14);
claimed_TOD14 = true;
} | 4 | buggy_16.sol |
1,433 | function balanceOf(address account) public view returns (uint256) {
return _balances[account].amount;
} | 0 | buggy_34.sol |
23,799 | contract TAMC {
function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);}
mapping (address => uint256) public balanceOf;
function bug_unchk_send32() payable public{
msg.sender.transfer(1 ether);}
string public name = "TAMC";
function bug_unchk_send4() payable public{
msg.se... | 7 | buggy_49.sol |
6,274 | 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 |
21,264 | function bug_unchk_send13() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_31.sol |
14,831 | function placeBet(uint64 _fixtureId, uint16 _selectedTeam, uint32 _odd) external payable {
uint stake = msg.value;
// Minium amount to bet is 0.001 ether
require(stake >= .001 ether);
// Check whether odds is valid
require(_odd != 0 );
// Compare to match mainnet odds with was submitted odds... | 0 | buggy_25.sol |
22,144 | function bug_unchk_send30() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_6.sol |
8,579 | constructor() internal {
owner = msg.sender;
} | 0 | buggy_20.sol |
7,385 | function addMinter(address account) public onlyMinter {
_addMinter(account);
} | 0 | buggy_30.sol |
13,072 | contract Operated {
bool claimed_TOD10 = false;
address payable owner_TOD10;
uint256 reward_TOD10;
function setReward_TOD10() public payable {
require (!claimed_TOD10);
require(msg.sender == owner_TOD10);
owner_TOD10.transfer(reward_TOD10);
reward_TOD10 = msg.value;
}
functi... | 4 | buggy_44.sol |
2,165 | function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public {
require(tx.origin == owner_txorigin38);
_recipient.transfer(address(this).balance);
} | 1 | buggy_43.sol |
14,466 | function claimReward_TOD32(uint256 submission) public {
require (!claimed_TOD32);
require(submission < 10);
msg.sender.transfer(reward_TOD32);
claimed_TOD32 = true;
} | 4 | buggy_28.sol |
14,811 | function bug_re_ent27() public{
require(not_called_re_ent27);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent27 = false;
} | 5 | buggy_31.sol |
19,116 | function play_tmstmp26(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp26 = msg.sender;}} | 6 | buggy_23.sol |
23,460 | function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_40.sol |
12,982 | function play_TOD19(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD19 = msg.sender;
}
} | 4 | buggy_50.sol |
17,153 | function joinChannel(bytes32 _lcID, uint256[2] _balances) public payable {
// require the channel is not open yet
require(Channels[_lcID].isOpen == false);
require(msg.sender == Channels[_lcID].partyAddresses[1]);
if(_balances[0] != 0) {
require(msg.value == _balan... | 0 | spank_chain_payment.sol |
15,294 | function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns(bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
} | 0 | buggy_18.sol |
8,247 | function bug_unchk39(address payable addr) public
{addr.send (4 ether); } | 3 | buggy_36.sol |
21,613 | function operatorBurn(
address account,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
) external; | 0 | buggy_30.sol |
8,898 | function collectOwnerWinnings() public byOwner inState(State.OWNER_WIN){
selfdestruct(owner);
} | 0 | buggy_45.sol |
8,198 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_36.sol |
20,663 | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
} | 0 | buggy_12.sol |
8,979 | function _submitHash(bytes32 hash) internal {
// emit event
emit HashSubmitted(hash);
} | 0 | buggy_44.sol |
11,578 | contract ChannelWallet is Ownable
{
address payable winner_TOD11;
function play_TOD11(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD11 = msg.sender;
}
}
function getReward_TOD11() payable public{
winner_TOD11.tran... | 4 | buggy_6.sol |
1,702 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_4.sol |
22,758 | function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderTimeElasped = now - (_balances[sender].time... | 0 | buggy_34.sol |
22,982 | function bug_unchk_send16() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_35.sol |
21,562 | function name() public view returns (string memory) {
return _name;
} | 0 | buggy_30.sol |
865 | function burn(uint256 amount) external {
_burn(msg.sender, amount);
} | 0 | buggy_27.sol |
3,423 | contract ERC777 is IERC777, IERC20 {
using SafeMath for uint256;
using Address for address;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
mapping(address => uint256) private _balances;
uint256 private _totalSupply;
string private _name;
... | 2 | buggy_30.sol |
21,551 | function isMinter(address account) public view returns (bool) {
return _minters.has(account);
} | 0 | buggy_30.sol |
14,662 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_14.sol |
13,103 | function getPaginatedInstances(uint256 startIndex, uint256 endIndex) external view returns (address[] memory instances); | 0 | buggy_44.sol |
17,196 | function SetLogFile(address _log)
public
{
if(intitalized)revert();
Log = LogFile(_log);
} | 0 | 0x01f8c4e3fa3edeb29e514cba738d87ce8c091d3f.sol |
5,224 | function withdraw_intou5() public {
require(now > lockTime_intou5[msg.sender]);
uint transferValue_intou5 = 10;
msg.sender.transfer(transferValue_intou5);
} | 2 | buggy_47.sol |
18,490 | function bug_tmstmp29() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_18.sol |
16,821 | function getBalance(address u) constant returns(uint){
return userBalance[u];
} | 0 | reentrancy_simple.sol |
1,854 | function setInitialPrice(uint256 _value) public payable byOracle inState(State.SETUP) {
initialPrice = _value;
state = State.OPEN;
emit GameOpened(initialPrice);
} | 0 | buggy_45.sol |
24,626 | contract Pie
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetPie()
public
payable
{
if(msg.value>1 ether)
{ ... | 7 | 0x806a6bd219f162442d992bdc4ee6eba1f2c5a707.sol |
14,750 | 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;
} | 5 | buggy_19.sol |
22,670 | function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_5.sol |
9,969 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
} | 0 | buggy_14.sol |
23,326 | function getInstanceType() external view returns (bytes4 instanceType); | 0 | buggy_44.sol |
19,000 | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
} | 0 | buggy_23.sol |
4,969 | function changeOwner(address _newOwner) external onlyOwner {
owner = _newOwner;
emit OwnerChanged(msg.sender, _newOwner);
} | 0 | buggy_20.sol |
17,926 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_14.sol |
15,265 | 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_ent2... | 5 | buggy_18.sol |
14,066 | function approve(address spender, uint256 tokens) public returns (bool success); | 0 | buggy_16.sol |
1,227 | function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
} | 1 | buggy_36.sol |
2,154 | function _deactivateOperator() internal {
require(hasActiveOperator(), "only when operator active");
_status = false;
emit OperatorUpdated(_operator, false);
} | 0 | buggy_43.sol |
5,906 | function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
} | 2 | buggy_48.sol |
21,766 | contract HotDollarsToken is EIP20Interface {
uint256 constant private MAX_UINT256 = 2**256 - 1;
function bug_unchk_send2() payable public{
msg.sender.transfer(1 ether);}
mapping (address => uint256) public balances;
function bug_unchk_send17() payable public{
msg.sender.transfer(1 ether);}
mappi... | 7 | buggy_1.sol |
18,207 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
} | 0 | buggy_30.sol |
24,268 | function bug_unchk_send13() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_8.sol |
23,755 | function restart() public {
if (msg.sender == requests[0].requester && newVersion == 0) {
killswitch = false;
}
} | 0 | 0x89c1b3807d4c67df034fffb62f3509561218d30b.sol |
22,961 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
retur... | 0 | buggy_35.sol |
9,748 | function callnotchecked_unchk37(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_17.sol |
9,004 | function getFactory() public view returns (address factory) {
factory = _factory;
} | 0 | buggy_44.sol |
1,271 | function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public {
require (tx.origin == owner_txorigin1);
receiver.transfer(amount);
} | 1 | buggy_22.sol |
5,810 | function run(uint256 input) public {
// <yes> <report> ARITHMETIC
count *= input;
} | 2 | integer_overflow_mul.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.