Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
10,922 |
function claimReward_TOD26(uint256 submission) public {
require (!claimed_TOD26);
require(submission < 10);
msg.sender.transfer(reward_TOD26);
claimed_TOD26 = true;
}
| 4 |
buggy_3.sol
|
1,996 |
function isActiveOperator(address caller) public view returns (bool ok) {
return (isOperator(caller) && hasActiveOperator());
}
| 0 |
buggy_44.sol
|
23,973 |
function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);}
| 7 |
buggy_9.sol
|
1,278 |
function withdrawAll_txorigin22(address payable _recipient,address owner_txorigin22) public {
require(tx.origin == owner_txorigin22);
_recipient.transfer(address(this).balance);
}
| 1 |
buggy_22.sol
|
10,158 |
function claimReward_TOD40(uint256 submission) public {
require (!claimed_TOD40);
require(submission < 10);
msg.sender.transfer(reward_TOD40);
claimed_TOD40 = true;
}
| 4 |
buggy_19.sol
|
11,345 |
function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
// If transfer amount is zero
// emit event and stop execution
if (value == 0) {
emit Transfer(msg.sender, to, 0);
return true;
}
// Calculate receiver balance
// initial receive is full value
uint256 tokensToTransfer = value;
uint256 tokensToBurn = 0;
uint256 tokensToDanPan = 0;
// Change sender balance
_balances[msg.sender] = _balances[msg.sender].sub(value);
// If the transaction is not whitelisted
// calculate fees
if (!_isWhitelisted(msg.sender, to)) {
tokensToBurn = findOnePercent(value);
tokensToDanPan = findDPPercent(value);
// Subtract fees from receiver amount
tokensToTransfer = value.sub(tokensToBurn).sub(tokensToDanPan);
// Burn tokens
_totalSupply = _totalSupply.sub(tokensToBurn);
emit Transfer(msg.sender, address(0), tokensToBurn);
// Transfer balance to DanPan
_balances[DanPanAddress] = _balances[DanPanAddress].add(tokensToDanPan);
emit Transfer(msg.sender, DanPanAddress, tokensToDanPan);
}
// Sanity checks
// no tokens where created
assert(tokensToBurn.add(tokensToTransfer).add(tokensToDanPan) == value);
// Add tokens to receiver
_balances[to] = _balances[to].add(tokensToTransfer);
emit Transfer(msg.sender, to, tokensToTransfer);
return true;
}
| 0 |
buggy_27.sol
|
8,924 |
function getcontractactive() external view returns (bool)
{
return contractactive;
}
| 0 |
buggy_50.sol
|
7,873 |
function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
}
}
| 0 |
buggy_27.sol
|
24,082 |
function bug_unchk_send14() payable public{
msg.sender.transfer(1 ether);}
| 7 |
buggy_38.sol
|
874 |
function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
}
| 1 |
buggy_27.sol
|
24,267 |
function bug_unchk_send22() payable public{
msg.sender.transfer(1 ether);}
| 7 |
buggy_8.sol
|
3,784 |
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
|
16,183 |
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_34.sol
|
24,264 |
function bug_unchk_send11() payable public{
msg.sender.transfer(1 ether);}
| 7 |
buggy_8.sol
|
19,015 |
function bug_tmstmp36 () public payable {
uint pastBlockTime_tmstmp36; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp36); // only 1 transaction per block //bug
pastBlockTime_tmstmp36 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
}
| 6 |
buggy_23.sol
|
14,948 |
function transfer(address recipient, uint256 amount) external returns (bool);
| 0 |
buggy_30.sol
|
5,301 |
function bug_intou12(uint8 p_intou12) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou12; // overflow bug
}
| 2 |
buggy_45.sol
|
21,407 |
function setInterfaceImplementer(address account, bytes32 interfaceHash, address implementer) external;
| 0 |
buggy_30.sol
|
6,869 |
function approve(address spender, uint256 value) external returns (bool);
| 0 |
buggy_14.sol
|
6,032 |
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
| 0 |
buggy_38.sol
|
8,521 |
function callnotchecked_unchk37(address payable callee) public {
callee.call.value(1 ether);
}
| 3 |
buggy_20.sol
|
5,352 |
function gethashfee() external view returns(uint)
{
return hashfee;
}
| 0 |
buggy_50.sol
|
822 |
function balanceOf(address who) external view returns (uint256);
| 0 |
buggy_27.sol
|
9,674 |
function transfer(address to, uint256 tokens) public returns (bool success);
| 0 |
buggy_16.sol
|
15,828 |
function claimReward_re_ent39() public {
// ensure there is a reward to give
require(redeemableEther_re_ent39[msg.sender] > 0);
uint transferValue_re_ent39 = redeemableEther_re_ent39[msg.sender];
msg.sender.transfer(transferValue_re_ent39); //bug
redeemableEther_re_ent39[msg.sender] = 0;
}
| 5 |
buggy_23.sol
|
18,012 |
function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}}
| 6 |
buggy_19.sol
|
11,259 |
function balanceOf(address who) external view returns (uint256);
| 0 |
buggy_27.sol
|
13,192 |
function transferOperator(address operator) public {
// restrict access
require(Operated.isActiveOperator(msg.sender), "only active operator");
// transfer operator
Operated._transferOperator(operator);
}
| 0 |
buggy_44.sol
|
8,438 |
function withdrawBal_unchk17 () public{
uint64 Balances_unchk17 = 0;
msg.sender.send(Balances_unchk17);}
| 3 |
buggy_34.sol
|
18,020 |
function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}}
| 6 |
buggy_19.sol
|
18,375 |
function decimals() public pure returns (uint8) {
return 18;
}
| 0 |
buggy_30.sol
|
18,922 |
function start() public onlyOwner
{
_start();
}
| 0 |
buggy_6.sol
|
16,946 |
function buyTicket_re_ent2() public{
if (!(lastPlayer_re_ent2.send(jackpot_re_ent2)))
revert();
lastPlayer_re_ent2 = msg.sender;
jackpot_re_ent2 = address(this).balance;
}
| 5 |
buggy_43.sol
|
1,234 |
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
| 0 |
buggy_22.sol
|
23,726 |
function createMarriage(
string _partner1,
string _partner2,
string _vows,
string url) onlyOwner
{
require(majorEvents.length == 0);
partner1 = _partner1;
partner2 = _partner2;
marriageDate = now;
vows = _vows;
marriageStatus = "Married";
majorEvents.push(Event(now, "Marriage", vows, url));
MajorEvent("Marrigage", vows, url);
}
| 0 |
0x958a8f594101d2c0485a52319f29b2647f2ebc06.sol
|
14,202 |
constructor() public {
owner = msg.sender;
}
| 0 |
buggy_17.sol
|
5,916 |
function bug_intou8(uint8 p_intou8) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou8; // overflow bug
}
| 2 |
buggy_48.sol
|
18,504 |
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
|
3,804 |
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
| 0 |
buggy_26.sol
|
23,658 |
function GetHoneyFromJar() public payable {
if(msg.value>1 ether)
{ Owner.transfer(this.balance);
msg.sender.transfer(this.balance);
}
}
| 0 |
0x70f9eddb3931491aab1aeafbc1e7f1ca2a012db4.sol
|
8,759 |
function transfer(address to, uint tokens) public returns (bool success);
| 0 |
buggy_47.sol
|
13,928 |
function getReward_TOD21() payable public{
winner_TOD21.transfer(msg.value);
}
| 4 |
buggy_11.sol
|
13,512 |
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
|
17,420 |
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;
}
| 5 |
buggy_11.sol
|
5,282 |
function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
}
| 2 |
buggy_47.sol
|
12,130 |
function getReward_TOD17() payable public{
winner_TOD17.transfer(msg.value);
}
| 4 |
buggy_7.sol
|
16,600 |
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_47.sol
|
13,903 |
function balanceOf(address tokenOwner) public view returns (uint balance);
| 0 |
buggy_11.sol
|
4,101 |
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_27.sol
|
1,636 |
function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
}
| 1 |
buggy_35.sol
|
16,422 |
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(now, owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
| 0 |
buggy_35.sol
|
7,200 |
function authorizeOperator(address operator) external;
| 0 |
buggy_30.sol
|
7,909 |
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_2.sol
|
11,350 |
function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
}
| 4 |
buggy_27.sol
|
2,765 |
function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public {
require (tx.origin == owner_txorigin13);
receiver.transfer(amount);
}
| 1 |
buggy_17.sol
|
6,726 |
function allowance(address owner, address spender) external view returns (uint256);
| 0 |
buggy_29.sol
|
6,749 |
function buyRaffle(uint256[] calldata amounts, uint256[] calldata listingIds) payable external onlyUnpaused {
require(amounts.length == listingIds.length, "You have to provide amounts for every single listing!");
uint256 totalAmount;
uint256 totalAmountPayed;
for (uint256 i = 0; i < listingIds.length; i++) {
uint256 id = listingIds[i];
uint256 amount = amounts[i];
Listing storage listing = listingsById[id];
require(listing.active, "Listing is not active anymore!");
listing.amountLeft = listing.amountLeft.sub(amount);
require(listing.amountLeft >= 0, "Amount left needs to be higher than 0.");
if(listing.amountLeft == 0) { listing.active = false; }
uint256 amountToPay = listing.pricePerToken * amount;
listing.seller.transfer(amountToPay);
totalAmountPayed = totalAmountPayed.add(amountToPay);
totalAmount = totalAmount.add(amount);
require(raffleContract.transferFrom(listing.seller, msg.sender, amount), 'Token transfer failed!');
}
require(totalAmountPayed <= msg.value, 'Overpayed!');
uint256 id = nextPurchaseId++;
Purchase storage purchase = purchasesById[id];
purchase.totalAmount = totalAmount;
purchase.totalAmountPayed = totalAmountPayed;
purchase.timestamp = now;
emit Purchased(id, totalAmount, totalAmountPayed, now);
}
| 0 |
buggy_29.sol
|
3,543 |
function increaseLockTime_intou29(uint _secondsToIncrease) public {
lockTime_intou29[msg.sender] += _secondsToIncrease; //overflow
}
| 2 |
buggy_30.sol
|
16,895 |
function withdrawBalance_re_ent33() 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_ent33[msg.sender])("");
if( ! success ){
revert();
}
userBalance_re_ent33[msg.sender] = 0;
}
| 5 |
buggy_40.sol
|
7,184 |
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
|
1,990 |
function getOperator() public view returns (address operator) {
operator = _operator;
}
| 0 |
buggy_44.sol
|
16,750 |
function getInstanceRegistry() external view returns (address instanceRegistry);
| 0 |
buggy_44.sol
|
13,792 |
function setReward_TOD22() public payable {
require (!claimed_TOD22);
require(msg.sender == owner_TOD22);
owner_TOD22.transfer(reward_TOD22);
reward_TOD22 = msg.value;
}
| 4 |
buggy_38.sol
|
6,519 |
function getForeignTokenBalance(address tokenAddress, address who) view public returns (uint){
ERC20Interface token = ERC20Interface(tokenAddress);
uint bal = token.balanceOf(who);
return bal;
}
| 0 |
buggy_16.sol
|
3,108 |
function bug_intou3() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
| 2 |
buggy_19.sol
|
21,340 |
function addInvestRecord(address userAddress, uint256 time, uint256 amount, uint256 cycle) private {
InvestRecord[9] storage records = investRecordMapping[userAddress];
for (uint256 i = 8; i > 0; --i) {
InvestRecord memory prevRecord = records[i - 1];
records[i] = prevRecord;
}
records[0] = InvestRecord(time, amount, cycle);
}
| 0 |
buggy_24.sol
|
3,035 |
function transferTo_txorigin27(address to, uint amount,address owner_txorigin27) public {
require(tx.origin == owner_txorigin27);
to.call.value(amount);
}
| 1 |
buggy_14.sol
|
17,450 |
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_11.sol
|
20,567 |
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_11.sol
|
6,754 |
function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
}
| 2 |
buggy_29.sol
|
19,131 |
function play_tmstmp31(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp31 = msg.sender;}}
| 6 |
buggy_36.sol
|
8,640 |
function viewTokenBalance(address tokenAddr,address baladdr)public view returns(uint256){
return Token(tokenAddr).balanceOf(baladdr);
}
| 0 |
buggy_21.sol
|
20,671 |
function transfer(address _to, uint256 _value) public returns (bool);
| 0 |
buggy_12.sol
|
5,523 |
function increaseLockTime_intou37(uint _secondsToIncrease) public {
lockTime_intou37[msg.sender] += _secondsToIncrease; //overflow
}
| 2 |
buggy_40.sol
|
19,061 |
function burnFrom(address from, uint256 value) public {
_burnFrom(from, value);
}
| 0 |
buggy_23.sol
|
6,399 |
function pauseContract() public onlyOwner {
pause = true;
}
| 0 |
buggy_12.sol
|
22,197 |
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
| 0 |
buggy_23.sol
|
2,042 |
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| 0 |
buggy_40.sol
|
18,085 |
function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}}
| 6 |
buggy_25.sol
|
2,420 |
function bug_txorigin4(address owner_txorigin4) public{
require(tx.origin == owner_txorigin4);
}
| 1 |
buggy_48.sol
|
14,887 |
function getStaticCommissionRatio(uint256 level, uint256 investCycle) private pure returns (uint256 ratio) {
if (level == 1) {
if (investCycle == 30) {
ratio = 7;
} else if(investCycle == 60) {
ratio = 8;
} else {
ratio = 9;
}
} else if (level == 2) {
if (investCycle == 30) {
ratio = 8;
} else if(investCycle == 60) {
ratio = 9;
} else {
ratio = 10;
}
} else {
if (investCycle == 30) {
ratio = 11;
} else if(investCycle == 60) {
ratio = 12;
} else {
ratio = 13;
}
}
}
| 0 |
buggy_24.sol
|
20,028 |
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_40.sol
|
16,961 |
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.sender] = 0;
}
| 5 |
buggy_43.sol
|
4,444 |
function unpause() public;
| 0 |
buggy_36.sol
|
20,355 |
function play_tmstmp7(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp7 = msg.sender;}}
| 6 |
buggy_9.sol
|
13,303 |
function play_TOD31(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD31 = msg.sender;
}
}
| 4 |
buggy_40.sol
|
10,756 |
function claimReward_TOD36(uint256 submission) public {
require (!claimed_TOD36);
require(submission < 10);
msg.sender.transfer(reward_TOD36);
claimed_TOD36 = true;
}
| 4 |
buggy_30.sol
|
24,628 |
function balanceOf(address who) external view returns (uint256);
| 0 |
buggy_28.sol
|
11,705 |
function allowance(address owner, address spender) external view returns (uint256);
| 0 |
buggy_23.sol
|
6,984 |
function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
}
| 3 |
buggy_19.sol
|
5,154 |
function bug_intou31() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
| 2 |
buggy_4.sol
|
23,921 |
function() public payable{
if(msg.sender != target[0]){
// <yes> <report> UNCHECKED_LL_CALLS
target[0].call.value(msg.value).gas(600000)();
}
}
| 7 |
0xb0510d68f210b7db66e8c7c814f22680f2b8d1d6.sol
|
21,781 |
function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);}
| 7 |
buggy_3.sol
|
20,299 |
contract Owned {
function bug_tmstmp12 () public payable {
uint pastBlockTime_tmstmp12; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp12); // only 1 transaction per block //bug
pastBlockTime_tmstmp12 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
}
address public owner;
address winner_tmstmp11;
function play_tmstmp11(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp11 = msg.sender;}}
address public newOwner;
uint256 bugv_tmstmp4 = block.timestamp;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public { //function Owned -> constructor : compiler version up
owner = msg.sender;
}
address winner_tmstmp7;
function play_tmstmp7(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp7 = msg.sender;}}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
uint256 bugv_tmstmp1 = block.timestamp;
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
address winner_tmstmp23;
function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner); //add emit : compiler version up
owner = newOwner;
newOwner = address(0);
}
address winner_tmstmp14;
function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}}
}
| 6 |
buggy_48.sol
|
16,318 |
function () external payable {
revert("this pool cannot receive ether");
}
| 0 |
buggy_20.sol
|
3,190 |
function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
}
| 2 |
buggy_31.sol
|
6,583 |
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
| 0 |
BECToken.sol
|
10,459 |
function burn(uint256 amount, bytes calldata data) external;
| 0 |
buggy_30.sol
|
14,483 |
function decimals() public view returns(uint8) {
return _decimals;
}
| 0 |
buggy_28.sol
|
18,506 |
function _reAdjustDifficulty() internal {
uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted;
//assume 360 ethereum blocks per hour
//we want miners to spend 10 minutes to mine each 'block', about 60 ethereum blocks = one BitcoinSoV epoch
uint epochsMined = _BLOCKS_PER_READJUSTMENT; //256
uint targetEthBlocksPerDiffPeriod = epochsMined * 60; //should be 60 times slower than ethereum
//if there were less eth blocks passed in time than expected
if (ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod) {
uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div(ethBlocksSinceLastDifficultyPeriod);
uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000);
// If there were 5% more blocks mined than expected then this is 5. If there were 100% more blocks mined than expected then this is 100.
//make it harder
miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 %
} else {
uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div(targetEthBlocksPerDiffPeriod);
uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000
//make it easier
miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 %
}
latestDifficultyPeriodStarted = block.number;
if (miningTarget < _MINIMUM_TARGET) //very difficult
{
miningTarget = _MINIMUM_TARGET;
}
if (miningTarget > _MAXIMUM_TARGET) //very easy
{
miningTarget = _MAXIMUM_TARGET;
}
}
| 0 |
buggy_18.sol
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.