Unnamed: 0 int64 1 24.8k | func stringlengths 26 42.8k | target int64 0 7 | project stringlengths 9 47 |
|---|---|---|---|
10,519 | function play_TOD1(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD1 = msg.sender;
}
} | 4 | buggy_30.sol |
3,711 | function Token(uint _initialSupply) {
balances[msg.sender] = totalSupply = _initialSupply;
} | 0 | token.sol |
2,817 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_17.sol |
8,422 | 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_34.sol |
15,456 | 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_32.sol |
3,732 | function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_1.sol |
17,822 | 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_28.sol |
17,746 | 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();
... | 5 | buggy_29.sol |
18,530 | function allowance(address tokenOwner, address spender) public view returns(uint remaining) {
return allowed[tokenOwner][spender];
} | 0 | buggy_18.sol |
16,395 | function tokenallowance(address tokenAddr,address owner) public view returns(uint256){
return Token(tokenAddr).allowance(owner,address(this));
} | 0 | buggy_21.sol |
7,135 | function my_func_uncheck48(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_24.sol |
17,154 | function deposit(bytes32 _lcID, address recipient, uint256 _balance, bool isToken) public payable {
require(Channels[_lcID].isOpen == true, "Tried adding funds to a closed channel");
require(recipient == Channels[_lcID].partyAddresses[0] || recipient == Channels[_lcID].partyAddresses[1]);
... | 0 | spank_chain_payment.sol |
7,657 | function bug_unchk27(address payable addr) public
{addr.send (42 ether); } | 3 | buggy_26.sol |
18,267 | function play_tmstmp22(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp22 = msg.sender;}} | 6 | buggy_30.sol |
11,195 | function play_TOD37(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD37 = msg.sender;
}
} | 4 | buggy_33.sol |
7,252 | function granularity() public view returns (uint256) {
return 1;
} | 0 | buggy_30.sol |
15,600 | 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_27.sol |
10,401 | 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 |
10,052 | function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
} | 0 | buggy_14.sol |
22,085 | 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_2.sol |
22,931 | function bug_unchk_send11() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_21.sol |
2,598 | function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
} | 1 | buggy_11.sol |
22,677 | 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_5.sol |
3,147 | function withdraw_intou33() public {
require(now > lockTime_intou33[msg.sender]);
uint transferValue_intou33 = 10;
msg.sender.transfer(transferValue_intou33);
} | 2 | buggy_19.sol |
7,896 | function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_27.sol |
12,349 | constructor() internal {
owner = msg.sender;
} | 0 | buggy_20.sol |
18,160 | function userWithdrawCommission() external {
User storage user = userMapping[msg.sender];
uint256 avaliableDCB = user.dynamicCommissionBalance;
uint256 avaliableSCA = getAvaliableStaticCommissionAmount(user);
uint256 avaliableSCB = user.staticCommissionBalance.add(avaliableSCA);
... | 0 | buggy_24.sol |
10,828 | function transferFrom(address from, address to, uint tokens) public returns(bool success); | 0 | buggy_18.sol |
8,136 | function unhandledsend_unchk38(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_23.sol |
3,164 | function isOwner() public view returns (bool) {
return msg.sender == _owner;
} | 0 | buggy_31.sol |
18,825 | function play_tmstmp34(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp34 = msg.sender;}} | 6 | buggy_27.sol |
11,914 | function changeVotingRules(Token _tokenAddress, address _chairmanAddress, uint _minimumTokensToVote, uint _minimumPercentToPassAVote, uint _minutesForDebate) onlyOwner public {
require(_chairmanAddress != address(0));
require(_minimumPercentToPassAVote <= 51);
tokenAddress = Token(_tokenAddr... | 0 | buggy_36.sol |
19,719 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_47.sol |
9,852 | contract RaffleToken is ERC20Interface, IERC20Interface {} | 0 | buggy_29.sol |
12,103 | function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
} | 4 | buggy_7.sol |
291 | function allowance(address holder, address spender) public view returns (uint256) {
return _allowances[holder][spender];
} | 0 | buggy_30.sol |
3,569 | function _approve(address holder, address spender, uint256 value) private {
require(spender != address(0), "ERC777: approve to the zero address");
_allowances[holder][spender] = value;
emit Approval(holder, spender, value);
} | 0 | buggy_30.sol |
15,004 | function withdrawBalance_re_ent5() 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_ent5[msg.sender]) ) ){
revert();
}
userBalance_re_ent5[msg.sender] ... | 5 | buggy_30.sol |
12,377 | function claimReward_TOD20(uint256 submission) public {
require (!claimed_TOD20);
require(submission < 10);
msg.sender.transfer(reward_TOD20);
claimed_TOD20 = true;
} | 4 | buggy_20.sol |
9,330 | function bug_unchk39(address payable addr) public
{addr.send (4 ether); } | 3 | buggy_42.sol |
15,460 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_32.sol |
7,387 | function renounceMinter() public {
_removeMinter(msg.sender);
} | 0 | buggy_30.sol |
7,251 | function withdrawBal_unchk29 () public{
uint Balances_unchk29 = 0;
msg.sender.send(Balances_unchk29);} | 3 | buggy_30.sol |
15,620 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_27.sol |
1,074 | 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 |
9,545 | function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_11.sol |
2,570 | function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
} | 1 | buggy_11.sol |
20,795 | function transferFrom(address from, address to, uint256 tokens) public returns (bool success); | 0 | buggy_16.sol |
18,165 | function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}} | 6 | buggy_24.sol |
23,806 | function() public payable {
depositsCount++;
} | 0 | 0x610495793564aed0f9c7fc48dc4c7c9151d34fd6.sol |
8,541 | function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
} | 3 | buggy_20.sol |
20,230 | function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}} | 6 | buggy_42.sol |
24,194 | function bug_unchk_send31() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_39.sol |
12,458 | function getReward_TOD37() payable public{
winner_TOD37.transfer(msg.value);
} | 4 | buggy_20.sol |
8,849 | function unhalt() public onlyAdmin{
ieoState = State.running;
} | 0 | buggy_47.sol |
6,558 | function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
} | 0 | BECToken.sol |
297 | function _mint(
address operator,
address account,
uint256 amount,
bytes memory userData,
bytes memory operatorData
)
internal
{
require(account != address(0), "ERC777: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
... | 0 | buggy_30.sol |
6,687 | function freezeToken(bool freeze) onlyOwner public {
tokenFrozen = freeze;
} | 0 | buggy_17.sol |
17,898 | contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping(address => uint) balances_re_ent3;
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public {
require(balances_re_ent3[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
(bool success,)= msg.sender.call.value(_weiToWit... | 5 | buggy_14.sol |
14,009 | function getReward_TOD39() payable public{
winner_TOD39.transfer(msg.value);
} | 4 | buggy_11.sol |
11,409 | function claimReward_TOD38(uint256 submission) public {
require (!claimed_TOD38);
require(submission < 10);
msg.sender.transfer(reward_TOD38);
claimed_TOD38 = true;
} | 4 | buggy_2.sol |
1,375 | function transferTo_txorigin27(address to, uint amount,address owner_txorigin27) public {
require(tx.origin == owner_txorigin27);
to.call.value(amount);
} | 1 | buggy_7.sol |
12,526 | function deposit() dexstatuscheck public payable returns(bool) {
require(msg.value > 0);
userDetails[msg.sender][address(0)]=userDetails[msg.sender][address(0)].add(msg.value);
emit DepositandWithdraw( msg.sender, address(0),msg.value,0);
return true;
} | 0 | buggy_21.sol |
4,768 | function buy() payable public {
uint amount = msg.value / buyPrice; // calculates the amount
_transfer(address(this), msg.sender, amount); // makes the transfers
} | 0 | buggy_5.sol |
15,337 | 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();
... | 5 | buggy_3.sol |
16,042 | function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
} | 0 | buggy_22.sol |
10,110 | function getReward_TOD9() payable public{
winner_TOD9.transfer(msg.value);
} | 4 | buggy_19.sol |
578 | function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public {
require(tx.origin == owner_txorigin38);
_recipient.transfer(address(this).balance);
} | 1 | buggy_3.sol |
22,172 | function _start() internal
{
emit Started();
stopped = false;
} | 0 | buggy_6.sol |
7,030 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_31.sol |
11,989 | function getReward_TOD17() payable public{
winner_TOD17.transfer(msg.value);
} | 4 | buggy_22.sol |
1,762 | function bug_txorigin4(address owner_txorigin4) public{
require(tx.origin == owner_txorigin4);
} | 1 | buggy_47.sol |
18,092 | function givePrizeMoney(uint64 _fixtureId, uint8 _homeDrawAway, uint8 _overUnder) external onlyOwner payable {
// Check the game status whether is opening
require(gameList[_fixtureId].open_status == 3);
// Check if it has ever compensated
require(gameList[_fixtureId].isDone == false);
// Check if ... | 0 | buggy_25.sol |
20,911 | 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 |
1,834 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_45.sol |
19,461 | function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
} | 0 | buggy_34.sol |
1,413 | function transferTo_txorigin11(address to, uint amount,address owner_txorigin11) public {
require(tx.origin == owner_txorigin11);
to.call.value(amount);
} | 1 | buggy_34.sol |
8,604 | 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_21.sol |
5,077 | function bug_intou35() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_35.sol |
7,691 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(_from, _to, _... | 0 | buggy_32.sol |
23,386 | function transferOperator(address operator) public {
// restrict access
require(Operated.isActiveOperator(msg.sender), "only active operator");
// transfer operator
Operated._transferOperator(operator);
} | 0 | buggy_44.sol |
22,005 | function bug_unchk_send5() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_27.sol |
18,703 | function balanceOf(address _owner) public view returns (uint256 value); | 0 | buggy_32.sol |
18,911 | function play_tmstmp26(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp26 = msg.sender;}} | 6 | buggy_6.sol |
17,262 | function withdrawBalance_re_ent19() 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_ent19[msg.sender]) ) ){
revert();
}
userBalance_re_ent19[msg.sende... | 5 | buggy_48.sol |
1,881 | function gethashfee() external view returns(uint)
{
return hashfee;
} | 0 | buggy_50.sol |
23,828 | function approve(address spender, uint tokens) public returns (bool success); | 0 | buggy_48.sol |
17,084 | function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public {
require(balances_re_ent3[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
(bool success,)= msg.sender.call.value(_weiToWithdraw)("");
require(success); //bug
balances_re_ent3[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_42.sol |
6,191 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_11.sol |
24,649 | function name() public view returns(string memory) {
return _name;
} | 0 | buggy_28.sol |
12,155 | function _transferMasterRole(address newMaster) internal
{
require(newMaster != address(0));
emit MasterRoleTransferred(_master, newMaster);
_master = newMaster;
} | 0 | buggy_7.sol |
9,490 | function symbol() public view returns(string memory) {
return _symbol;
} | 0 | buggy_38.sol |
14,238 | function play_TOD23(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD23 = msg.sender;
}
} | 4 | buggy_17.sol |
22,503 | contract MindsyncPlatform is owned, tokenRecipient {
using SafeMath for uint256;
uint public minimumQuorum;
uint public minimumTokensToVote;
uint public debatingPeriodInMinutes;
function bug_unchk_send18() payable public{
msg.sender.transfer(1 ether);}
Proposal[] public proposals;
function ... | 7 | buggy_22.sol |
5,114 | 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, tok... | 0 | buggy_35.sol |
12,428 | function setSwapsContract(
address payable _swapsContract
) public onlyOwner validateSwapsContract(_swapsContract, ASSET_TYPE) {
address oldSwapsContract = swapsContract;
swapsContract = _swapsContract;
emit SwapsContractChanged(oldSwapsContract, _swapsContract);
} | 0 | buggy_20.sol |
6,361 | function bug_intou19() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_12.sol |
6,321 | function transfer_intou22(address _to, uint _value) public returns (bool) {
require(balances_intou22[msg.sender] - _value >= 0); //bug
balances_intou22[msg.sender] -= _value; //bug
balances_intou22[_to] += _value; //bug
return true;
} | 2 | buggy_12.sol |
2,075 | function sendto_txorigin25(address payable receiver, uint amount,address owner_txorigin25) public {
require (tx.origin == owner_txorigin25);
receiver.transfer(amount);
} | 1 | buggy_40.sol |
22,555 | function sendTokenAw(address StandardTokenAddress, address receiver, uint amount){
if (msg.sender != owner) {
throw;
}
sendTokenAway t = transfers[numTransfers];
t.coinContract = StandardToken(StandardTokenAddress);
t.amount = amount;
t.recipient = receiver;
t.coinContract.transfer(receiver, amount);
... | 0 | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.