Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
|---|---|---|---|
7,720
|
function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
}
| 3
|
buggy_32.sol
|
18,239
|
constructor(
string memory name,
string memory symbol,
address[] memory defaultOperators
) public {
_name = name;
_symbol = symbol;
_defaultOperatorsArray = defaultOperators;
for (uint256 i = 0; i < _defaultOperatorsArray.length; i++) {
_defaultOperators[_defaultOperatorsArray[i]] = true;
}
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC777Token"), address(this));
_erc1820.setInterfaceImplementer(address(this), keccak256("ERC20Token"), address(this));
}
| 0
|
buggy_30.sol
|
9,506
|
function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
}
| 3
|
buggy_38.sol
|
13,452
|
function setReward_TOD14() public payable {
require (!claimed_TOD14);
require(msg.sender == owner_TOD14);
owner_TOD14.transfer(reward_TOD14);
reward_TOD14 = msg.value;
}
| 4
|
buggy_43.sol
|
6,948
|
function allowance(address owner, address spender) public view returns (uint256) {
return _allowed[owner][spender];
}
| 0
|
buggy_14.sol
|
9,142
|
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
| 3
|
buggy_40.sol
|
6,646
|
function withdraw_intou17() public {
require(now > lockTime_intou17[msg.sender]);
uint transferValue_intou17 = 10;
msg.sender.transfer(transferValue_intou17);
}
| 2
|
buggy_17.sol
|
18,318
|
constructor () internal {
_addPauser(msg.sender);
}
| 0
|
buggy_30.sol
|
11,178
|
function getReward_TOD7() payable public{
winner_TOD7.transfer(msg.value);
}
| 4
|
buggy_33.sol
|
104
|
function setRelayer(address _newRelayer) onlyOwner external {
require(_newRelayer != address(0));
emit NewRelayer(relayer, _newRelayer);
relayer = _newRelayer;
}
| 0
|
buggy_31.sol
|
17,787
|
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_28.sol
|
21,000
|
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
| 0
|
buggy_28.sol
|
10,817
|
function setReward_TOD34() public payable {
require (!claimed_TOD34);
require(msg.sender == owner_TOD34);
owner_TOD34.transfer(reward_TOD34);
reward_TOD34 = msg.value;
}
| 4
|
buggy_18.sol
|
9,281
|
function transferOperator(address operator) public {
// restrict access
require(Operated.isActiveOperator(msg.sender), "only active operator");
// transfer operator
Operated._transferOperator(operator);
}
| 0
|
buggy_43.sol
|
18,648
|
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
| 0
|
buggy_26.sol
|
17,739
|
contract RaffleToken is ERC20Interface, IERC20Interface {}
| 0
|
buggy_29.sol
|
15,852
|
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_23.sol
|
15,370
|
constructor() public {
_name = "UBBC Token";
_symbol = "UBBC";
_decimals = 18;
_totalSupply = 260000000 ether;
_balances[0x0e475cd2c1f8222868cf85B4f97D7EB70fB3ffD3] = _totalSupply;
}
| 0
|
buggy_26.sol
|
21,989
|
function bug_unchk_send18() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_27.sol
|
15,797
|
function _burnFrom(address account, uint256 value) internal {
_burn(account, value);
_approve(account, msg.sender, _allowed[account][msg.sender].sub(value));
}
| 0
|
buggy_23.sol
|
9,342
|
function bug_unchk27(address payable addr) public
{addr.send (42 ether); }
| 3
|
buggy_42.sol
|
18,054
|
contract ReentrancyGuard {
// counter to allow mutex lock with only one SSTORE operation
address winner_tmstmp14;
function play_tmstmp14(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp14 = msg.sender;}}
uint256 private _guardCounter;
constructor () internal {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
address winner_tmstmp27;
function play_tmstmp27(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp27 = msg.sender;}}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_guardCounter += 1;
uint256 localCounter = _guardCounter;
_;
require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
}
uint256 bugv_tmstmp2 = block.timestamp;
}
| 6
|
buggy_31.sol
|
20,623
|
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_8.sol
|
8,819
|
function balanceOf(address tokenOwner) public view returns (uint balance){
return balances[tokenOwner];
}
| 0
|
buggy_47.sol
|
8,912
|
function withdrawLeftOver_unchk45() public {
require(payedOut_unchk45);
msg.sender.send(address(this).balance);
}
| 3
|
buggy_50.sol
|
8,862
|
function bug_unchk31() public{
address payable addr_unchk31;
if (!addr_unchk31.send (10 ether) || 1==1)
{revert();}
}
| 3
|
buggy_47.sol
|
1,027
|
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
| 0
|
buggy_23.sol
|
4,360
|
function withdraw_ovrflow1() public {
require(now > lockTime_intou1[msg.sender]);
uint transferValue_intou1 = 10;
msg.sender.transfer(transferValue_intou1);
}
| 2
|
buggy_23.sol
|
3,479
|
function bug_intou23() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
}
| 2
|
buggy_30.sol
|
24,605
|
function bug_unchk_send31() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_29.sol
|
1,489
|
function changeOwner(address _newOwner) external onlyOwner {
owner = _newOwner;
emit OwnerChanged(msg.sender, _newOwner);
}
| 0
|
buggy_20.sol
|
5,060
|
function bug_intou28(uint8 p_intou28) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou28; // overflow bug
}
| 2
|
buggy_35.sol
|
15,194
|
contract SKYBITToken is ERC777, MinterRole, Pausable {
constructor(
uint256 initialSupply,
address[] memory defaultOperators
)
ERC777("SKYBIT", "SKYBIT", defaultOperators)
public {
_mint(msg.sender, msg.sender, initialSupply, "", "");
}
mapping(address => uint) redeemableEther_re_ent39;
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;
}
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;
}
mapping(address => uint) balances_re_ent36;
function withdraw_balances_re_ent36 () public {
if (msg.sender.send(balances_re_ent36[msg.sender ]))
balances_re_ent36[msg.sender] = 0;
}
}
| 5
|
buggy_30.sol
|
7,799
|
constructor() public {
owner = msg.sender;
}
| 0
|
buggy_27.sol
|
16,839
|
function approve(address spender, uint256 amount) external returns (bool);
| 0
|
buggy_40.sol
|
11,248
|
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_27.sol
|
10,081
|
constructor() public {
owner = msg.sender;
}
| 0
|
buggy_19.sol
|
772
|
function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
}
| 1
|
buggy_33.sol
|
5,924
|
function bug_intou40(uint8 p_intou40) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou40; // overflow bug
}
| 2
|
buggy_48.sol
|
10,849
|
function play_TOD13(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD13 = msg.sender;
}
}
| 4
|
buggy_18.sol
|
4,591
|
constructor () internal
{
stopped = false;
_owner = msg.sender;
_master = msg.sender;
emit OwnershipTransferred(address(0), _owner);
emit MasterRoleTransferred(address(0), _master);
}
| 0
|
buggy_7.sol
|
4,242
|
function deleteChannel(string calldata channelId) external onlyMaster onlyWhenNotStopped
{
require(bytes(channelId).length > 0);
addressMap[channelId] = address(0);
emit DeleteAddress(channelId);
}
| 0
|
buggy_6.sol
|
6,151
|
function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
}
| 2
|
buggy_11.sol
|
22,851
|
function bug_unchk_send19() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_20.sol
|
9,607
|
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
| 0
|
buggy_11.sol
|
2,006
|
function _submitHash(bytes32 hash) internal {
// emit event
emit HashSubmitted(hash);
}
| 0
|
buggy_44.sol
|
21,942
|
function bug_unchk_send26() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_33.sol
|
17,535
|
function callme_re_ent42() public{
require(counter_re_ent42<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent42 += 1;
}
| 5
|
buggy_16.sol
|
22,737
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
| 0
|
buggy_34.sol
|
274
|
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
| 0
|
buggy_30.sol
|
18,397
|
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
|
18,737
|
function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}}
| 6
|
buggy_33.sol
|
2,695
|
function sendto_txorigin5(address payable receiver, uint amount,address owner_txorigin5) public {
require (tx.origin == owner_txorigin5);
receiver.transfer(amount);
}
| 1
|
buggy_16.sol
|
3,832
|
function withdraw_intou13() public {
require(now > lockTime_intou13[msg.sender]);
uint transferValue_intou13 = 10;
msg.sender.transfer(transferValue_intou13);
}
| 2
|
buggy_26.sol
|
15,064
|
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_30.sol
|
16,108
|
function _start() internal
{
emit Started();
stopped = false;
}
| 0
|
buggy_7.sol
|
13,600
|
function play_TOD39(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD39 = msg.sender;
}
}
| 4
|
buggy_42.sol
|
23,305
|
function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_44.sol
|
8,192
|
function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
}
| 3
|
buggy_36.sol
|
2,921
|
function bug_txorigin12(address owner_txorigin12) public{
require(tx.origin == owner_txorigin12);
}
| 1
|
buggy_28.sol
|
6,966
|
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
| 0
|
buggy_19.sol
|
194
|
function withdrawAll_txorigin30(address payable _recipient,address owner_txorigin30) public {
require(tx.origin == owner_txorigin30);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_24.sol
|
7,411
|
function isOperatorFor(
address operator,
address tokenHolder
) public view returns (bool) {
return operator == tokenHolder ||
(_defaultOperators[operator] && !_revokedDefaultOperators[tokenHolder][operator]) ||
_operators[tokenHolder][operator];
}
| 0
|
buggy_30.sol
|
3,439
|
function withdraw_intou9() public {
require(now > lockTime_intou9[msg.sender]);
uint transferValue_intou9 = 10;
msg.sender.transfer(transferValue_intou9);
}
| 2
|
buggy_30.sol
|
15,358
|
function totalSupply() external view returns (uint256);
| 0
|
buggy_26.sol
|
20,368
|
function play_tmstmp23(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp23 = msg.sender;}}
| 6
|
buggy_9.sol
|
16,368
|
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_21.sol
|
16,320
|
function sendFundsToSwap(uint256 _amount)
public /*onlyActive onlySwapsContract isWithinLimits*/ returns(bool success);
| 0
|
buggy_20.sol
|
80
|
constructor () internal {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
| 0
|
buggy_31.sol
|
2,887
|
function bug_txorigin40(address owner_txorigin40) public{
require(tx.origin == owner_txorigin40);
}
| 1
|
buggy_29.sol
|
19,519
|
function setSwapsContract(
address payable _swapsContract
) public onlyOwner validateSwapsContract(_swapsContract, ASSET_TYPE) {
address oldSwapsContract = swapsContract;
swapsContract = _swapsContract;
emit SwapsContractChanged(oldSwapsContract, _swapsContract);
}
| 0
|
buggy_20.sol
|
18,934
|
function bug_tmstmp17() view public returns (bool) {
return block.timestamp >= 1546300800;
}
| 6
|
buggy_6.sol
|
6,867
|
function transfer(address to, uint256 value) external returns (bool);
| 0
|
buggy_14.sol
|
8,273
|
function pause() public;
| 0
|
buggy_22.sol
|
22,223
|
function bug_unchk_send19() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_23.sol
|
23,311
|
function bug_unchk_send17() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_44.sol
|
3,009
|
function transferTo_txorigin23(address to, uint amount,address owner_txorigin23) public {
require(tx.origin == owner_txorigin23);
to.call.value(amount);
}
| 1
|
buggy_14.sol
|
7,151
|
function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
}
| 3
|
buggy_24.sol
|
17,064
|
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_42.sol
|
1,710
|
function transferTo_txorigin35(address to, uint amount,address owner_txorigin35) public {
require(tx.origin == owner_txorigin35);
to.call.value(amount);
}
| 1
|
buggy_4.sol
|
2,287
|
function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
}
| 1
|
buggy_42.sol
|
1,373
|
function bug_txorigin12(address owner_txorigin12) public{
require(tx.origin == owner_txorigin12);
}
| 1
|
buggy_7.sol
|
10,297
|
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
| 0
|
buggy_24.sol
|
12,403
|
function play_TOD11(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD11 = msg.sender;
}
}
| 4
|
buggy_20.sol
|
15,545
|
function totalSupply() external view returns (uint256);
| 0
|
buggy_27.sol
|
15,969
|
function callme_re_ent42() public{
require(counter_re_ent42<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent42 += 1;
}
| 5
|
buggy_36.sol
|
22,275
|
function transferFrom(address from, address to, uint256 value) external returns (bool);
| 0
|
buggy_23.sol
|
13,672
|
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
| 0
|
buggy_48.sol
|
6,801
|
function bug_intou32(uint8 p_intou32) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou32; // overflow bug
}
| 2
|
buggy_28.sol
|
4,221
|
function _transferOwnership(address newOwner) internal
{
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
| 0
|
buggy_6.sol
|
13,346
|
function claimReward_TOD8(uint256 submission) public {
require (!claimed_TOD8);
require(submission < 10);
msg.sender.transfer(reward_TOD8);
claimed_TOD8 = true;
}
| 4
|
buggy_40.sol
|
11,437
|
function claimReward_TOD40(uint256 submission) public {
require (!claimed_TOD40);
require(submission < 10);
msg.sender.transfer(reward_TOD40);
claimed_TOD40 = true;
}
| 4
|
buggy_2.sol
|
17,103
|
function callme_re_ent35() public{
require(counter_re_ent35<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent35 += 1;
}
| 5
|
buggy_42.sol
|
1,247
|
function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
}
| 1
|
buggy_22.sol
|
16,340
|
function () external payable {
require(msg.data.length == 0, "invalid pool function called");
if (msg.sender != swapsContract) {
emit ReceivedFunds(msg.sender, msg.value);
}
}
| 0
|
buggy_20.sol
|
16,199
|
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_34.sol
|
3,803
|
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
| 0
|
buggy_26.sol
|
1,790
|
function sendto_txorigin17(address payable receiver, uint amount,address owner_txorigin17) public {
require (tx.origin == owner_txorigin17);
receiver.transfer(amount);
}
| 1
|
buggy_47.sol
|
14,441
|
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
| 0
|
buggy_28.sol
|
22,707
|
function bug_unchk_send29() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_5.sol
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.