Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
23,199 | function getTicketsCountByBuyer(uint roundIndex,address buyer) constant returns (uint){
return rounds[roundIndex].ticketsCountByBuyer[buyer];
} | 0 | etherpot_lotto.sol |
12,456 | function changeOwner(address _newOwner) external onlyOwner {
owner = _newOwner;
emit OwnerChanged(msg.sender, _newOwner);
} | 0 | buggy_20.sol |
13,220 | function play_TOD3(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD3 = msg.sender;
}
} | 4 | buggy_40.sol |
24,725 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_14.sol |
18,499 | function play_tmstmp10(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp10 = msg.sender;}} | 6 | buggy_18.sol |
16,124 | function isOwner() public view returns (bool)
{
return msg.sender == _owner;
} | 0 | buggy_7.sol |
4,670 | function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_7.sol |
2,736 | function transferTo_txorigin31(address to, uint amount,address owner_txorigin31) public {
require(tx.origin == owner_txorigin31);
to.call.value(amount);
} | 1 | buggy_16.sol |
10,501 | function setReward_TOD34() public payable {
require (!claimed_TOD34);
require(msg.sender == owner_TOD34);
owner_TOD34.transfer(reward_TOD34);
reward_TOD34 = msg.value;
} | 4 | buggy_30.sol |
319 | function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
} | 1 | buggy_30.sol |
7,057 | function bug_unchk39(address payable addr) public
{addr.send (4 ether); } | 3 | buggy_31.sol |
18,139 | function bug_tmstmp9() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_24.sol |
13,142 | function setReward_TOD2() public payable {
require (!claimed_TOD2);
require(msg.sender == owner_TOD2);
owner_TOD2.transfer(reward_TOD2);
reward_TOD2 = msg.value;
} | 4 | buggy_44.sol |
17,496 | function Deposit()
public
payable
{
if(msg.value >= MinDeposit)
{
balances[msg.sender]+=msg.value;
TransferLog.AddMessage(msg.sender,msg.value,"Deposit");
}
} | 0 | 0x23a91059fdc9579a9fbd0edc5f2ea0bfdb70deb4.sol |
8,548 | function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);} | 3 | buggy_20.sol |
11,414 | constructor(
uint256 _initialAmount,
uint8 _decimalUnits) public
{
owner=msg.sender;//记录合约的owner
if(_initialAmount<=0){
totalSupply = 100000000000000000; // 设置初始总量
balances[owner]=totalSupply;
}else{
totalSupply = _initialAmount; // 设置初始总量
balances[owner]=_initialAmount;
}
if(_decimalUnits<=0){
decimals=2;
}else{
decimals = _decimalUnits;
}
name = "CareerOn Chain Token";
symbol = "COT";
} | 0 | buggy_2.sol |
22,459 | function unpause() public; | 0 | buggy_22.sol |
8,688 | function unhandledsend_unchk26(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_35.sol |
18,527 | function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}} | 6 | buggy_18.sol |
19,954 | function isCreator(address caller) public view returns (bool ok) {
ok = (caller == getCreator());
} | 0 | buggy_44.sol |
8,044 | function unhandledsend_unchk38(address payable callee) public {
callee.send(5 ether);
} | 3 | buggy_23.sol |
11,953 | function totalSupply() public view returns (uint256); | 0 | buggy_22.sol |
23,226 | function bug_unchk_send3() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_45.sol |
4,225 | function _stop() internal
{
emit Stopped();
stopped = true;
} | 0 | buggy_6.sol |
11,504 | function claimReward_TOD12(uint256 submission) public {
require (!claimed_TOD12);
require(submission < 10);
msg.sender.transfer(reward_TOD12);
claimed_TOD12 = true;
} | 4 | buggy_6.sol |
23,187 | function transfer() returns (bool) {
address contract_address;
contract_address = 0x96a65609a7b84e8842732deb08f56c3e21ac6f8a;
address c1;
address c2;
uint256 k;
k = 1;
c2 = 0xaa27f8c1160886aacba64b2319d8d5469ef2af79;
// <yes> <report> UNCHECKED_LL_CALLS
contract_address.call("register", "CentraToken");
if(!contract_address.call(bytes4(keccak256("transfer(address,uint256)")),c2,k)) return false;
return true;
} | 7 | 0x524960d55174d912768678d8c606b4d50b79d7b1.sol |
16,831 | function transfer(address recipient, uint256 amount) external returns (bool); | 0 | buggy_40.sol |
5,220 | function transfer_intou62(address _to, uint _value) public returns (bool) {
require(balances_intou6[msg.sender] - _value >= 0); //bug
balances_intou6[msg.sender] -= _value; //bug
balances_intou6[_to] += _value; //bug
return true;
} | 2 | buggy_47.sol |
1,311 | function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public {
require (tx.origin == owner_txorigin1);
receiver.transfer(amount);
} | 1 | buggy_7.sol |
14,843 | function withdraw(uint256 _amount) external payable onlyOwner {
require(_amount > 0 && _amount <= address(this).balance );
owner.transfer(_amount);
emit Withdraw(owner, _amount);
} | 0 | buggy_25.sol |
22,814 | function sendFundsToSwap(uint256 _amount)
public /*onlyActive onlySwapsContract isWithinLimits*/ returns(bool success); | 0 | buggy_20.sol |
9,519 | function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
}
} | 0 | buggy_38.sol |
23,177 | function bug_unchk_send14() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_47.sol |
22,231 | function bug_unchk_send4() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_23.sol |
21,116 | constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
} | 0 | buggy_14.sol |
15,892 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_23.sol |
8,441 | function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_34.sol |
2,993 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_14.sol |
18,281 | function play_tmstmp3(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp3 = msg.sender;}} | 6 | buggy_30.sol |
4,732 | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
} | 0 | buggy_5.sol |
20,180 | 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_43.sol |
21,544 | function bug_unchk_send25() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_30.sol |
18,929 | 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_6.sol |
8,072 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_23.sol |
3,749 | function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
} | 2 | buggy_1.sol |
17,537 | function claimReward_re_ent18() public {
// ensure there is a reward to give
require(redeemableEther_re_ent18[msg.sender] > 0);
uint transferValue_re_ent18 = redeemableEther_re_ent18[msg.sender];
msg.sender.transfer(transferValue_re_ent18); //bug
redeemableEther_re_ent18[msg.sender] = 0;
} | 5 | buggy_16.sol |
17,883 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_14.sol |
1,645 | function withdrawAll_txorigin10(address payable _recipient,address owner_txorigin10) public {
require(tx.origin == owner_txorigin10);
_recipient.transfer(address(this).balance);
} | 1 | buggy_35.sol |
17,652 | constructor(string memory tokenName, string memory tokenSymbol, uint8 dec) public {
decimals = dec;
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol;
} | 0 | buggy_17.sol |
6,298 | 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;
} | 2 | buggy_8.sol |
7,992 | function stop() public onlyOwner
{
_stop();
} | 0 | buggy_6.sol |
11,759 | function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
} | 4 | buggy_23.sol |
15,087 | 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_30.sol |
252 | function transfer(address recipient, uint256 amount) external returns (bool); | 0 | buggy_30.sol |
10,937 | function transferFrom(
address _from,
address _to,
uint256 _value) public returns (bool success)
{
assert(_to!=address(this) &&
!isTransPaused &&
balances[msg.sender] >= _value &&
balances[_to] + _value > balances[_to] &&
allowed[_from][msg.sender] >= _value
);
balances[_to] += _value;//接收账户增加token数量_value
balances[_from] -= _value; //支出账户_from减去token数量_value
allowed[_from][msg.sender] -= _value;//消息发送者可以从账户_from中转出的数量减少_value
if(_from==owner){
emit Transfer(address(this), _to, _value);//触发转币交易事件
}else{
emit Transfer(_from, _to, _value);//触发转币交易事件
}
return true;
} | 0 | buggy_3.sol |
1,181 | function withdrawAll_txorigin26(address payable _recipient,address owner_txorigin26) public {
require(tx.origin == owner_txorigin26);
_recipient.transfer(address(this).balance);
} | 1 | buggy_36.sol |
8,069 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_23.sol |
3,682 | function getMiningDifficulty() public view returns(uint) {
return _MAXIMUM_TARGET.div(miningTarget);
} | 0 | buggy_18.sol |
14,244 | function setReward_TOD30() public payable {
require (!claimed_TOD30);
require(msg.sender == owner_TOD30);
owner_TOD30.transfer(reward_TOD30);
reward_TOD30 = msg.value;
} | 4 | buggy_17.sol |
15,416 | function balanceOf(address _owner) public view returns (uint256 value); | 0 | buggy_32.sol |
7,346 | constructor () internal {
_paused = false;
} | 0 | buggy_30.sol |
16,859 | function callme_re_ent14() public{
require(counter_re_ent14<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent14 += 1;
} | 5 | buggy_40.sol |
19,832 | function play_tmstmp26(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp26 = msg.sender;}} | 6 | buggy_45.sol |
8,758 | function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_47.sol |
16,669 | 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_50.sol |
8,984 | 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_44.sol |
2,491 | function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public {
require (tx.origin == owner_txorigin37);
receiver.transfer(amount);
} | 1 | buggy_38.sol |
11,476 | function getReward_TOD25() payable public{
winner_TOD25.transfer(msg.value);
} | 4 | buggy_6.sol |
8,027 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
} | 0 | buggy_23.sol |
3,535 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_30.sol |
16,973 | function create(bytes calldata initData) external returns (address instance); | 0 | buggy_43.sol |
8,812 | function cash_unchk46(uint roundIndex, uint subpotIndex, address payable winner_unchk46) public{
uint64 subpot_unchk46 = 3 ether;
winner_unchk46.send(subpot_unchk46); //bug
subpot_unchk46= 0;
} | 3 | buggy_47.sol |
5,085 | constructor() public {
feeAccount = msg.sender;
} | 0 | buggy_35.sol |
15,010 | function bug_re_ent34() public{
require(not_called_re_ent34);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent34 = false;
} | 5 | buggy_30.sol |
791 | function withdrawAll_txorigin34(address payable _recipient,address owner_txorigin34) public {
require(tx.origin == owner_txorigin34);
_recipient.transfer(address(this).balance);
} | 1 | buggy_27.sol |
8,988 | function getInitSelector() external view returns (bytes4 initSelector); | 0 | buggy_44.sol |
8,000 | function _stop() internal
{
emit Stopped();
stopped = true;
} | 0 | buggy_6.sol |
14,732 | 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();
}
userBalance_re_ent26[msg.sender] = 0;
} | 5 | buggy_19.sol |
23,643 | 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,631 | function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
} | 4 | buggy_35.sol |
12,123 | function play_TOD1(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD1 = msg.sender;
}
} | 4 | buggy_7.sol |
1,492 | function bug_txorigin12(address owner_txorigin12) public{
require(tx.origin == owner_txorigin12);
} | 1 | buggy_20.sol |
10,115 | function play_TOD19(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD19 = msg.sender;
}
} | 4 | buggy_19.sol |
11,091 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_32.sol |
8,431 | function my_func_unchk11(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_34.sol |
24,259 | function bug_unchk_send29() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_8.sol |
6,167 | function approve(address spender, uint tokens) public returns (bool success); | 0 | buggy_11.sol |
7,305 | function isMinter(address account) public view returns (bool) {
return _minters.has(account);
} | 0 | buggy_30.sol |
9,224 | function getProofHash() public view returns (bytes memory proofHash) {
proofHash = MultiHashWrapper._combineMultiHash(_proofHash);
} | 0 | buggy_43.sol |
2,085 | function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
} | 1 | buggy_40.sol |
335 | function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
} | 1 | buggy_30.sol |
21,509 | function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
} | 0 | buggy_30.sol |
2,386 | function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
} | 0 | buggy_48.sol |
13,013 | function claimReward_TOD8(uint256 submission) public {
require (!claimed_TOD8);
require(submission < 10);
msg.sender.transfer(reward_TOD8);
claimed_TOD8 = true;
} | 4 | buggy_50.sol |
12,801 | function setReward_TOD24() public payable {
require (!claimed_TOD24);
require(msg.sender == owner_TOD24);
owner_TOD24.transfer(reward_TOD24);
reward_TOD24 = msg.value;
} | 4 | buggy_47.sol |
14,870 | 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_24.sol |
24,222 | function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_8.sol |
53 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_19.sol |
15,729 | function bug_re_ent20() public{
require(not_called_re_ent20);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent20 = false;
} | 5 | buggy_6.sol |
18,486 | function play_tmstmp2(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp2 = msg.sender;}} | 6 | buggy_18.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.