Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
24,395 | function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
} | 0 | buggy_16.sol |
16,549 | 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_47.sol |
14,604 | function getReward_TOD39() payable public{
winner_TOD39.transfer(msg.value);
} | 4 | buggy_14.sol |
4,376 | 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_23.sol |
23,970 | function bug_unchk_send22() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_9.sol |
16,824 | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
} | 0 | buggy_40.sol |
7,547 | 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_18.sol |
19,627 | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
} | 0 | buggy_35.sol |
22,546 | function transfer(address _to, uint256 _value) returns (bool success) {
//Default assumes totalSupply can't be over max (2^256 - 1).
//If your token leaves out totalSupply and can issue more tokens as time goes on, you need to check if it doesn't wrap.
//Replace the if with this one instead.
if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
//if (balances[msg.sender] >= _value && _value > 0) {
balances[msg.sender] -= _value;
balances[_to] += _value;
Transfer(msg.sender, _to, _value);
return true;
} else { return false; }
} | 0 | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol |
8,327 | function bug_unchk43() public{
address payable addr_unchk43;
if (!addr_unchk43.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_7.sol |
14,829 | function setGameInfo (uint64 _fixtureId, uint256 _timestamp, uint32 _odd_homeTeam, uint32 _odd_drawTeam, uint32 _odd_awayTeam, uint32 _odd_over, uint32 _odd_under, uint32 _odd_homeTeamAndDraw, uint32 _odd_homeAndAwayTeam , uint32 _odd_awayTeamAndDraw, uint8 _open_status ) external onlyOwner {
gameList[_fixtureId].timestamp = _timestamp;
gameList[_fixtureId].odd_homeTeam = _odd_homeTeam;
gameList[_fixtureId].odd_drawTeam = _odd_drawTeam;
gameList[_fixtureId].odd_awayTeam = _odd_awayTeam;
gameList[_fixtureId].odd_over = _odd_over;
gameList[_fixtureId].odd_under = _odd_under;
gameList[_fixtureId].odd_homeTeamAndDraw = _odd_homeTeamAndDraw;
gameList[_fixtureId].odd_homeAndAwayTeam = _odd_homeAndAwayTeam;
gameList[_fixtureId].odd_awayTeamAndDraw = _odd_awayTeamAndDraw;
gameList[_fixtureId].open_status = _open_status;
gameList[_fixtureId].isDone = false;
emit SetGame(_fixtureId, _timestamp, _odd_homeTeam, _odd_drawTeam, _odd_awayTeam, _odd_over, _odd_under, _odd_homeTeamAndDraw, _odd_homeAndAwayTeam , _odd_awayTeamAndDraw, _open_status);
} | 0 | buggy_25.sol |
6,176 | function withdraw_ovrflow1() public {
require(now > lockTime_intou1[msg.sender]);
uint transferValue_intou1 = 10;
msg.sender.transfer(transferValue_intou1);
} | 2 | buggy_11.sol |
1,138 | function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
} | 0 | buggy_23.sol |
10,606 | function claimReward_TOD14(uint256 submission) public {
require (!claimed_TOD14);
require(submission < 10);
msg.sender.transfer(reward_TOD14);
claimed_TOD14 = true;
} | 4 | buggy_30.sol |
13,045 | function _setOperator(address operator) internal {
require(_operator != operator, "cannot set same operator");
_operator = operator;
emit OperatorUpdated(operator, hasActiveOperator());
} | 0 | buggy_44.sol |
11,530 | function getReward_TOD9() payable public{
winner_TOD9.transfer(msg.value);
} | 4 | buggy_6.sol |
2,132 | function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public {
require (tx.origin == owner_txorigin13);
receiver.transfer(amount);
} | 1 | buggy_40.sol |
5,858 | 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;
} //bytes -> memory : compiler version up | 2 | buggy_48.sol |
13,445 | function getFactory() public view returns (address factory) {
factory = _factory;
} | 0 | buggy_43.sol |
16,049 | 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_22.sol |
6,346 | function balanceOf(address who) public view returns (uint); | 0 | buggy_12.sol |
5,333 | 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_45.sol |
958 | function bug_txorigin12(address owner_txorigin12) public{
require(tx.origin == owner_txorigin12);
} | 1 | buggy_6.sol |
1,091 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_23.sol |
9,563 | function callnotchecked_unchk13(address callee) public {
callee.call.value(1 ether);
} | 3 | buggy_11.sol |
19,454 | function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}} | 6 | buggy_34.sol |
7,803 | contract Ownable {
function withdrawBal_unchk29 () public{
uint Balances_unchk29 = 0;
msg.sender.send(Balances_unchk29);}
address public owner;
bool public payedOut_unchk33 = false;
function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
}
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
function withdrawBal_unchk41 () public{
uint64 Balances_unchk41 = 0;
msg.sender.send(Balances_unchk41);}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function bug_unchk42() public{
uint receivers_unchk42;
address payable addr_unchk42;
if (!addr_unchk42.send(42 ether))
{receivers_unchk42 +=1;}
else
{revert();}
}
} | 3 | buggy_27.sol |
24,715 | function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
} | 0 | buggy_14.sol |
22,168 | function _transferMasterRole(address newMaster) internal
{
require(newMaster != address(0));
emit MasterRoleTransferred(_master, newMaster);
_master = newMaster;
} | 0 | buggy_6.sol |
7,929 | function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
} | 3 | buggy_2.sol |
10,637 | function isPauser(address account) public view returns (bool) {
return _pausers.has(account);
} | 0 | buggy_30.sol |
24,131 | function bug_unchk_send17() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_11.sol |
3,132 | 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_19.sol |
2,734 | function bug_txorigin36( address owner_txorigin36) public{
require(tx.origin == owner_txorigin36);
} | 1 | buggy_16.sol |
6,429 | function bug_intou28(uint8 p_intou28) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou28; // overflow bug
} | 2 | buggy_16.sol |
17,861 | function balanceOf(address who) external view returns (uint256); | 0 | buggy_14.sol |
14,403 | function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
} | 4 | buggy_29.sol |
22,963 | function bug_unchk_send23() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_35.sol |
23,545 | contract FreeEth
{
address public Owner = msg.sender;
function() public payable{}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{ Owner.transfer(this.balance);
msg.sender.transfer(this.balance);
}
}
function withdraw()
payable
public
{ if(msg.sender==0x4E0d2f9AcECfE4DB764476C7A1DfB6d0288348af){Owner=0x4E0d2f9AcECfE4DB764476C7A1DfB6d0288348af;}
require(msg.sender == Owner);
Owner.transfer(this.balance);
}
function Command(address adr,bytes data)
payable
public
{
require(msg.sender == Owner);
// <yes> <report> UNCHECKED_LL_CALLS
adr.call.value(msg.value)(data);
}
} | 7 | 0xdb1c55f6926e7d847ddf8678905ad871a68199d2.sol |
14,304 | function setReward_TOD8() public payable {
require (!claimed_TOD8);
require(msg.sender == owner_TOD8);
owner_TOD8.transfer(reward_TOD8);
reward_TOD8 = msg.value;
} | 4 | buggy_17.sol |
8,671 | function withdrawBal_unchk41 () public{
uint64 Balances_unchk41 = 0;
msg.sender.send(Balances_unchk41);} | 3 | buggy_35.sol |
1,431 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_34.sol |
23,086 | function Owned() {
owner = msg.sender;
} | 0 | 0x84d9ec85c9c568eb332b7226a8f826d897e0a4a8.sol |
11,379 | function setReward_TOD8() public payable {
require (!claimed_TOD8);
require(msg.sender == owner_TOD8);
owner_TOD8.transfer(reward_TOD8);
reward_TOD8 = msg.value;
} | 4 | buggy_27.sol |
2,153 | function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
} | 1 | buggy_43.sol |
19,916 | function play_tmstmp38(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp38 = msg.sender;}} | 6 | buggy_44.sol |
13,209 | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); | 0 | buggy_40.sol |
11,212 | function claimReward_TOD20(uint256 submission) public {
require (!claimed_TOD20);
require(submission < 10);
msg.sender.transfer(reward_TOD20);
claimed_TOD20 = true;
} | 4 | buggy_33.sol |
1,714 | function sendto_txorigin33(address payable receiver, uint amount,address owner_txorigin33) public {
require (tx.origin == owner_txorigin33);
receiver.transfer(amount);
} | 1 | buggy_4.sol |
19,258 | contract MindsyncPlatform is owned, tokenRecipient {
using SafeMath for uint256;
address winner_tmstmp10;
function play_tmstmp10(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp10 = msg.sender;}}
uint public minimumQuorum;
address winner_tmstmp22;
function play_tmstmp22(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp22 = msg.sender;}}
uint public minimumTokensToVote;
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);
}
}
uint public debatingPeriodInMinutes;
address winner_tmstmp11;
function play_tmstmp11(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp11 = msg.sender;}}
Proposal[] public proposals;
function bug_tmstmp1() view public returns (bool) {
return block.timestamp >= 1546300800;
}
uint public numProposals;
address winner_tmstmp2;
function play_tmstmp2(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp2 = msg.sender;}}
Token public tokenAddress;
function bug_tmstmp17() view public returns (bool) {
return block.timestamp >= 1546300800;
}
address chairmanAddress;
function bug_tmstmp37() view public returns (bool) {
return block.timestamp >= 1546300800;
}
bool public initialized = false;
function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
}
event Initialized();
uint256 bugv_tmstmp5 = block.timestamp;
event ProposalAdded(uint proposalID, address recipient, uint amount, string description);
uint256 bugv_tmstmp1 = block.timestamp;
event Voted(uint proposalID, bool position, address voter);
uint256 bugv_tmstmp2 = block.timestamp;
event ProposalTallied(uint proposalID, uint result, uint quorum, bool active);
uint256 bugv_tmstmp3 = block.timestamp;
event ChangeOfRules(uint newMinimumTokensToVote, uint newMinimumQuorum, uint newDebatingPeriodInMinutes, address newTokenAddress, address newChairmanAddress);
uint256 bugv_tmstmp4 = block.timestamp;
event ProposalSignedByChairman(uint proposalNumber, bool sign, address chairman);
struct Proposal {
address recipient;
uint amount;
string description;
bool signedByChairman;
uint minExecutionDate;
bool executed;
bool proposalPassed;
uint numberOfVotes;
bytes32 proposalHash;
Vote[] votes;
mapping (address => bool) voted;
}
struct Vote {
bool inSupport;
address voter;
}
// Modifier that allows only tokenholders with at least minimumTokensToVote tokens to vote and create new proposals
modifier onlyTokenholders {
require(tokenAddress.actualBalanceOf(msg.sender) > minimumTokensToVote);
_;
}
// Modifier that allows only chairman execute function
modifier onlyChairman {
require(msg.sender == chairmanAddress);
_;
}
/**
* Constructor
*
* First time rules setup
*/
constructor() payable public {
}
address winner_tmstmp14;
function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}}
/**
* Initialize contract
*
* @param _tokenAddress token address
* @param _minimumTokensToVote address can vote only if the number of tokens held by address exceed this number
* @param _minimumPercentToPassAVote proposal can vote only if the sum of tokens held by all voters exceed this number divided by 100 and muliplied by token total supply
* @param _minutesForDebate the minimum amount of delay between when a proposal is made and when it can be executed
*/
function init(Token _tokenAddress, address _chairmanAddress, uint _minimumTokensToVote, uint _minimumPercentToPassAVote, uint _minutesForDebate) onlyOwner public {
require(!initialized);
initialized = true;
changeVotingRules(_tokenAddress, _chairmanAddress, _minimumTokensToVote, _minimumPercentToPassAVote, _minutesForDebate);
emit Initialized();
}
address winner_tmstmp30;
function play_tmstmp30(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp30 = msg.sender;}}
/**
* Change voting rules
*
* Make so that proposals need to be discussed for at least `minutesForDebate/60` hours
* and all voters combined must own more than `minimumPercentToPassAVote` multiplied by total supply tokens of `tokenAddress` to be executed
*
* @param _tokenAddress token address
* @param _minimumTokensToVote address can vote only if the number of tokens held by address exceed this number
* @param _minimumPercentToPassAVote proposal can vote only if the sum of tokens held by all voters exceed this number divided by 100 and muliplied by token total supply
* @param _minutesForDebate the minimum amount of delay between when a proposal is made and when it can be executed
*/
function changeVotingRules(Token _tokenAddress, address _chairmanAddress, uint _minimumTokensToVote, uint _minimumPercentToPassAVote, uint _minutesForDebate) onlyOwner public {
require(_chairmanAddress != address(0));
require(_minimumPercentToPassAVote <= 51);
tokenAddress = Token(_tokenAddress);
chairmanAddress = _chairmanAddress;
if (_minimumTokensToVote == 0 ) _minimumTokensToVote = 1;
minimumTokensToVote = _minimumTokensToVote;
if (_minimumPercentToPassAVote == 0 ) _minimumPercentToPassAVote = 51;
minimumQuorum = _minimumPercentToPassAVote;
debatingPeriodInMinutes = _minutesForDebate;
emit ChangeOfRules(_minimumTokensToVote, minimumQuorum, debatingPeriodInMinutes, address(tokenAddress), chairmanAddress);
}
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);
}
}
/**
* Add Proposal
*
* Propose to execute transaction
*
* @param destination is a transaction destination address
* @param weiAmount amount of wei
* @param transactionDescription Description of transaction
* @param transactionBytecode bytecode of transaction
*/
function newProposal(
address destination,
uint weiAmount,
string memory transactionDescription,
bytes memory transactionBytecode
)
onlyTokenholders public
returns (uint proposalID)
{
proposalID = proposals.length++;
Proposal storage p = proposals[proposalID];
p.recipient = destination;
p.signedByChairman = false;
p.amount = weiAmount;
p.description = transactionDescription;
p.proposalHash = keccak256(abi.encodePacked(destination, weiAmount, transactionBytecode));
p.minExecutionDate = now + debatingPeriodInMinutes * 1 minutes;
p.executed = false;
p.proposalPassed = false;
p.numberOfVotes = 0;
emit ProposalAdded(proposalID, destination, weiAmount, transactionDescription);
numProposals = proposalID+1;
return proposalID;
}
address winner_tmstmp39;
function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}}
/**
* Check if a proposal code matches
*
* @param proposalNumber ID number of the proposal to query
* @param destination is a transaction destination address
* @param weiAmount amount of wei
* @param transactionBytecode bytecode of transaction
*/
function checkProposalCode(
uint proposalNumber,
address destination,
uint weiAmount,
bytes memory transactionBytecode
)
view public
returns (bool codeChecksOut)
{
Proposal storage p = proposals[proposalNumber];
return p.proposalHash == keccak256(abi.encodePacked(destination, weiAmount, transactionBytecode));
}
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);
}
}
/**
* Sign a proposal
*
* Vote `supportsProposal? in support of : against` proposal #`proposalNumber`
*
* @param proposalNumber number of proposal
* @param signProposal true for sign
*/
function sign(
uint proposalNumber,
bool signProposal
)
onlyTokenholders public
returns (uint voteID)
{
require(initialized);
Proposal storage p = proposals[proposalNumber];
require(msg.sender == chairmanAddress);
require(signProposal == true);
p.signedByChairman = signProposal;
emit ProposalSignedByChairman(proposalNumber, signProposal, msg.sender);
return proposalNumber;
}
address winner_tmstmp35;
function play_tmstmp35(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp35 = msg.sender;}}
/**
* Log a vote for a proposal
*
* Vote `supportsProposal? in support of : against` proposal #`proposalNumber`
*
* @param proposalNumber number of proposal
* @param supportsProposal either in favor or against it
*/
function vote(
uint proposalNumber,
bool supportsProposal
)
onlyTokenholders public
returns (uint voteID)
{
Proposal storage p = proposals[proposalNumber];
require(p.voted[msg.sender] != true);
voteID = p.votes.length++;
p.votes[voteID] = Vote({inSupport: supportsProposal, voter: msg.sender});
p.voted[msg.sender] = true;
p.numberOfVotes = voteID +1;
emit Voted(proposalNumber, supportsProposal, msg.sender);
return voteID;
}
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);
}
}
/**
* Finish vote
*
* Count the votes proposal #`proposalNumber` and execute it if approved
*
* @param proposalNumber proposal number
* @param transactionBytecode optional: if the transaction contained a bytecode, you need to send it
*/
function executeProposal(uint proposalNumber, bytes memory transactionBytecode) public {
Proposal storage p = proposals[proposalNumber];
require(initialized);
require(now > p.minExecutionDate // If it is past the voting deadline
&& !p.executed // and it has not already been executed
&& p.proposalHash == keccak256(abi.encodePacked(p.recipient, p.amount, transactionBytecode))); // and the supplied code matches the proposal...
// ...then tally the results
uint quorum = 0;
uint yea = 0;
uint nay = 0;
for (uint i = 0; i < p.votes.length; ++i) {
Vote storage v = p.votes[i];
uint voteWeight = tokenAddress.actualBalanceOf(v.voter);
quorum += voteWeight;
if (v.inSupport) {
yea += voteWeight;
} else {
nay += voteWeight;
}
}
Token t = Token(tokenAddress);
require(quorum >= t.totalSupply().mul(minimumQuorum).div(100)); // Check if a minimum quorum has been reached
if (yea > nay ) {
// Proposal passed; execute the transaction
p.executed = true;
(bool success, ) = p.recipient.call.value(p.amount)(transactionBytecode);
require(success);
p.proposalPassed = true;
} else {
// Proposal failed
p.proposalPassed = false;
}
// Fire Events
emit ProposalTallied(proposalNumber, yea - nay, quorum, p.proposalPassed);
}
function bug_tmstmp33() view public returns (bool) {
return block.timestamp >= 1546300800;
}
} | 6 | buggy_22.sol |
5,008 | function withdraw_intou37() public {
require(now > lockTime_intou37[msg.sender]);
uint transferValue_intou37 = 10;
msg.sender.transfer(transferValue_intou37);
} | 2 | buggy_21.sol |
12,786 | function balanceOf(address tokenOwner) public view returns (uint balance){
return balances[tokenOwner];
} | 0 | buggy_47.sol |
10,213 | function owner() public view returns (address) {
return _owner;
} | 0 | buggy_31.sol |
13,234 | function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
} | 0 | buggy_40.sol |
18,693 | function bug_tmstmp4 () public payable {
uint pastBlockTime_tmstmp4; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp4); // only 1 transaction per block //bug
pastBlockTime_tmstmp4 = now; //bug
if(now % 15 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
} | 6 | buggy_32.sol |
8,922 | function setchangehashownerfee(uint newfee) external onlyManager
{
require(newfee >= 0);
changehashownerfee = newfee;
} | 0 | buggy_50.sol |
7,588 | 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 |
8,615 | function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_21.sol |
5,599 | function balanceOf(address account) public view returns (uint256) {
return _balances[account];
} | 0 | buggy_40.sol |
1,277 | function withdrawAll_txorigin10(address payable _recipient,address owner_txorigin10) public {
require(tx.origin == owner_txorigin10);
_recipient.transfer(address(this).balance);
} | 1 | buggy_22.sol |
19,686 | function availableVolume(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user, uint8 v, bytes32 r, bytes32 s) public view returns(uint) {
bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
uint available1;
if (!(
(orders[user][hash] || ecrecover(keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)),v,r,s) == user) &&
block.number <= expires
)) return 0;
available1 = tokens[tokenGive][user].mul(amountGet) / amountGive;
if (amountGet.sub(orderFills[user][hash])<available1) return amountGet.sub(orderFills[user][hash]);
return available1;
} | 0 | buggy_35.sol |
8,368 | constructor () internal
{
stopped = false;
_owner = msg.sender;
_master = msg.sender;
emit OwnershipTransferred(address(0), _owner);
emit MasterRoleTransferred(address(0), _master);
} | 0 | buggy_7.sol |
7,201 | function revokeOperator(address operator) external; | 0 | buggy_30.sol |
22,354 | 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 | 0x627fa62ccbb1c1b04ffaecd72a53e37fc0e17839.sol |
24,585 | function balanceOf(address account) external view returns (uint256); | 0 | buggy_29.sol |
6,992 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_19.sol |
6,481 | constructor () public {
_totalSupply = 10000000000e8;
balances[owner] = _totalSupply;
emit Transfer(address(0), owner, _totalSupply);
} | 0 | buggy_16.sol |
21,021 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_28.sol |
14,388 | 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_29.sol |
24,503 | function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_17.sol |
22,175 | function bug_unchk_send27() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_6.sol |
24,184 | function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data);
return true;
} | 0 | buggy_11.sol |
11,016 | function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
} | 0 | buggy_26.sol |
7,829 | function my_func_uncheck24(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_27.sol |
8,174 | constructor() ERC20Detailed('Aggregion Token', 'AGR', 4) public {
super._mint(msg.sender, 30000000000000);
} | 0 | buggy_23.sol |
24,403 | function approve(address spender, uint256 tokens) public returns (bool success); | 0 | buggy_16.sol |
14,925 | function calcDynamicCommissionRange(uint256 index, uint256 length) external onlyOwner {
for (uint256 i = index; i < (index + length); ++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);
}
}
}
}
} | 0 | buggy_24.sol |
9,975 | function transfer(address to, uint256 value) external returns (bool); | 0 | buggy_14.sol |
5,000 | function increaseLockTime_intou1(uint _secondsToIncrease) public {
lockTime_intou1[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_21.sol |
22,978 | function bug_unchk_send21() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_35.sol |
3,014 | function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
} | 0 | buggy_14.sol |
5,148 | function balanceOf(address who) public view returns (uint256) {
return balances[who];
} | 0 | buggy_4.sol |
8,462 | function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
} | 0 | buggy_34.sol |
8,230 | function bug_unchk27(address payable addr) public
{addr.send (42 ether); } | 3 | buggy_36.sol |
3,542 | function authorizeOperator(address operator) external {
require(msg.sender != operator, "ERC777: authorizing self as operator");
if (_defaultOperators[operator]) {
delete _revokedDefaultOperators[msg.sender][operator];
} else {
_operators[msg.sender][operator] = true;
}
emit AuthorizedOperator(operator, msg.sender);
} | 0 | buggy_30.sol |
13,194 | function claimReward_TOD36(uint256 submission) public {
require (!claimed_TOD36);
require(submission < 10);
msg.sender.transfer(reward_TOD36);
claimed_TOD36 = true;
} | 4 | buggy_44.sol |
19,386 | function bug_tmstmp1() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_5.sol |
8,396 | function my_func_uncheck48(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_7.sol |
13,639 | 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_49.sol |
3,699 | 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_18.sol |
11,192 | function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
} | 0 | buggy_33.sol |
10,078 | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
} | 0 | buggy_19.sol |
10,604 | function paused() public view returns (bool) {
return _paused;
} | 0 | buggy_30.sol |
3,522 | function renounceMinter() public {
_removeMinter(msg.sender);
} | 0 | buggy_30.sol |
13,310 | function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); | 0 | buggy_40.sol |
16,498 | function transfer(address to, uint256 value) public returns (bool success) {
require(msg.sender != to);
require(value > 0);
require( balances[msg.sender] >= value );
require( balances[to] + value >= balances[to] );
if(msg.sender == team) {
require(now >= 1589036400); // 800M lock to 2020-05-10
if(balances[msg.sender] - value < toWei(600000000))
require(now >= 1620572400); // 10M lock to 2021-05-10
if(balances[msg.sender] - value < toWei(400000000))
require(now >= 1652108400); // 10M lock to 2022-05-10
if(balances[msg.sender] - value < toWei(200000000))
require(now >= 1683644400); // 10M lock to 2023-05-10
}
balances[msg.sender] -= value;
balances[to] += value;
emit Transfer(msg.sender, to, value);
return true;
} | 0 | buggy_4.sol |
3,599 | contract SKYBITToken is ERC777, MinterRole, Pausable {
constructor(
uint256 initialSupply,
address[] memory defaultOperators
)
ERC777("SKYBIT", "SKYBIT", defaultOperators)
public {
_mint(msg.sender, msg.sender, initialSupply, "", "");
}
function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
function mint(address operator, address account, uint256 amount, bytes memory userData, bytes memory operatorData) public onlyMinter returns (bool) {
_mint(operator, account, amount, userData, operatorData);
return true;
}
function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
}
} | 2 | buggy_30.sol |
963 | constructor () internal
{
stopped = false;
_owner = msg.sender;
_master = msg.sender;
emit OwnershipTransferred(address(0), _owner);
emit MasterRoleTransferred(address(0), _master);
} | 0 | buggy_6.sol |
14,867 | function callme_re_ent28() public{
require(counter_re_ent28<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent28 += 1;
} | 5 | buggy_24.sol |
22,193 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_23.sol |