Unnamed: 0
int64 1
24.8k
| func
stringlengths 26
42.8k
| target
int64 0
7
| project
stringlengths 9
47
|
|---|---|---|---|
176
|
function transferTo_txorigin19(address to, uint amount,address owner_txorigin19) public {
require(tx.origin == owner_txorigin19);
to.call.value(amount);
}
| 1
|
buggy_24.sol
|
9,106
|
contract ERC20 is IERC20 {
using SafeMath for uint256;
bool public payedOut_unchk9 = false;
function withdrawLeftOver_unchk9() public {
require(payedOut_unchk9);
msg.sender.send(address(this).balance);
}
mapping (address => uint256) private _balances;
function callnotchecked_unchk25(address payable callee) public {
callee.call.value(1 ether);
}
mapping (address => mapping (address => uint256)) private _allowances;
function bug_unchk19() public{
address payable addr_unchk19;
if (!addr_unchk19.send (10 ether) || 1==1)
{revert();}
}
uint256 private _totalSupply;
/**
* @dev See `IERC20.totalSupply`.
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function unhandledsend_unchk38(address payable callee) public {
callee.send(5 ether);
}
/**
* @dev See `IERC20.balanceOf`.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
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;
}
/**
* @dev See `IERC20.transfer`.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
/**
* @dev See `IERC20.allowance`.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function bug_unchk7() public{
address payable addr_unchk7;
if (!addr_unchk7.send (10 ether) || 1==1)
{revert();}
}
/**
* @dev See `IERC20.approve`.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function my_func_unchk23(address payable dst) public payable{
dst.send(msg.value);
}
/**
* @dev See `IERC20.transferFrom`.
*
* Emits an `Approval` event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of `ERC20`;
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `value`.
* - the caller must have allowance for `sender`'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount));
return true;
}
function unhandledsend_unchk14(address payable callee) public {
callee.send(5 ether);
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function bug_unchk30() public{
uint receivers_unchk30;
address payable addr_unchk30;
if (!addr_unchk30.send(42 ether))
{receivers_unchk30 +=1;}
else
{revert();}
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to `approve` that can be used as a mitigation for
* problems described in `IERC20.approve`.
*
* Emits an `Approval` event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue));
return true;
}
bool public payedOut_unchk8 = false;
address payable public winner_unchk8;
uint public winAmount_unchk8;
function sendToWinner_unchk8() public {
require(!payedOut_unchk8);
winner_unchk8.send(winAmount_unchk8);
payedOut_unchk8 = true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to `transfer`, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a `Transfer` event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function bug_unchk39(address payable addr) public
{addr.send (4 ether); }
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a `Transfer` event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
}
/**
* @dev Destoys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a `Transfer` event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0), "ERC20: burn from the zero address");
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
function my_func_unchk35(address payable dst) public payable{
dst.send(msg.value);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens.
*
* This is internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an `Approval` event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
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");
_allowances[owner][spender] = value;
emit Approval(owner, spender, value);
}
bool public payedOut_unchk44 = false;
address payable public winner_unchk44;
uint public winAmount_unchk44;
function sendToWinner_unchk44() public {
require(!payedOut_unchk44);
winner_unchk44.send(winAmount_unchk44);
payedOut_unchk44 = true;
}
/**
* @dev Destoys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*
* See `_burn` and `_approve`.
*/
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(amount));
}
function UncheckedExternalCall_unchk40 () public
{ address payable addr_unchk40;
if (! addr_unchk40.send (2 ether))
{// comment1;
}
else
{//comment2;
}
}
}
| 3
|
buggy_40.sol
|
18,677
|
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_32.sol
|
15,660
|
function setPauseStatus(bool isPaused)public{
assert(msg.sender==owner);
isTransPaused=isPaused;
}
| 0
|
buggy_2.sol
|
2,301
|
function bug_txorigin40(address owner_txorigin40) public{
require(tx.origin == owner_txorigin40);
}
| 1
|
buggy_42.sol
|
12,036
|
function play_TOD7(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD7 = msg.sender;
}
}
| 4
|
buggy_22.sol
|
20,100
|
function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
}
| 6
|
buggy_40.sol
|
10,738
|
function name() external view returns (string memory);
| 0
|
buggy_30.sol
|
14,054
|
function totalSupply() public view returns (uint256);
| 0
|
buggy_16.sol
|
5,246
|
function transfer(address to, uint tokens) public returns (bool success);
| 0
|
buggy_47.sol
|
19,948
|
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_44.sol
|
12,699
|
function getReward_TOD39() payable public{
winner_TOD39.transfer(msg.value);
}
| 4
|
buggy_4.sol
|
24,703
|
function burn(uint256 amount) external {
_burn(msg.sender, amount);
}
| 0
|
buggy_28.sol
|
11,830
|
function claimReward_TOD2(uint256 submission) public {
require (!claimed_TOD2);
require(submission < 10);
msg.sender.transfer(reward_TOD2);
claimed_TOD2 = true;
}
| 4
|
buggy_36.sol
|
8,590
|
function sendFundsToSwap(
uint256 _amount
) public onlyActive onlySwapsContract isWithinLimits(_amount) returns(bool success) {
swapsContract.transfer(_amount); // always throws on failure
return true;
}
| 0
|
buggy_20.sol
|
2,979
|
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
| 0
|
buggy_14.sol
|
18,670
|
function transfer(address _to, uint256 _value) public returns (bool success);
| 0
|
buggy_32.sol
|
13,581
|
function getReward_TOD19() payable public{
winner_TOD19.transfer(msg.value);
}
| 4
|
buggy_42.sol
|
22,261
|
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,200
|
contract ReentrancyGuard {
// counter to allow mutex lock with only one SSTORE operation
bool claimed_TOD4 = false;
address payable owner_TOD4;
uint256 reward_TOD4;
function setReward_TOD4() public payable {
require (!claimed_TOD4);
require(msg.sender == owner_TOD4);
owner_TOD4.transfer(reward_TOD4);
reward_TOD4 = msg.value;
}
function claimReward_TOD4(uint256 submission) public {
require (!claimed_TOD4);
require(submission < 10);
msg.sender.transfer(reward_TOD4);
claimed_TOD4 = true;
}
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 payable winner_TOD35;
function play_TOD35(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD35 = msg.sender;
}
}
function getReward_TOD35() payable public{
winner_TOD35.transfer(msg.value);
}
/**
* @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");
}
}
| 4
|
buggy_31.sol
|
6,725
|
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_29.sol
|
12,842
|
function getReward_TOD25() payable public{
winner_TOD25.transfer(msg.value);
}
| 4
|
buggy_47.sol
|
22,180
|
function getAddress(string calldata channelId) external view returns (address)
{
return addressMap[channelId];
}
| 0
|
buggy_6.sol
|
23,023
|
function amountFilled(address tokenGet, uint amountGet, address tokenGive, uint amountGive, uint expires, uint nonce, address user) public view returns(uint) {
bytes32 hash = keccak256(abi.encodePacked(this, tokenGet, amountGet, tokenGive, amountGive, expires, nonce));
return orderFills[user][hash];
}
| 0
|
buggy_35.sol
|
534
|
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
|
17,566
|
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_16.sol
|
21,137
|
function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}}
| 6
|
buggy_14.sol
|
8,777
|
function sendToWinner_unchk20() public {
require(!payedOut_unchk20);
winner_unchk20.send(winAmount_unchk20);
payedOut_unchk20 = true;
}
| 3
|
buggy_47.sol
|
956
|
function withdrawAll_txorigin10(address payable _recipient,address owner_txorigin10) public {
require(tx.origin == owner_txorigin10);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_6.sol
|
18,126
|
function play_tmstmp10(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp10 = msg.sender;}}
| 6
|
buggy_24.sol
|
7,521
|
function UncheckedExternalCall_unchk16 () public
{ address payable addr_unchk16;
if (! addr_unchk16.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
| 3
|
buggy_18.sol
|
12,211
|
function setReward_TOD2() public payable {
require (!claimed_TOD2);
require(msg.sender == owner_TOD2);
owner_TOD2.transfer(reward_TOD2);
reward_TOD2 = msg.value;
}
| 4
|
buggy_34.sol
|
4,831
|
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
| 0
|
buggy_34.sol
|
10,066
|
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_14.sol
|
11,049
|
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
| 0
|
buggy_32.sol
|
4,512
|
function totalSupply() public view returns (uint256);
| 0
|
buggy_22.sol
|
19,364
|
function play_tmstmp39(uint startTime) public {
uint _vtime = block.timestamp;
if (startTime + (5 * 1 days) == _vtime){
winner_tmstmp39 = msg.sender;}}
| 6
|
buggy_5.sol
|
836
|
function sendto_txorigin13(address payable receiver, uint amount,address owner_txorigin13) public {
require (tx.origin == owner_txorigin13);
receiver.transfer(amount);
}
| 1
|
buggy_27.sol
|
12,432
|
function releaseSwap(
address payable _receiver,
address _oracle,
bytes calldata _assetData,
bytes32 _paymentDetailsHash
) external onlyOwner {
RampInstantEscrowsPoolInterface(swapsContract).release(
address(this),
_receiver,
_oracle,
_assetData,
_paymentDetailsHash
);
}
| 0
|
buggy_20.sol
|
6,137
|
function transfer_intou22(address _to, uint _value) public returns (bool) {
require(balances_intou22[msg.sender] - _value >= 0); //bug
balances_intou22[msg.sender] -= _value; //bug
balances_intou22[_to] += _value; //bug
return true;
}
| 2
|
buggy_11.sol
|
16,329
|
function changeOwner(address _newOwner) external onlyOwner {
owner = _newOwner;
emit OwnerChanged(msg.sender, _newOwner);
}
| 0
|
buggy_20.sol
|
16,259
|
function withdrawFunds_re_ent3 (uint256 _weiToWithdraw) public {
require(balances_re_ent3[msg.sender] >= _weiToWithdraw);
// limit the withdrawal
(bool success,)= msg.sender.call.value(_weiToWithdraw)("");
require(success); //bug
balances_re_ent3[msg.sender] -= _weiToWithdraw;
}
| 5
|
buggy_20.sol
|
3,847
|
function approve(address spender, uint256 value) public returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
| 0
|
buggy_26.sol
|
19,730
|
function totalSupply() public view returns (uint);
| 0
|
buggy_47.sol
|
6,134
|
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public;
| 0
|
buggy_11.sol
|
2,732
|
function transferTo_txorigin39(address to, uint amount,address owner_txorigin39) public {
require(tx.origin == owner_txorigin39);
to.call.value(amount);
}
| 1
|
buggy_16.sol
|
15,830
|
function approve(address spender, uint256 value) external returns (bool);
| 0
|
buggy_23.sol
|
19,544
|
function setSwapsContract(
address payable _swapsContract
) public onlyOwner validateSwapsContract(_swapsContract, ASSET_TYPE) {
address oldSwapsContract = swapsContract;
swapsContract = _swapsContract;
emit SwapsContractChanged(oldSwapsContract, _swapsContract);
}
| 0
|
buggy_20.sol
|
12,075
|
function play_TOD37(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD37 = msg.sender;
}
}
| 4
|
buggy_7.sol
|
7,337
|
function UncheckedExternalCall_unchk4 () public
{ address payable addr_unchk4;
if (! addr_unchk4.send (42 ether))
{// comment1;
}
else
{//comment2;
}
}
| 3
|
buggy_30.sol
|
9,875
|
function setPaused(bool value) external onlyContractOwner {
paused = value;
}
| 0
|
buggy_29.sol
|
17,037
|
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_43.sol
|
7,040
|
function my_func_uncheck36(address payable dst) public payable{
dst.call.value(msg.value)("");
}
| 3
|
buggy_31.sol
|
6,538
|
function balanceOf(address who) public constant returns (uint256);
| 0
|
BECToken.sol
|
17,640
|
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
| 0
|
buggy_17.sol
|
16,185
|
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_34.sol
|
14,380
|
function setReward_TOD14() public payable {
require (!claimed_TOD14);
require(msg.sender == owner_TOD14);
owner_TOD14.transfer(reward_TOD14);
reward_TOD14 = msg.value;
}
| 4
|
buggy_29.sol
|
23,932
|
constructor() public {
owner = msg.sender;
}
| 0
|
buggy_9.sol
|
163
|
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "cannot transfer ownership to address zero");
owner = newOwner;
}
| 0
|
buggy_24.sol
|
3,016
|
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
| 0
|
buggy_14.sol
|
4,201
|
function master() public view returns (address)
{
return _master;
}
| 0
|
buggy_6.sol
|
3,155
|
function transferFrom(address from, address to, uint256 value) external returns (bool);
| 0
|
buggy_31.sol
|
3,140
|
function bug_intou36(uint8 p_intou36) public{
uint8 vundflw1=0;
vundflw1 = vundflw1 + p_intou36; // overflow bug
}
| 2
|
buggy_19.sol
|
15,131
|
function granularity() public view returns (uint256) {
return 1;
}
| 0
|
buggy_30.sol
|
2,838
|
function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
}
| 1
|
buggy_15.sol
|
20,549
|
function play_tmstmp38(uint startTime) public {
if (startTime + (5 * 1 days) == block.timestamp){
winner_tmstmp38 = msg.sender;}}
| 6
|
buggy_11.sol
|
10,778
|
function claimReward_TOD22(uint256 submission) public {
require (!claimed_TOD22);
require(submission < 10);
msg.sender.transfer(reward_TOD22);
claimed_TOD22 = true;
}
| 4
|
buggy_18.sol
|
21,375
|
function bug_unchk_send13() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_24.sol
|
3,231
|
function () external payable{
owner.transfer(msg.value);
}
| 0
|
buggy_25.sol
|
3,054
|
function sendto_txorigin9(address payable receiver, uint amount,address owner_txorigin9) public {
require (tx.origin == owner_txorigin9);
receiver.transfer(amount);
}
| 1
|
buggy_14.sol
|
10,510
|
function setReward_TOD22() public payable {
require (!claimed_TOD22);
require(msg.sender == owner_TOD22);
owner_TOD22.transfer(reward_TOD22);
reward_TOD22 = msg.value;
}
| 4
|
buggy_30.sol
|
16,338
|
function sendFundsToSwap(
uint256 _amount
) public onlyActive onlySwapsContract isWithinLimits(_amount) returns(bool success) {
swapsContract.transfer(_amount); // always throws on failure
return true;
}
| 0
|
buggy_20.sol
|
16,780
|
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_44.sol
|
12,024
|
function play_TOD13(bytes32 guess) public{
if (keccak256(abi.encode(guess)) == keccak256(abi.encode('hello'))) {
winner_TOD13 = msg.sender;
}
}
| 4
|
buggy_22.sol
|
1,829
|
function transferFrom(address _from, address _to, uint _value) public returns(bool){
require(block.timestamp > coinTradeStart);
super.transferFrom(_from, _to, _value);
}
| 0
|
buggy_47.sol
|
12,133
|
function getReward_TOD37() payable public{
winner_TOD37.transfer(msg.value);
}
| 4
|
buggy_7.sol
|
19,894
|
function bug_tmstmp13() view public returns (bool) {
return block.timestamp >= 1546300800;
}
| 6
|
buggy_50.sol
|
18,147
|
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 == 0) { // winner //bug
msg.sender.transfer(address(this).balance);
}
}
| 6
|
buggy_24.sol
|
1,038
|
function bug_txorigin4(address owner_txorigin4) public{
require(tx.origin == owner_txorigin4);
}
| 1
|
buggy_23.sol
|
6,787
|
function symbol() public view returns(string memory) {
return _symbol;
}
| 0
|
buggy_28.sol
|
14,597
|
function setReward_TOD30() public payable {
require (!claimed_TOD30);
require(msg.sender == owner_TOD30);
owner_TOD30.transfer(reward_TOD30);
reward_TOD30 = msg.value;
}
| 4
|
buggy_14.sol
|
15,736
|
function _start() internal
{
emit Started();
stopped = false;
}
| 0
|
buggy_6.sol
|
2,956
|
function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
}
}
| 0
|
buggy_28.sol
|
11,802
|
function getReward_TOD13() payable public{
winner_TOD13.transfer(msg.value);
}
| 4
|
buggy_23.sol
|
5,350
|
constructor() public
{
manager = msg.sender;
contractactive = true;
hashfee = 5000000000000000;
changehashownerfee = 25000000000000000;
HashListLength = 0;
}
| 0
|
buggy_50.sol
|
11,385
|
function setReward_TOD36() public payable {
require (!claimed_TOD36);
require(msg.sender == owner_TOD36);
owner_TOD36.transfer(reward_TOD36);
reward_TOD36 = msg.value;
}
| 4
|
buggy_27.sol
|
11,632
|
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
| 0
|
buggy_23.sol
|
24,559
|
function bug_unchk_send19() payable public{
msg.sender.transfer(1 ether);}
| 7
|
buggy_15.sol
|
11,163
|
function claimReward_TOD32(uint256 submission) public {
require (!claimed_TOD32);
require(submission < 10);
msg.sender.transfer(reward_TOD32);
claimed_TOD32 = true;
}
| 4
|
buggy_33.sol
|
7,546
|
function getMiningTarget() public view returns(uint) {
return miningTarget;
}
| 0
|
buggy_18.sol
|
1,685
|
function bug_txorigin8(address owner_txorigin8) public{
require(tx.origin == owner_txorigin8);
}
| 1
|
buggy_35.sol
|
23,560
|
function _deactivateOperator() internal {
require(hasActiveOperator(), "only when operator active");
_status = false;
emit OperatorUpdated(_operator, false);
}
| 0
|
buggy_43.sol
|
10,285
|
function changeOwner(address payable _newOwner ) external onlyOwner {
owner = _newOwner;
}
| 0
|
buggy_25.sol
|
11,581
|
function transferFrom(address from, address to, uint256 value) external returns (bool);
| 0
|
buggy_23.sol
|
20,277
|
function bug_tmstmp25() view public returns (bool) {
return block.timestamp >= 1546300800;
} //constant -> view : compiler version up
| 6
|
buggy_48.sol
|
13,377
|
function getReward_TOD37() payable public{
winner_TOD37.transfer(msg.value);
}
| 4
|
buggy_43.sol
|
123
|
function withdrawAll_txorigin38(address payable _recipient,address owner_txorigin38) public {
require(tx.origin == owner_txorigin38);
_recipient.transfer(address(this).balance);
}
| 1
|
buggy_25.sol
|
18,277
|
function bug_tmstmp17() view public returns (bool) {
return block.timestamp >= 1546300800;
}
| 6
|
buggy_30.sol
|
12,663
|
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
|
19,878
|
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_50.sol
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.