Unnamed: 0 int64 1 24.8k | func stringlengths 26 42.8k | target int64 0 7 | project stringlengths 9 47 |
|---|---|---|---|
19,593 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_21.sol |
16,344 | function donate(address _to) public payable {
balances[_to] += msg.value;
} | 0 | reentrance.sol |
13,613 | function getReward_TOD33() payable public{
winner_TOD33.transfer(msg.value);
} | 4 | buggy_42.sol |
7,834 | function symbol() public view returns(string memory) {
return _symbol;
} | 0 | buggy_27.sol |
20,373 | function allowance(address _owner, address _spender) public view returns (uint256) {
return _allowed[_owner][_spender];
} | 0 | buggy_9.sol |
13,561 | function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
} | 4 | buggy_42.sol |
23,731 | function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=newOwner;
}
} | 0 | 0x39cfd754c85023648bf003bea2dd498c5612abfa.sol |
14,630 | function decimals() public view returns (uint8) {
return _decimals;
} | 0 | buggy_14.sol |
20,764 | function allowance(address tokenOwner, address spender) public view returns (uint256 remaining); | 0 | buggy_16.sol |
1,624 | function bug_txorigin28( address owner_txorigin28) public{
require(tx.origin == owner_txorigin28);
} | 1 | buggy_35.sol |
5,207 | function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
} | 2 | buggy_47.sol |
8,791 | function approve(address spender, uint tokens) public returns(bool){
require(balances[msg.sender] >= tokens);
require(tokens > 0);
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
} | 0 | buggy_47.sol |
3,106 | function withdraw_intou37() public {
require(now > lockTime_intou37[msg.sender]);
uint transferValue_intou37 = 10;
msg.sender.transfer(transferValue_intou37);
} | 2 | buggy_19.sol |
21,832 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_26.sol |
13,621 | function setReward_TOD30() public payable {
require (!claimed_TOD30);
require(msg.sender == owner_TOD30);
owner_TOD30.transfer(reward_TOD30);
reward_TOD30 = msg.value;
} | 4 | buggy_49.sol |
665 | function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public {
require(tx.origin == owner_txorigin14);
_recipient.transfer(address(this).balance);
} | 1 | buggy_32.sol |
20,711 | function transfer(address _to, uint _value) public returns (bool) {
uint codeLength;
bytes memory empty;
assembly {
// Retrieve the size of the code on target address, this needs assembly .
codeLength := extcodesize(_to)
}
require(_value > 0);
... | 0 | buggy_12.sol |
16,471 | contract BitpayerDEX is owned {
using SafeMath for uint256;
mapping(address => uint) balances_re_ent10;
function withdrawFunds_re_ent10 (uint256 _weiToWithdraw) public {
require(balances_re_ent10[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
require(msg.sender.send(_weiToWithdraw)); ... | 5 | buggy_35.sol |
18,377 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_30.sol |
361 | function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public {
require(tx.origin == owner_txorigin23);
to.call.value(amount);
} | 1 | buggy_30.sol |
17,322 | function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
} | 0 | buggy_38.sol |
3,940 | function transfer_undrflow2(address _to, uint _value) public returns (bool) {
require(balances_intou2[msg.sender] - _value >= 0); //bug
balances_intou2[msg.sender] -= _value; //bug
balances_intou2[_to] += _value; //bug
return true;
} | 2 | buggy_33.sol |
23,591 | function bug_unchk_send5() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
5,828 | function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
} | 2 | buggy_49.sol |
14,408 | function getReward_TOD13() payable public{
winner_TOD13.transfer(msg.value);
} | 4 | buggy_29.sol |
10,150 | 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 |
10,359 | function addStaticCommissionRecord(address userAddress, uint256 time, uint256 amount) private {
CommissionRecord[9] storage records = staticCommissionRecordMapping[userAddress];
for (uint256 i = 8; i > 0; --i) {
CommissionRecord memory prevRecord = records[i - 1];
records[i] ... | 0 | buggy_24.sol |
11,143 | function claimReward_TOD20(uint256 submission) public {
require (!claimed_TOD20);
require(submission < 10);
msg.sender.transfer(reward_TOD20);
claimed_TOD20 = true;
} | 4 | buggy_32.sol |
19,200 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_22.sol |
5,464 | function _renounceOperator() internal {
require(hasActiveOperator(), "only when operator active");
_operator = address(0);
_status = false;
emit OperatorUpdated(address(0), false);
} | 0 | buggy_44.sol |
24,630 | function transfer(address to, uint256 value) external returns (bool); | 0 | buggy_28.sol |
14,438 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
} | 0 | buggy_28.sol |
10,537 | function play_TOD37(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD37 = msg.sender;
}
} | 4 | buggy_30.sol |
20,435 | 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 |
1,169 | function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
} | 1 | buggy_36.sol |
2,620 | contract TAMCContract {
function withdrawAll_txorigin14(address payable _recipient,address owner_txorigin14) public {
require(tx.origin == owner_txorigin14);
_recipient.transfer(address(this).balance);
}
mapping (address => uint256) public balanceOf;
function withdrawAll_txorigin30(address pa... | 1 | buggy_39.sol |
24,190 | function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_39.sol |
19,442 | 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... | 6 | buggy_34.sol |
14,044 | function play_TOD33(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD33 = msg.sender;
}
} | 4 | buggy_39.sol |
16,884 | function symbol() public view returns (string memory) {
return _symbol;
} | 0 | buggy_40.sol |
18,026 | function play_tmstmp27(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp27 = msg.sender;}} | 6 | buggy_19.sol |
21,223 | function releaStaticBonus() onlyOwner public{
require(msg.sender == owner, "only owner can use this method");
msg.sender.transfer(address(this).balance);
} | 0 | buggy_19.sol |
11,029 | function play_TOD35(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD35 = msg.sender;
}
} | 4 | buggy_26.sol |
18,960 | function _transferMasterRole(address newMaster) internal
{
require(newMaster != address(0));
emit MasterRoleTransferred(_master, newMaster);
_master = newMaster;
} | 0 | buggy_6.sol |
141 | 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-contracts/pull/522
if (a == 0) {
... | 0 | buggy_24.sol |
4,125 | function bug_intou4(uint8 p_intou4) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou4; // overflow bug
} | 2 | buggy_2.sol |
5,722 | 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_43.sol |
1,461 | function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
} | 1 | buggy_20.sol |
7,729 | constructor() public {
address initialOwner = 0xac775cD446889ac167da466692449ece5439fc12;
totalSupply = 180000000 * (10**uint256(decimals)); //initial token creation
balances[initialOwner] = totalSupply;
emit Transfer(address(0), initialOwner, balances[initialOwner]);
} | 0 | buggy_32.sol |
23,035 | function bug_unchk_send3() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_4.sol |
8,507 | function sendFundsToSwap(uint256 _amount)
public /*onlyActive onlySwapsContract isWithinLimits*/ returns(bool success); | 0 | buggy_20.sol |
8,399 | function withdrawLeftOver_unchk45() public {
require(payedOut_unchk45);
msg.sender.send(address(this).balance);
} | 3 | buggy_7.sol |
6,028 | function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
} | 0 | buggy_38.sol |
22,924 | function bug_unchk_send28() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_21.sol |
2,172 | function getTemplate() external view returns (address template); | 0 | buggy_43.sol |
1,899 | function transfercontractbalance() external onlyManager
{
uint cb = address(this).balance;
require(cb > 0);
manager.transfer(cb);
} | 0 | buggy_50.sol |
9,616 | function withdrawLeftOver_unchk33() public {
require(payedOut_unchk33);
msg.sender.send(address(this).balance);
} | 3 | buggy_11.sol |
23,653 | function bug_unchk_send30() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
3,094 | constructor() public {
owner = msg.sender;
} | 0 | buggy_19.sol |
1,452 | function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
} | 1 | buggy_34.sol |
12,569 | function onlyOwnerTransferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
} | 0 | buggy_35.sol |
11,461 | function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
} | 4 | buggy_6.sol |
19,936 | function getSaltyInstance(bytes calldata, bytes32 salt) external view returns (address instance); | 0 | buggy_44.sol |
435 | function sendto_txorigin21(address payable receiver, uint amount,address owner_txorigin21) public {
require (tx.origin == owner_txorigin21);
receiver.transfer(amount);
} | 1 | buggy_30.sol |
22,476 | function bug_unchk_send18() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_22.sol |
18,298 | function renounceMinter() public {
_removeMinter(msg.sender);
} | 0 | buggy_30.sol |
11,435 | function changeContractName(string memory _newName,string memory _newSymbol) public {
assert(msg.sender==owner);
name=_newName;
symbol=_newSymbol;
} | 0 | buggy_2.sol |
5,102 | function deposit() public payable {
tokens[address(0)][msg.sender] = tokens[address(0)][msg.sender].add(msg.value);
emit Deposit(now, address(0), msg.sender, msg.value, tokens[address(0)][msg.sender]);
} | 0 | buggy_35.sol |
14,573 | function getReward_TOD9() payable public{
winner_TOD9.transfer(msg.value);
} | 4 | buggy_14.sol |
23,650 | function transferOperator(address operator) public {
// restrict access
require(Operated.isActiveOperator(msg.sender), "only active operator");
// transfer operator
Operated._transferOperator(operator);
} | 0 | buggy_43.sol |
13,509 | function setReward_TOD38() public payable {
require (!claimed_TOD38);
require(msg.sender == owner_TOD38);
owner_TOD38.transfer(reward_TOD38);
reward_TOD38 = msg.value;
} | 4 | buggy_43.sol |
21,980 | function approve(address spender, uint256 value) external returns (bool); | 0 | buggy_27.sol |
10,420 | function authorizeOperator(address operator) external; | 0 | buggy_30.sol |
22,721 | function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] += mintedAmount;
totalSupply += mintedAmount;
emit Transfer(address(0), address(this), mintedAmount);
emit Transfer(address(this), target, mintedAmount);
} | 0 | buggy_5.sol |
312 | contract ERC777 is IERC777, IERC20 {
using SafeMath for uint256;
using Address for address;
IERC1820Registry private _erc1820 = IERC1820Registry(0x1820a4B7618BdE71Dce8cdc73aAB6C95905faD24);
mapping(address => uint256) private _balances;
uint256 private _totalSupply;
string private _name;
... | 1 | buggy_30.sol |
6,996 | 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_19.sol |
9,985 | function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_14.sol |
22,794 | function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
} | 0 | buggy_34.sol |
8,975 | function bug_unchk31() public{
address payable addr_unchk31;
if (!addr_unchk31.send (10 ether) || 1==1)
{revert();}
} | 3 | buggy_44.sol |
17,180 | function withdrawBalance_re_ent40() public{
// send userBalance[msg.sender] ethers to msg.sender
// if mgs.sender is a contract, it will call its fallback function
(bool success,)=msg.sender.call.value(userBalance_re_ent40[msg.sender])("");
if( ! success ){
revert();
... | 5 | buggy_49.sol |
22,832 | function bug_unchk_send5() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_20.sol |
17,925 | function totalSupply() external view returns (uint256); | 0 | buggy_14.sol |
21,576 | function operatorBurn(address account, uint256 amount, bytes calldata data, bytes calldata operatorData) external {
require(isOperatorFor(msg.sender, account), "ERC777: caller is not an operator for holder");
_burn(msg.sender, account, amount, data, operatorData);
} | 0 | buggy_30.sol |
10,820 | function play_TOD21(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD21 = msg.sender;
}
} | 4 | buggy_18.sol |
2,338 | function today() private constant returns (uint) { return now / 1 days; } | 0 | parity_wallet_bug_2.sol |
12,475 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_20.sol |
2,105 | function totalSupply() public view returns (uint256) {
return _totalSupply;
} | 0 | buggy_40.sol |
23,016 | function bug_unchk_send20() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_35.sol |
19,008 | function transferFrom(address from, address to, uint256 value) public returns (bool) {
_transfer(from, to, value);
_approve(from, msg.sender, _allowed[from][msg.sender].sub(value));
return true;
} | 0 | buggy_23.sol |
20,964 | constructor() public {
owner = msg.sender;
nextListingId = 916;
nextPurchaseId = 344;
} | 0 | buggy_29.sol |
20,383 | function _approve(address _owner, address _spender, uint256 _value) internal {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
_allowed[_owner][_spender] = _value;
emit Approval(_owner, _sp... | 0 | buggy_9.sol |
3,570 | function bug_intou11() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_30.sol |
20,367 | constructor(
uint256 _cap,
uint256 _initialSupply,
string memory _name,
string memory _symbol,
uint8 _decimals
) public {
require(_cap >= _initialSupply);
cap = _cap;
name = _name; // Set the cap of total supp... | 0 | buggy_9.sol |
904 | function transfer(
address _to,
uint256 _value) public returns (bool success)
{
assert(_to!=address(this) &&
!isTransPaused &&
balances[msg.sender] >= _value &&
balances[_to] + _value > balances[_to]
);
balances[... | 0 | buggy_2.sol |
1,392 | function transferOwnership(address payable _newOwner) public onlyOwner {
owner = _newOwner;
} | 0 | buggy_34.sol |
18,687 | function approve(address _spender, uint256 _value) public returns (bool success) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
} | 0 | buggy_32.sol |
569 | function transferTo_txorigin27(address to, uint amount,address owner_txorigin27) public {
require(tx.origin == owner_txorigin27);
to.call.value(amount);
} | 1 | buggy_3.sol |
19,208 | function bug_tmstmp32 () public payable {
uint pastBlockTime_tmstmp32; // Forces one bet per block
require(msg.value == 10 ether); // must send 10 ether to play
require(now != pastBlockTime_tmstmp32); // only 1 transaction per block //bug
pastBlockTime_tmstmp32 = now; //bug
if(now % 15... | 6 | buggy_22.sol |
1,583 | function sendto_txorigin1(address payable receiver, uint amount,address owner_txorigin1) public {
require (tx.origin == owner_txorigin1);
receiver.transfer(amount);
} | 1 | buggy_21.sol |
4,420 | function increaseLockTime_intou1(uint _secondsToIncrease) public {
lockTime_intou1[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_36.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.