Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
7,116 | function withdrawBal_unchk29 () public{
uint Balances_unchk29 = 0;
msg.sender.send(Balances_unchk29);} | 3 | buggy_24.sol |
1,165 | function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
} | 1 | buggy_36.sol |
1,352 | function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public {
require (tx.origin == owner_txorigin37);
receiver.transfer(amount);
} | 1 | buggy_7.sol |
14,170 | function getReward_TOD23() payable public{
winner_TOD23.transfer(msg.value);
} | 4 | buggy_16.sol |
18,572 | function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_1.sol |
2,517 | function _mint(address account, uint256 amount) internal {
require(amount != 0);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
} | 0 | buggy_38.sol |
15,086 | function unpause() public onlyPauser whenPaused {
_paused = false;
emit Unpaused(msg.sender);
} | 0 | buggy_30.sol |
4,336 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_23.sol |
17,748 | function claimReward_re_ent32() public {
// ensure there is a reward to give
require(redeemableEther_re_ent32[msg.sender] > 0);
uint transferValue_re_ent32 = redeemableEther_re_ent32[msg.sender];
msg.sender.transfer(transferValue_re_ent32); //bug
redeemableEther_re_ent32[msg.sender] = 0;
} | 5 | buggy_29.sol |
9,315 | function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_42.sol |
14,940 | function revokeOperator(address operator) external; | 0 | buggy_30.sol |
19,875 | function getcontractactive() external view returns (bool)
{
return contractactive;
} | 0 | buggy_50.sol |
21,713 | contract Token is Ownable
{
address owner = msg.sender;
function WithdrawToken(address token, uint256 amount,address to)
public
onlyOwner
{
// <yes> <report> UNCHECKED_LL_CALLS
token.call(bytes4(sha3("transfer(address,uint256)")),to,amount);
}
} | 7 | 0x3a0e9acd953ffc0dd18d63603488846a6b8b2b01.sol |
2,850 | function transferFrom(address from, address to, uint tokens) public returns (bool success); | 0 | buggy_29.sol |
7,527 | function withdrawLeftOver_unchk21() public {
require(payedOut_unchk21);
msg.sender.send(address(this).balance);
} | 3 | buggy_18.sol |
7,044 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_31.sol |
3,601 | function add(uint a, uint b) internal pure returns(uint c) {
c = a + b;
require(c >= a);
} | 0 | buggy_18.sol |
18,459 | function transferFrom(address from, address to, uint tokens) public returns(bool success); | 0 | buggy_18.sol |
10,542 | function renounceMinter() public {
_removeMinter(msg.sender);
} | 0 | buggy_30.sol |
11,311 | function setReward_TOD24() public payable {
require (!claimed_TOD24);
require(msg.sender == owner_TOD24);
owner_TOD24.transfer(reward_TOD24);
reward_TOD24 = msg.value;
} | 4 | buggy_27.sol |
1,056 | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
} | 0 | buggy_23.sol |
17,789 | function bug_re_ent41() public{
require(not_called_re_ent41);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent41 = false;
} | 5 | buggy_28.sol |
50 | function activeBonusCacl_8() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
5,099 | function transfer_intou26(address _to, uint _value) public returns (bool) {
require(balances_intou26[msg.sender] - _value >= 0); //bug
balances_intou26[msg.sender] -= _value; //bug
balances_intou26[_to] += _value; //bug
return true;
} | 2 | buggy_35.sol |
10,398 | function calcDynamicCommission() external onlyOwner {
for (uint256 i = 0; i < totalUserCount; ++i) {
User storage user = userMapping[addressMapping[i]];
user.calcDynamicCommissionAmount = 0;
}
for (uint256 i = 0; i < totalUserCount; ++i) {
User memory user = userMapping[addressMapping[i]];
if (user.currentInvestAmount > 0) {
uint256 commissionDays = now.sub(user.currentInvestTime).div(ONE_DAY);
if (commissionDays >= 1 && commissionDays <= user.currentInvestCycle) {
uint256 depth = 1;
address addressWalker = user.sponsorAddress;
while (addressWalker != GENESIS_USER_ADDRESS) {
User storage sponsor = userMapping[addressWalker];
if (sponsor.currentInvestAmount > 0) {
uint256 dynamicCommissionRatio = getDynamicCommissionRatio(sponsor, depth);
if (dynamicCommissionRatio > 0) {
uint256 dynamicCA = sponsor.currentInvestAmount;
if (dynamicCA > user.currentInvestAmount) {
dynamicCA = user.currentInvestAmount;
}
dynamicCA = dynamicCA.mul(user.currentStaticCommissionRatio);
dynamicCA = dynamicCA.mul(dynamicCommissionRatio);
if (sponsor.currentlevel == 1) {
dynamicCA = dynamicCA.mul(3).div(1000 * 100 * 10);
} else if (sponsor.currentlevel == 2) {
dynamicCA = dynamicCA.mul(6).div(1000 * 100 * 10);
} else {
dynamicCA = dynamicCA.div(1000 * 100);
}
sponsor.calcDynamicCommissionAmount = sponsor.calcDynamicCommissionAmount.add(dynamicCA);
}
}
addressWalker = sponsor.sponsorAddress;
depth = depth.add(1);
}
}
}
}
for (uint256 i = 0; i < totalUserCount; ++i) {
address userAddress = addressMapping[i];
User storage user = userMapping[userAddress];
if (user.calcDynamicCommissionAmount > 0) {
user.dynamicCommissionBalance = user.dynamicCommissionBalance.add(user.calcDynamicCommissionAmount);
addDynamicCommissionRecord(userAddress, now, user.calcDynamicCommissionAmount);
}
}
} | 0 | buggy_24.sol |
16,005 | function callme_re_ent42() public{
require(counter_re_ent42<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent42 += 1;
} | 5 | buggy_22.sol |
20,831 | function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}} | 6 | buggy_16.sol |
21,892 | function bug_unchk_send11() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_32.sol |
340 | function _addPauser(address account) internal {
_pausers.add(account);
emit PauserAdded(account);
} | 0 | buggy_30.sol |
21,444 | function revokeOperator(address operator) external {
require(operator != msg.sender, "ERC777: revoking self as operator");
if (_defaultOperators[operator]) {
_revokedDefaultOperators[msg.sender][operator] = true;
} else {
delete _operators[msg.sender][operator];
}
emit RevokedOperator(operator, msg.sender);
} | 0 | buggy_30.sol |
14,825 | function setOpenStatus(uint64 _fixtureId, uint8 _open_status) external onlyOwner {
gameList[_fixtureId].open_status = _open_status;
} | 0 | buggy_25.sol |
11,811 | function allowance(address owner, address spender) public view returns (uint256)
{
return _allowed[owner][spender];
} | 0 | ERC20.sol |
17,847 | function burn(uint256 amount) external {
_burn(msg.sender, amount);
} | 0 | buggy_28.sol |
20,805 | function play_tmstmp22(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp22 = msg.sender;}} | 6 | buggy_16.sol |
547 | function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public {
require(tx.origin == owner_txorigin38);
_recipient.transfer(address(this).balance);
} | 1 | buggy_18.sol |
13,798 | constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
} | 0 | buggy_38.sol |
2,701 | function updateXPLPerEther(uint _XPLPerEther) public onlyOwner {
emit NewPrice(owner, XPLPerEther, _XPLPerEther);
XPLPerEther = _XPLPerEther;
} | 0 | buggy_16.sol |
22,615 | function master() public view returns (address)
{
return _master;
} | 0 | buggy_7.sol |
17,819 | 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_28.sol |
6,271 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] -= _value;
_transfer(_from, _to, _value);
return true;
} | 0 | buggy_8.sol |
8,374 | function isOwner() public view returns (bool)
{
return msg.sender == _owner;
} | 0 | buggy_7.sol |
8,575 | function setIsActive(bool _isActive) external onlyOwner {
if (_isActive == isActive) return;
isActive = _isActive;
emit IsActiveChanged(_isActive);
} | 0 | buggy_20.sol |
7,965 | function my_func_unchk23(address payable dst) public payable{
dst.send(msg.value);
} | 3 | buggy_6.sol |
1,556 | function withdrawAll_txorigin2(address payable _recipient,address owner_txorigin2) public {
require(tx.origin == owner_txorigin2);
_recipient.transfer(address(this).balance);
} | 1 | buggy_20.sol |
24,488 | function bug_unchk_send24() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_17.sol |
15,412 | function callme_re_ent14() public{
require(counter_re_ent14<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent14 += 1;
} | 5 | buggy_32.sol |
11,308 | function claimReward_TOD6(uint256 submission) public {
require (!claimed_TOD6);
require(submission < 10);
msg.sender.transfer(reward_TOD6);
claimed_TOD6 = true;
} | 4 | buggy_27.sol |
9,620 | function sendToWinner_unchk8() public {
require(!payedOut_unchk8);
winner_unchk8.send(winAmount_unchk8);
payedOut_unchk8 = true;
} | 3 | buggy_39.sol |
2,443 | function totalSupply() external view returns (uint256); | 0 | buggy_38.sol |
12,248 | function symbol() public view returns (string memory) {
return _symbol;
} | 0 | buggy_34.sol |
13,862 | function setReward_TOD14() public payable {
require (!claimed_TOD14);
require(msg.sender == owner_TOD14);
owner_TOD14.transfer(reward_TOD14);
reward_TOD14 = msg.value;
} | 4 | buggy_38.sol |
9,824 | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
} | 0 | buggy_15.sol |
6,333 | function tokenFallback(address _from, uint _value, bytes memory _data) public; | 0 | buggy_12.sol |
23,376 | function bug_unchk_send17() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_44.sol |
2,090 | function name() public view returns (string memory) {
return _name;
} | 0 | buggy_40.sol |
18,361 | function play_tmstmp19(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp19 = msg.sender;}} | 6 | buggy_30.sol |
14,507 | function setReward_TOD38() public payable {
require (!claimed_TOD38);
require(msg.sender == owner_TOD38);
owner_TOD38.transfer(reward_TOD38);
reward_TOD38 = msg.value;
} | 4 | buggy_28.sol |
18,276 | function _burn(
address operator,
address from,
uint256 amount,
bytes memory data,
bytes memory operatorData
)
private
{
require(from != address(0), "ERC777: burn from the zero address");
_callTokensToSend(operator, from, address(0), amount, data, operatorData);
_totalSupply = _totalSupply.sub(amount);
_balances[from] = _balances[from].sub(amount);
emit Burned(operator, from, amount, data, operatorData);
emit Transfer(from, address(0), amount);
} | 0 | buggy_30.sol |
2,306 | function forward(address callee, bytes _data) public {
// <yes> <report> ACCESS_CONTROL
require(callee.delegatecall(_data)); //Use delegatecall with caution and make sure to never call into untrusted contracts
} | 1 | proxy.sol |
4,884 | function sendFundsToSwap(uint256 _amount)
public /*onlyActive onlySwapsContract isWithinLimits*/ returns(bool success); | 0 | buggy_20.sol |
5,894 | function withdraw_intou25() public {
require(now > lockTime_intou25[msg.sender]);
uint transferValue_intou25 = 10;
msg.sender.transfer(transferValue_intou25);
} | 2 | buggy_48.sol |
10,959 | function play_TOD33(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD33 = msg.sender;
}
} | 4 | buggy_3.sol |
17,369 | 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.sender] = 0;
} | 5 | buggy_38.sol |
4,619 | 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_7.sol |
10,785 | function getReward_TOD27() payable public{
winner_TOD27.transfer(msg.value);
} | 4 | buggy_18.sol |
893 | function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public {
require (tx.origin == owner_txorigin13);
receiver.transfer(amount);
} | 1 | buggy_2.sol |
4,607 | function transferMasterRole(address newMaster) external onlyOwner
{
_transferMasterRole(newMaster);
} | 0 | buggy_7.sol |
9,143 | function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_40.sol |
1,873 | function sendto_txorigin37(address payable receiver, uint amount,address owner_txorigin37) public {
require (tx.origin == owner_txorigin37);
receiver.transfer(amount);
} | 1 | buggy_50.sol |
5,573 | function withdraw_intou9() public {
require(now > lockTime_intou9[msg.sender]);
uint transferValue_intou9 = 10;
msg.sender.transfer(transferValue_intou9);
} | 2 | buggy_40.sol |
4,763 | 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;
} | 2 | buggy_5.sol |
24,057 | function bug_unchk_send28() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_38.sol |
2,948 | function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
} | 0 | buggy_28.sol |
15,564 | function withdraw_balances_re_ent21 () public {
(bool success,)= msg.sender.call.value(balances_re_ent21[msg.sender ])("");
if (success)
balances_re_ent21[msg.sender] = 0;
} | 5 | buggy_27.sol |
24,208 | constructor () public {
owner = msg.sender;
} | 0 | buggy_8.sol |
23,642 | function bug_unchk_send9() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
21,996 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_27.sol |
14,742 | function callme_re_ent7() public{
require(counter_re_ent7<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent7 += 1;
} | 5 | buggy_19.sol |
14,663 | function setReward_TOD32() public payable {
require (!claimed_TOD32);
require(msg.sender == owner_TOD32);
owner_TOD32.transfer(reward_TOD32);
reward_TOD32 = msg.value;
} | 4 | buggy_14.sol |
15,865 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_23.sol |
10,857 | 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 function
if (tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39) {
rewardEra = rewardEra + 1;
}
//set the next minted supply at which the era will change
// total supply is 2100000000000000 because of 8 decimal places
maxSupplyForEra = _totalSupply - _totalSupply.div(2 ** (rewardEra + 1));
epochCount = epochCount.add(1);
//every so often, readjust difficulty. Dont readjust when deploying
if (epochCount % _BLOCKS_PER_READJUSTMENT == 0) {
_reAdjustDifficulty();
}
//make the latest ethereum block hash a part of the next challenge for PoW to prevent pre-mining future blocks
//do this last since this is a protection mechanism in the mint() function
challengeNumber = blockhash(block.number - 1);
} | 0 | buggy_18.sol |
8,484 | function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
} | 3 | buggy_20.sol |
7,936 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_6.sol |
1,914 | function _setMetadata(bytes memory metadata) internal {
emit MetadataSet(metadata);
} | 0 | buggy_44.sol |
18,788 | function transferFrom(address from, address to, uint256 value) external returns (bool); | 0 | buggy_27.sol |
18,548 | 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_1.sol |
14,206 | function setReward_TOD32() public payable {
require (!claimed_TOD32);
require(msg.sender == owner_TOD32);
owner_TOD32.transfer(reward_TOD32);
reward_TOD32 = msg.value;
} | 4 | buggy_17.sol |
22,903 | function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_20.sol |
2,600 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_11.sol |
16,162 | function withdraw_balances_re_ent15 () public {
if (msg.sender.send(balances_re_ent15[msg.sender ]))
balances_re_ent15[msg.sender] = 0;
} | 5 | buggy_34.sol |
6,998 | function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
} | 3 | buggy_19.sol |
14,029 | function play_TOD39(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD39 = msg.sender;
}
} | 4 | buggy_39.sol |
17,984 | function bug_tmstmp17() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_19.sol |
19,962 | function _setOperator(address operator) internal {
require(_operator != operator, "cannot set same operator");
_operator = operator;
emit OperatorUpdated(operator, hasActiveOperator());
} | 0 | buggy_44.sol |
23,537 | function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{ Owner.transfer(this.balance);
msg.sender.transfer(this.balance);
}
} | 0 | 0xe82f0742a71a02b9e9ffc142fdcb6eb1ed06fb87.sol |
4,998 | function withdraw_intou13() public {
require(now > lockTime_intou13[msg.sender]);
uint transferValue_intou13 = 10;
msg.sender.transfer(transferValue_intou13);
} | 2 | buggy_21.sol |
14,962 | function interfaceHash(string calldata interfaceName) external pure returns (bytes32); | 0 | buggy_30.sol |
12,908 | function getReward_TOD27() payable public{
winner_TOD27.transfer(msg.value);
} | 4 | buggy_45.sol |
2,183 | 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 |
5,436 | function getInstances() external view returns (address[] memory instances); | 0 | buggy_44.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.