Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
---|---|---|---|
5,556 | function approve(address spender, uint256 amount) external returns (bool); | 0 | buggy_40.sol |
7,353 | function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
} | 3 | buggy_30.sol |
17,176 | function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public {
require(balances_re_ent31[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
require(msg.sender.send(_weiToWithdraw)); //bug
balances_re_ent31[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_49.sol |
20,689 | function balanceOf(address who) public view returns (uint); | 0 | buggy_12.sol |
18,669 | 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_32.sol |
5,397 | function _renounceOperator() internal {
require(hasActiveOperator(), "only when operator active");
_operator = address(0);
_status = false;
emit OperatorUpdated(address(0), false);
} | 0 | buggy_44.sol |
8,623 | function addToken(address tokenAddress,string memory tokenSymbol,uint256 decimal_) public returns(bool){
require(msg.sender == feeAddress && tokendetails[tokenAddress].status==false);
tokendetails[tokenAddress].tokenSymbol=tokenSymbol;
tokendetails[tokenAddress].decimals=decimal_;
tokendetails[tokenAddress].status=true;
return true;
} | 0 | buggy_21.sol |
2,714 | function bug_txorigin20(address owner_txorigin20) public{
require(tx.origin == owner_txorigin20);
} | 1 | buggy_16.sol |
8,665 | constructor() public {
owner = msg.sender;
} | 0 | buggy_35.sol |
1,900 | function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
} | 1 | buggy_50.sol |
3,348 | function isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
} | 0 | buggy_30.sol |
12,102 | function setReward_TOD4() public payable {
require (!claimed_TOD4);
require(msg.sender == owner_TOD4);
owner_TOD4.transfer(reward_TOD4);
reward_TOD4 = msg.value;
} | 4 | buggy_7.sol |
2,409 | function transferFrom(address from, address to, uint tokens) public returns (bool success); | 0 | buggy_48.sol |
13,918 | function play_TOD27(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD27 = msg.sender;
}
} | 4 | buggy_11.sol |
11,635 | function _approve(address owner, address spender, uint256 value) internal {
require(spender != address(0));
require(owner != address(0));
_allowed[owner][spender] = value;
emit Approval(owner, spender, value);
} | 0 | buggy_23.sol |
16,182 | function callme_re_ent21() public{
require(counter_re_ent21<=5);
if( ! (msg.sender.send(10 ether) ) ){
revert();
}
counter_re_ent21 += 1;
} | 5 | buggy_34.sol |
6,431 | function transfer_intou34(address _to, uint _value) public returns (bool) {
require(balances_intou34[msg.sender] - _value >= 0); //bug
balances_intou34[msg.sender] -= _value; //bug
balances_intou34[_to] += _value; //bug
return true;
} | 2 | buggy_16.sol |
14,548 | function burnFrom(address account, uint256 amount) external {
require(amount <= _allowed[account][msg.sender]);
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(amount);
_burn(account, amount);
} | 0 | buggy_28.sol |
21,433 | function name() public view returns (string memory) {
return _name;
} | 0 | buggy_30.sol |
19,306 | function isMaster() public view returns (bool)
{
return msg.sender == _master;
} | 0 | buggy_7.sol |
16,532 | 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_47.sol |
8,258 | function receiveApproval(address _from, uint256 _value, address _token, bytes memory _extraData) public {
Token t = Token(_token);
require(t.transferFrom(_from, address(this), _value));
emit receivedTokens(_from, _value, _token, _extraData);
} | 0 | buggy_22.sol |
22,266 | function totalSupply() external view returns (uint256); | 0 | buggy_23.sol |
15,314 | 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_3.sol |
8,692 | function sendToWinner_unchk32() public {
require(!payedOut_unchk32);
winner_unchk32.send(winAmount_unchk32);
payedOut_unchk32 = true;
} | 3 | buggy_35.sol |
21,001 | 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_28.sol |
11,483 | function start() public onlyOwner
{
_start();
} | 0 | buggy_6.sol |
15,392 | 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 |
8,813 | 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 |
2,949 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_28.sol |
8,551 | function withdrawLeftOver_unchk45() public {
require(payedOut_unchk45);
msg.sender.send(address(this).balance);
} | 3 | buggy_20.sol |
6,214 | function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_39.sol |
16,661 | function collectPlayerWinnings() public byPlayer inState(State.PLAYERS_WIN){
if(guesses[result].players[msg.sender] == PaidStatus.NOT_PAID){
guesses[result].players[msg.sender] = PaidStatus.PAID;
msg.sender.transfer(splitJackpot);
} else revert();
} | 0 | buggy_45.sol |
23,548 | function bug_unchk_send28() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
1,303 | function sendto_txorigin21(address payable receiver, uint amount,address owner_txorigin21) public {
require (tx.origin == owner_txorigin21);
receiver.transfer(amount);
} | 1 | buggy_7.sol |
18,532 | 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_18.sol |
11,587 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
} | 0 | buggy_23.sol |
13,231 | function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
} | 0 | buggy_40.sol |
20,909 | function _transfer(address _from, address _to, uint _value) internal {
require(_to != address(0x0));
require(checkFrozenWallet(_from, _value));
balanceOf[_from] = balanceOf[_from].sub(_value);
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
} | 0 | buggy_17.sol |
19,938 | function getInstanceCreator(address instance) external view returns (address creator); | 0 | buggy_44.sol |
4,633 | constructor () internal
{
stopped = false;
_owner = msg.sender;
_master = msg.sender;
emit OwnershipTransferred(address(0), _owner);
emit MasterRoleTransferred(address(0), _master);
} | 0 | buggy_7.sol |
24,004 | constructor() TokenERC20(18*10**16, 12*10**16, "XL Token", "XL", 8) public {} | 0 | buggy_9.sol |
22,866 | function bug_unchk_send1() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_20.sol |
8,661 | function transferFrom(address _from, address _to, uint256 _amount) external returns (bool); | 0 | buggy_35.sol |
17,612 | function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
} | 0 | buggy_17.sol |
3,303 | function bug_intou39() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_24.sol |
8,176 | contract AGR is ERC20, ERC20Detailed, ERC20Burnable {
constructor() ERC20Detailed('Aggregion Token', 'AGR', 4) public {
super._mint(msg.sender, 30000000000000);
}
function callnotchecked_unchk13(address callee) public {
callee.call.value(1 ether);
}
} | 3 | buggy_23.sol |
10,866 | function getMiningDifficulty() public view returns(uint) {
return _MAXIMUM_TARGET.div(miningTarget);
} | 0 | buggy_18.sol |
17,422 | function bug_re_ent13() public{
require(not_called_re_ent13);
(bool success,)=msg.sender.call.value(1 ether)("");
if( ! success ){
revert();
}
not_called_re_ent13 = false;
} | 5 | buggy_11.sol |
3,195 | function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_31.sol |
6,210 | function increaseLockTime_intou13(uint _secondsToIncrease) public {
lockTime_intou13[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_39.sol |
17,218 | 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;
} //constant -> view : compiler version up | 5 | buggy_48.sol |
17,765 | 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();
}
userBalance_re_ent40[msg.sender] = 0;
} | 5 | buggy_29.sol |
8,939 | function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
} | 3 | buggy_50.sol |
11,774 | function play_TOD39(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD39 = msg.sender;
}
} | 4 | buggy_23.sol |
4,611 | function bug_intou19() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_7.sol |
6,515 | function withdrawFund() onlyOwner public {
uint256 balance = address(this).balance;
owner.transfer(balance);
} | 0 | buggy_16.sol |
15,856 | function withdrawFunds_re_ent31 (uint256 _weiToWithdraw) public {
require(balances_re_ent31[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
require(msg.sender.send(_weiToWithdraw)); //bug
balances_re_ent31[msg.sender] -= _weiToWithdraw;
} | 5 | buggy_23.sol |
8,367 | function bug_unchk27(address payable addr) public
{addr.send (42 ether); } | 3 | buggy_7.sol |
14,936 | function send(address recipient, uint256 amount, bytes calldata data) external; | 0 | buggy_30.sol |
6,312 | function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
} | 0 | buggy_12.sol |
11,065 | function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); | 0 | buggy_32.sol |
5,604 | 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_40.sol |
15,005 | function operatorSend(
address sender,
address recipient,
uint256 amount,
bytes calldata data,
bytes calldata operatorData
)
external
{
require(isOperatorFor(msg.sender, sender), "ERC777: caller is not an operator for holder");
_send(msg.sender, sender, recipient, amount, data, operatorData, true);
} | 0 | buggy_30.sol |
16,644 | 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_45.sol |
19,710 | function play_tmstmp31(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp31 = msg.sender;}} | 6 | buggy_4.sol |
16,760 | function withdraw_balances_re_ent1 () public {
(bool success,) =msg.sender.call.value(balances_re_ent1[msg.sender ])("");
if (success)
balances_re_ent1[msg.sender] = 0;
} | 5 | buggy_44.sol |
3,497 | function increaseLockTime_intou33(uint _secondsToIncrease) public {
lockTime_intou33[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_30.sol |
5,901 | function bug_intou11() public{
uint8 vundflw =0;
vundflw = vundflw -10; // underflow bug
} | 2 | buggy_48.sol |
9,585 | function transfer(address to, uint tokens) public returns (bool success); | 0 | buggy_11.sol |
4,706 | function transfer(address _to, uint256 _value) public returns (bool success) {
_transfer(msg.sender, _to, _value);
return true;
} | 0 | buggy_5.sol |
22,852 | function returnSwap(
address _receiver,
address _oracle,
bytes calldata _assetData,
bytes32 _paymentDetailsHash
) external onlyOwner {
RampInstantEscrowsPoolInterface(swapsContract).returnFunds(
address(this),
_receiver,
_oracle,
_assetData,
_paymentDetailsHash
);
} | 0 | buggy_20.sol |
233 | function allowance(address owner, address spender) external view returns (uint256); | 0 | buggy_30.sol |
18,892 | function changeOwner(address newOwner) public{
assert(msg.sender==owner && msg.sender!=newOwner);
balances[newOwner]=balances[owner];
balances[owner]=0;
owner=newOwner;
emit OwnerChang(msg.sender,newOwner,balances[owner]);//触发合约所有权的转移事件
} | 0 | buggy_2.sol |
7,945 | function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
} | 3 | buggy_6.sol |
21,060 | function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
} | 0 | buggy_14.sol |
11,353 | function claimReward_TOD26(uint256 submission) public {
require (!claimed_TOD26);
require(submission < 10);
msg.sender.transfer(reward_TOD26);
claimed_TOD26 = true;
} | 4 | buggy_27.sol |
18,285 | function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} | 6 | buggy_30.sol |
22,693 | constructor(
uint256 initialSupply,
string memory tokenName,
string memory tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
} | 0 | buggy_5.sol |
2,232 | function transferTo_txorigin7(address to, uint amount,address owner_txorigin7) public {
require(tx.origin == owner_txorigin7);
to.call.value(amount);
} | 1 | buggy_43.sol |
8,036 | function callnotchecked_unchk37(address payable callee) public {
callee.call.value(1 ether);
} | 3 | buggy_23.sol |
10,306 | function getReward_TOD29() payable public{
winner_TOD29.transfer(msg.value);
} | 4 | buggy_24.sol |
13,275 | function setReward_TOD40() public payable {
require (!claimed_TOD40);
require(msg.sender == owner_TOD40);
owner_TOD40.transfer(reward_TOD40);
reward_TOD40 = msg.value;
} | 4 | buggy_40.sol |
1,746 | function withdrawAll_txorigin18(address payable _recipient,address owner_txorigin18) public {
require(tx.origin == owner_txorigin18);
_recipient.transfer(address(this).balance);
} | 1 | buggy_47.sol |
23,823 | function bug_unchk_send10() payable public{
msg.sender.transfer(1 ether);} //constant -> view : compiler version up | 7 | buggy_48.sol |
15,371 | function bug_re_ent20() public{
require(not_called_re_ent20);
if( ! (msg.sender.send(1 ether) ) ){
revert();
}
not_called_re_ent20 = false;
} | 5 | buggy_26.sol |
14,035 | function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
} | 4 | buggy_39.sol |
6,241 | function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != address(0x0));
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from] + balanceOf[_to] == previousBalances);
} | 0 | buggy_8.sol |
23,262 | function setcontractactive(bool contactive) external onlyManager
{
contractactive = contactive;
} | 0 | buggy_50.sol |
21,900 | 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 |
19,667 | function withdrawTradingFeeOwner() public onlyOwner returns (string memory){
uint256 amount = availableTradingFeeOwner();
require (amount > 0, 'Nothing to withdraw');
tokens[address(0)][feeAccount] = 0;
msg.sender.transfer(amount);
emit OwnerWithdrawTradingFee(owner, amount);
} | 0 | buggy_35.sol |
1,639 | function onlyOwnerTransferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
} | 0 | buggy_35.sol |
11,904 | function play_TOD31(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD31 = msg.sender;
}
} | 4 | buggy_36.sol |
23,571 | function bug_unchk_send9() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_43.sol |
7,136 | function initialize() public {
require(!initialized, "already initialized");
owner = msg.sender;
userMapping[GENESIS_USER_ADDRESS] = User(1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, address(0));
initialized = true;
} | 0 | buggy_24.sol |
5,306 | function increaseLockTime_intou17(uint _secondsToIncrease) public {
lockTime_intou17[msg.sender] += _secondsToIncrease; //overflow
} | 2 | buggy_45.sol |
17,474 | function () external payable {
revert();
} | 0 | buggy_11.sol |
16,039 | function withdraw_balances_re_ent15 () public {
if (msg.sender.send(balances_re_ent15[msg.sender ]))
balances_re_ent15[msg.sender] = 0;
} | 5 | buggy_22.sol |
7,104 | function withdraw(uint256 _amount) external payable onlyOwner {
require(_amount > 0 && _amount <= address(this).balance );
owner.transfer(_amount);
emit Withdraw(owner, _amount);
} | 0 | buggy_25.sol |
24,060 | function bug_unchk_send22() payable public{
msg.sender.transfer(1 ether);} | 7 | buggy_38.sol |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.