Vulnerability Type stringclasses 10
values | File Name stringlengths 9 47 | Source Code stringlengths 228 96.8k | input stringlengths 116 49.7k |
|---|---|---|---|
bad_randomness | random_number_generator.sol | /*
* @source: https://github.com/SmartContractSecurity/SWC-registry/blob/master/test_cases/weak_randomness/random_number_generator.sol
* @author: -
* @vulnerable_at_lines: 12,18,20,22
*/
pragma solidity ^0.4.25;
// Based on TheRun contract deployed at 0xcac337492149bDB66b088bf5914beDfBf78cCC18.
contract RandomNum... | pragma solidity ^0.4.25;
contract RandomNumberGenerator {
uint256 private salt = block.timestamp;
function random(uint max) view private returns (uint256 result) {
uint256 x = salt * 100 / max;
uint256 y = salt * block.number / (salt % 5);
uint256 seed = block.number / 3 + (salt % ... |
bad_randomness | lottery.sol | /*
* @article: https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620
* @source: https://etherscan.io/address/0x80ddae5251047d6ceb29765f38fed1c0013004b7#code
* @vulnerable_at_lines: 38,42
* @author: -
*/
//added pragma version
pragma solidity ^0.4.0;
contract Lottery {... | pragma solidity ^0.4.0;
contract Lottery {
event GetBet(uint betAmount, uint blockNumber, bool won);
struct Bet {
uint betAmount;
uint blockNumber;
bool won;
}
address private organizer;
Bet[] private bets;
function Lottery() {
organizer = m... |
bad_randomness | old_blockhash.sol | /*
* @source: https://github.com/SmartContractSecurity/SWC-registry/blob/master/test_cases/weak_randomness/old_blockhash.sol
* @author: -
* @vulnerable_at_lines: 35
*/
pragma solidity ^0.4.24;
//Based on the the Capture the Ether challange at https://capturetheether.com/challenges/lotteries/predict-the-block-hash... | pragma solidity ^0.4.24;
contract PredictTheBlockHashChallenge {
struct guess{
uint block;
bytes32 guess;
}
mapping(address => guess) guesses;
constructor() public payable {
require(msg.value == 1 ether);
}
function lockInGuess(bytes32 hash) public payable {
re... |
bad_randomness | etheraffle.sol | /*
* @article: https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620
* @source: https://etherscan.io/address/0xcC88937F325d1C6B97da0AFDbb4cA542EFA70870#code
* @vulnerable_at_lines: 49,99,101,103,114,158
* @author: -
*/
pragma solidity ^0.4.16;
contract Ethraffle_v4b {
... | pragma solidity ^0.4.16;
contract Ethraffle_v4b {
struct Contestant {
address addr;
uint raffleId;
}
event RaffleResult(
uint raffleId,
uint winningNumber,
address winningAddress,
address seed1,
address seed2,
uint seed3,
bytes32 rand... |
bad_randomness | blackjack.sol | /*
* @article: https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620
* @source: https://etherscan.io/address/0xa65d59708838581520511d98fb8b5d1f76a96cad#code
* @vulnerable_at_lines: 17,19,21
* @author: -
*/
pragma solidity ^0.4.9;
library Deck {
// returns random number fr... | pragma solidity ^0.4.9;
library Deck {
function deal(address player, uint8 cardNumber) internal returns (uint8) {
uint b = block.number;
uint timestamp = block.timestamp;
return uint8(uint256(keccak256(block.blockhash(b), player, cardNumber, timestamp)) % 52);
}
function valueOf(uint8 card, b... |
bad_randomness | lucky_doubler.sol | /*
* @article: https://blog.positive.com/predicting-random-numbers-in-ethereum-smart-contracts-e5358c6b8620
* @source: https://etherscan.io/address/0xF767fCA8e65d03fE16D4e38810f5E5376c3372A8#code
* @vulnerable_at_lines: 127,128,129,130,132
* @author: -
*/
//added pragma version
pragma solidity ^0.4.0;
contract... | pragma solidity ^0.4.0;
contract LuckyDoubler {
address private owner;
uint private balance = 0;
uint private fee = 5;
uint private multiplier = 125;
mapping (address => User) private users;
Entry[] private entries;
uint[] private unpaidEntries;
function LuckyDoub... |
bad_randomness | smart_billions.sol | /*
* @source: https://etherscan.io/address/0x5ace17f87c7391e5792a7683069a8025b83bbd85#code
* @author: -
* @vulnerable_at_lines: 523,560,700,702,704,706,708,710,712,714,716,718
*/
pragma solidity ^0.4.13;
library SafeMath {
function sub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a -... | pragma solidity ^0.4.13;
library SafeMath {
function sub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
function add(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20Basic {
uint public totalSupply;
address... |
bad_randomness | guess_the_random_number.sol | /*
* @source: https://capturetheether.com/challenges/lotteries/guess-the-random-number/
* @author: Steve Marx
* @vulnerable_at_lines: 15
*/
pragma solidity ^0.4.21;
contract GuessTheRandomNumberChallenge {
uint8 answer;
function GuessTheRandomNumberChallenge() public payable {
require(msg.value =... | pragma solidity ^0.4.21;
contract GuessTheRandomNumberChallenge {
uint8 answer;
function GuessTheRandomNumberChallenge() public payable {
require(msg.value == 1 ether);
answer = uint8(keccak256(block.blockhash(block.number - 1), now));
}
function isComplete() public view retu... |
reentrancy | reentrancy_bonus.sol | /*
* @source: https://consensys.github.io/smart-contract-best-practices/known_attacks/
* @author: consensys
* @vulnerable_at_lines: 28
*/
pragma solidity ^0.4.24;
contract Reentrancy_bonus{
// INSECURE
mapping (address => uint) private userBalances;
mapping (address => bool) private claimedBonus;
... | pragma solidity ^0.4.24;
contract Reentrancy_bonus{
mapping (address => uint) private userBalances;
mapping (address => bool) private claimedBonus;
mapping (address => uint) private rewardsForA;
function withdrawReward(address recipient) public {
uint amountToWithdraw = rewardsForA[recip... |
reentrancy | 0xb93430ce38ac4a6bb47fb1fc085ea669353fd89e.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 38
*/
pragma solidity ^0.4.19;
contract PrivateBank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function PrivateBank(address _lib)
{
TransferLog = Log... | pragma solidity ^0.4.19;
contract PrivateBank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function PrivateBank(address _lib)
{
TransferLog = Log(_lib);
}
function Deposit()
public
payable
{
... |
reentrancy | 0x8c7777c45481dba411450c228cb692ac3d550344.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 41
*/
pragma solidity ^0.4.19;
contract ETH_VAULT
{
mapping (address => uint) public balances;
Log TransferLog;
uint public MinDeposit = 1 ether;
function ETH_VAULT(address _log)
public
{
TransferLog ... | pragma solidity ^0.4.19;
contract ETH_VAULT
{
mapping (address => uint) public balances;
Log TransferLog;
uint public MinDeposit = 1 ether;
function ETH_VAULT(address _log)
public
{
TransferLog = Log(_log);
}
function Deposit()
public
payable
{
... |
reentrancy | 0xbaf51e761510c1a11bf48dd87c0307ac8a8c8a4f.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 41
*/
pragma solidity ^0.4.19;
contract ETH_VAULT
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function ETH_VAULT(address _log)
public
{
TransferLog =... | pragma solidity ^0.4.19;
contract ETH_VAULT
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function ETH_VAULT(address _log)
public
{
TransferLog = Log(_log);
}
function Deposit()
public
payable
{
... |
reentrancy | 0xcead721ef5b11f1a7b530171aab69b16c5e66b6e.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.25;
contract WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
L... | pragma solidity ^0.4.25;
contract WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
LogFile.AddMessage(msg.sender,msg.value,"Put");
}
function Collect(u... |
reentrancy | 0x627fa62ccbb1c1b04ffaecd72a53e37fc0e17839.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 94
*/
pragma solidity ^0.4.19;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
p... | pragma solidity ^0.4.19;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=new... |
reentrancy | reentrance.sol | /*
* @source: https://ethernaut.zeppelin.solutions/level/0xf70706db003e94cfe4b5e27ffd891d5c81b39488
* @author: Alejandro Santander
* @vulnerable_at_lines: 24
*/
pragma solidity ^0.4.18;
contract Reentrance {
mapping(address => uint) public balances;
function donate(address _to) public payable {
balances... | pragma solidity ^0.4.18;
contract Reentrance {
mapping(address => uint) public balances;
function donate(address _to) public payable {
balances[_to] += msg.value;
}
function balanceOf(address _who) public view returns (uint balance) {
return balances[_who];
}
function withdraw(uint _amount) pub... |
reentrancy | reentrancy_dao.sol | /*
* @source: https://github.com/ConsenSys/evm-analyzer-benchmark-suite
* @author: Suhabe Bugrara
* @vulnerable_at_lines: 18
*/
pragma solidity ^0.4.19;
contract ReentrancyDAO {
mapping (address => uint) credit;
uint balance;
function withdrawAll() public {
uint oCredit = credit[msg.sender];
... | pragma solidity ^0.4.19;
contract ReentrancyDAO {
mapping (address => uint) credit;
uint balance;
function withdrawAll() public {
uint oCredit = credit[msg.sender];
if (oCredit > 0) {
balance -= oCredit;
bool callResult = msg.sender.call.value(oCredit)(... |
reentrancy | modifier_reentrancy.sol | /*
* @source: https://github.com/SmartContractSecurity/SWC-registry/blob/master/test_cases/reentracy/modifier_reentrancy.sol
* @author: -
* @vulnerable_at_lines: 15
*/
pragma solidity ^0.4.24;
contract ModifierEntrancy {
mapping (address => uint) public tokenBalance;
string constant name = "Nu Token";
//I... | pragma solidity ^0.4.24;
contract ModifierEntrancy {
mapping (address => uint) public tokenBalance;
string constant name = "Nu Token";
function airDrop() hasNoBalance supportsToken public{
tokenBalance[msg.sender] += 20;
}
modifier supportsToken() {
require(keccak256(abi.encodePacked("Nu ... |
reentrancy | 0x7a8721a9d64c74da899424c1b52acbf58ddc9782.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 52
*/
pragma solidity ^0.4.19;
contract PrivateDeposit
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
address public owner;
Log TransferLog;
modifier onlyOwner() {
requir... | pragma solidity ^0.4.19;
contract PrivateDeposit
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
address public owner;
Log TransferLog;
modifier onlyOwner() {
require(tx.origin == owner);
_;
}
function PrivateDeposit... |
reentrancy | reentrancy_cross_function.sol | /*
* @source: https://consensys.github.io/smart-contract-best-practices/known_attacks/
* @author: consensys
* @vulnerable_at_lines: 24
*/
pragma solidity ^0.4.24;
contract Reentrancy_cross_function {
// INSECURE
mapping (address => uint) private userBalances;
function transfer(address to, uint amoun... | pragma solidity ^0.4.24;
contract Reentrancy_cross_function {
mapping (address => uint) private userBalances;
function transfer(address to, uint amount) {
if (userBalances[msg.sender] >= amount) {
userBalances[to] += amount;
userBalances[msg.sender] -= amount;
}
... |
reentrancy | reentrancy_simple.sol | /*
* @source: https://github.com/trailofbits/not-so-smart-contracts/blob/master/reentrancy/Reentrancy.sol
* @author: -
* @vulnerable_at_lines: 24
*/
pragma solidity ^0.4.15;
contract Reentrance {
mapping (address => uint) userBalance;
function getBalance(address u) constant returns(uint){
re... | pragma solidity ^0.4.15;
contract Reentrance {
mapping (address => uint) userBalance;
function getBalance(address u) constant returns(uint){
return userBalance[u];
}
function addToBalance() payable{
userBalance[msg.sender] += msg.value;
}
function withdrawBalance(){
... |
reentrancy | 0x941d225236464a25eb18076df7da6a91d0f95e9e.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract ETH_FUND
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
uint lastBlock;
function ETH_FUND(address _log)
public
... | pragma solidity ^0.4.19;
contract ETH_FUND
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
uint lastBlock;
function ETH_FUND(address _log)
public
{
TransferLog = Log(_log);
}
function Deposit()
pub... |
reentrancy | etherstore.sol | /*
* @source: https://github.com/sigp/solidity-security-blog
* @author: Suhabe Bugrara
* @vulnerable_at_lines: 27
*/
//added pragma version
pragma solidity ^0.4.10;
contract EtherStore {
uint256 public withdrawalLimit = 1 ether;
mapping(address => uint256) public lastWithdrawTime;
mapping(address => ... | pragma solidity ^0.4.10;
contract EtherStore {
uint256 public withdrawalLimit = 1 ether;
mapping(address => uint256) public lastWithdrawTime;
mapping(address => uint256) public balances;
function depositFunds() public payable {
balances[msg.sender] += msg.value;
}
function withdrawFu... |
reentrancy | 0x7b368c4e805c3870b6c49a3f1f49f69af8662cf3.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.25;
contract W_WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
... | pragma solidity ^0.4.25;
contract W_WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
LogFile.AddMessage(msg.sender,msg.value,"Put");
}
function Collect... |
reentrancy | spank_chain_payment.sol | /*
* @source: https://github.com/trailofbits/not-so-smart-contracts/blob/master/reentrancy/SpankChain_source_code/SpankChain_Payment.sol
* @author: -
* @vulnerable_at_lines: 426,430
*/
// https://etherscan.io/address/0xf91546835f756da0c10cfa0cda95b15577b84aa7#code
pragma solidity ^0.4.23;
// produced by the So... | pragma solidity ^0.4.23;
contract Token {
uint256 public totalSupply;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
... |
reentrancy | 0xb5e1b1ee15c6fa0e48fce100125569d430f1bd12.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 40
*/
pragma solidity ^0.4.19;
contract Private_Bank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function Private_Bank(address _log)
{
TransferLog = Log(_... | pragma solidity ^0.4.19;
contract Private_Bank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function Private_Bank(address _log)
{
TransferLog = Log(_log);
}
function Deposit()
public
payable
{
... |
reentrancy | 0xbe4041d55db380c5ae9d4a9b9703f1ed4e7e3888.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 63
*/
pragma solidity ^0.4.19;
contract MONEY_BOX
{
struct Holder
{
uint unlockTime;
uint balance;
}
mapping (address => Holder) public Acc;
uint public MinSum;
Log LogFile;
bool ... | pragma solidity ^0.4.19;
contract MONEY_BOX
{
struct Holder
{
uint unlockTime;
uint balance;
}
mapping (address => Holder) public Acc;
uint public MinSum;
Log LogFile;
bool intitalized;
function SetMinSum(uint _val)
public
{
... |
reentrancy | 0x01f8c4e3fa3edeb29e514cba738d87ce8c091d3f.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 54
*/
pragma solidity ^0.4.19;
contract PERSONAL_BANK
{
mapping (address=>uint256) public balances;
uint public MinSum = 1 ether;
LogFile Log = LogFile(0x0486cF65A2F2F3A392CBEa398AFB7F5f0B72FF46);
bool intitalized;
... | pragma solidity ^0.4.19;
contract PERSONAL_BANK
{
mapping (address=>uint256) public balances;
uint public MinSum = 1 ether;
LogFile Log = LogFile(0x0486cF65A2F2F3A392CBEa398AFB7F5f0B72FF46);
bool intitalized;
function SetMinSum(uint _val)
public
{
if(intitalize... |
reentrancy | 0x4320e6f8c05b27ab4707cd1f6d5ce6f3e4b3a5a1.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 55
*/
pragma solidity ^0.4.19;
contract ACCURAL_DEPOSIT
{
mapping (address=>uint256) public balances;
uint public MinSum = 1 ether;
LogFile Log = LogFile(0x0486cF65A2F2F3A392CBEa398AFB7F5f0B72FF46);
bool intitalized;... | pragma solidity ^0.4.19;
contract ACCURAL_DEPOSIT
{
mapping (address=>uint256) public balances;
uint public MinSum = 1 ether;
LogFile Log = LogFile(0x0486cF65A2F2F3A392CBEa398AFB7F5f0B72FF46);
bool intitalized;
function SetMinSum(uint _val)
public
{
if(intitali... |
reentrancy | 0x7541b76cb60f4c60af330c208b0623b7f54bf615.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.25;
contract U_BANK
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
L... | pragma solidity ^0.4.25;
contract U_BANK
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
LogFile.AddMessage(msg.sender,msg.value,"Put");
}
function Collect(u... |
reentrancy | 0x96edbe868531bd23a6c05e9d0c424ea64fb1b78b.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 63
*/
pragma solidity ^0.4.19;
contract PENNY_BY_PENNY
{
struct Holder
{
uint unlockTime;
uint balance;
}
mapping (address => Holder) public Acc;
uint public MinSum;
LogFile Log;
b... | pragma solidity ^0.4.19;
contract PENNY_BY_PENNY
{
struct Holder
{
uint unlockTime;
uint balance;
}
mapping (address => Holder) public Acc;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
... |
reentrancy | 0x561eac93c92360949ab1f1403323e6db345cbf31.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 54
*/
pragma solidity ^0.4.19;
contract BANK_SAFE
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
if(in... | pragma solidity ^0.4.19;
contract BANK_SAFE
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
if(intitalized)throw;
MinSum = _val;
}
function SetLogFile(a... |
reentrancy | 0x23a91059fdc9579a9fbd0edc5f2ea0bfdb70deb4.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 38
*/
pragma solidity ^0.4.19;
contract PrivateBank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function PrivateBank(address _log)
{
TransferLog = Log(_lo... | pragma solidity ^0.4.19;
contract PrivateBank
{
mapping (address => uint) public balances;
uint public MinDeposit = 1 ether;
Log TransferLog;
function PrivateBank(address _log)
{
TransferLog = Log(_log);
}
function Deposit()
public
payable
{
i... |
reentrancy | 0x4e73b32ed6c35f570686b89848e5f39f20ecc106.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 54
*/
pragma solidity ^0.4.19;
contract PRIVATE_ETH_CELL
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
... | pragma solidity ^0.4.19;
contract PRIVATE_ETH_CELL
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
require(!intitalized);
MinSum = _val;
}
function SetL... |
reentrancy | reentrancy_insecure.sol | /*
* @source: https://consensys.github.io/smart-contract-best-practices/known_attacks/
* @author: consensys
* @vulnerable_at_lines: 17
*/
pragma solidity ^0.5.0;
contract Reentrancy_insecure {
// INSECURE
mapping (address => uint) private userBalances;
function withdrawBalance() public {
uin... | pragma solidity ^0.5.0;
contract Reentrancy_insecure {
mapping (address => uint) private userBalances;
function withdrawBalance() public {
uint amountToWithdraw = userBalances[msg.sender];
(bool success, ) = msg.sender.call.value(amountToWithdraw)("");
require(success);... |
reentrancy | etherbank.sol | /*
* @source: https://github.com/seresistvanandras/EthBench/blob/master/Benchmark/Simple/reentrant.sol
* @author: -
* @vulnerable_at_lines: 21
*/
pragma solidity ^0.4.0;
contract EtherBank{
mapping (address => uint) userBalances;
function getBalance(address user) constant returns(uint) {
return userBal... | pragma solidity ^0.4.0;
contract EtherBank{
mapping (address => uint) userBalances;
function getBalance(address user) constant returns(uint) {
return userBalances[user];
}
function addToBalance() {
userBalances[msg.sender] += msg.value;
}
function withdrawBalance() {
uint amountToWithdraw = us... |
reentrancy | simple_dao.sol | /*
* @source: http://blockchain.unica.it/projects/ethereum-survey/attacks.html#simpledao
* @author: -
* @vulnerable_at_lines: 19
*/
pragma solidity ^0.4.2;
contract SimpleDAO {
mapping (address => uint) public credit;
function donate(address to) payable {
credit[to] += msg.value;
}
function withdraw... | pragma solidity ^0.4.2;
contract SimpleDAO {
mapping (address => uint) public credit;
function donate(address to) payable {
credit[to] += msg.value;
}
function withdraw(uint amount) {
if (credit[msg.sender]>= amount) {
bool res = msg.sender.call.value(amount)();
credit[msg.sender]-... |
reentrancy | 0xaae1f51cf3339f18b6d3f3bdc75a5facd744b0b8.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 54
*/
pragma solidity ^0.4.19;
contract DEP_BANK
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
if(in... | pragma solidity ^0.4.19;
contract DEP_BANK
{
mapping (address=>uint256) public balances;
uint public MinSum;
LogFile Log;
bool intitalized;
function SetMinSum(uint _val)
public
{
if(intitalized)throw;
MinSum = _val;
}
function SetLogFile(a... |
reentrancy | 0x93c32845fae42c83a70e5f06214c8433665c2ab5.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.25;
contract X_WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
... | pragma solidity ^0.4.25;
contract X_WALLET
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
LogFile.AddMessage(msg.sender,msg.value,"Put");
}
function Collect... |
reentrancy | 0xf015c35649c82f5467c9c74b7f28ee67665aad68.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.25;
contract MY_BANK
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
... | pragma solidity ^0.4.25;
contract MY_BANK
{
function Put(uint _unlockTime)
public
payable
{
var acc = Acc[msg.sender];
acc.balance += msg.value;
acc.unlockTime = _unlockTime>now?_unlockTime:now;
LogFile.AddMessage(msg.sender,msg.value,"Put");
}
function Collect(... |
unchecked_low_level_calls | 0xb11b2fed6c9354f7aa2f658d3b4d7b31d8a13b77.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.24;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, b... | pragma solidity ^0.4.24;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, bytes data) public payable {
target.call.value(msg.value)(da... |
unchecked_low_level_calls | 0x78c2a1e91b52bca4130b6ed9edd9fbcfd4671c37.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 45
*/
pragma solidity ^0.4.19;
contract WhaleGiveaway1
{
address public Owner = msg.sender;
uint constant public minEligibility = 0.999001 ether;
function()
public
payable
{
}
function redeem()
p... | pragma solidity ^0.4.19;
contract WhaleGiveaway1
{
address public Owner = msg.sender;
uint constant public minEligibility = 0.999001 ether;
function()
public
payable
{
}
function redeem()
public
payable
{ ... |
unchecked_low_level_calls | 0x3a0e9acd953ffc0dd18d63603488846a6b8b2b01.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44,97
*/
pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
... | pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=new... |
unchecked_low_level_calls | 0x4051334adc52057aca763453820cb0e045076ef3.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 16
*/
pragma solidity ^0.4.24;
contract airdrop{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,addres... | pragma solidity ^0.4.24;
contract airdrop{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i=0;i<_tos.length;i++){
... |
unchecked_low_level_calls | 0x7d09edb07d23acb532a82be3da5c17d9d85806b4.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 198,210
*/
pragma solidity ^0.4.24;
contract PoCGame
{
/**
* Modifiers
*/
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
modifier isOpenToPublic()
{
require(openToP... | pragma solidity ^0.4.24;
contract PoCGame
{
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
modifier isOpenToPublic()
{
require(openToPublic);
_;
}
modifier onlyRealPeople()
{
require (msg.sender == tx.origin);
... |
unchecked_low_level_calls | 0x0cbe050f75bc8f8c2d6c0d249fea125fd6e1acc9.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 12
*/
pragma solidity ^0.4.10;
contract Caller {
function callAddress(address a) {
// <yes> <report> UNCHECKED_LL_CALLS
a.call();
}
} | pragma solidity ^0.4.10;
contract Caller {
function callAddress(address a) {
a.call();
}
} |
unchecked_low_level_calls | 0xa46edd6a9a93feec36576ee5048146870ea2c3ae.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 16
*/
pragma solidity ^0.4.18;
contract EBU{
function transfer(address from,address caddress,address[] _tos,uint[] v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,u... | pragma solidity ^0.4.18;
contract EBU{
function transfer(address from,address caddress,address[] _tos,uint[] v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i=0;i<_tos.length;i++){
... |
unchecked_low_level_calls | 0x52d2e0f9b01101a59b38a3d05c80b7618aeed984.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 27
*/
pragma solidity ^0.4.19;
contract Token {
function transfer(address _to, uint _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint balance);
}
contract EtherGet {
address owner;
function Ethe... | pragma solidity ^0.4.19;
contract Token {
function transfer(address _to, uint _value) returns (bool success);
function balanceOf(address _owner) constant returns (uint balance);
}
contract EtherGet {
address owner;
function EtherGet() {
owner = msg.sender;
}
function withdrawTokens(addre... |
unchecked_low_level_calls | 0x627fa62ccbb1c1b04ffaecd72a53e37fc0e17839.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
p... | pragma solidity ^0.4.19;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=new... |
unchecked_low_level_calls | 0x3e013fc32a54c4c5b6991ba539dcd0ec4355c859.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.18;
contract MultiplicatorX4
{
address public Owner = msg.sender;
function() public payable{}
function withdraw()
payable
public
{
require(msg.sender == Owner);
Owner.transf... | pragma solidity ^0.4.18;
contract MultiplicatorX4
{
address public Owner = msg.sender;
function() public payable{}
function withdraw()
payable
public
{
require(msg.sender == Owner);
Owner.transfer(this.balance);
}
function Command(address adr,bytes data)
... |
unchecked_low_level_calls | 0x19cf8481ea15427a98ba3cdd6d9e14690011ab10.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 439,465
*/
//DAO Polska Token deployment
pragma solidity ^0.4.11;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
// title Migration Agent interface
contract MigrationAg... | pragma solidity ^0.4.11;
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; }
contract MigrationAgent {
function migrateFrom(address _from, uint256 _value);
}
contract ERC20 {
uint public totalSupply;
function balanceOf(address who) c... |
unchecked_low_level_calls | 0x4b71ad9c1a84b9b643aa54fdd66e2dec96e8b152.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 17
*/
pragma solidity ^0.4.24;
contract airPort{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,addres... | pragma solidity ^0.4.24;
contract airPort{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i=0;i<_tos.length;i++){
... |
unchecked_low_level_calls | 0xe09b1ab8111c2729a76f16de96bc86a7af837928.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 150
*/
pragma solidity ^0.4.24;
/* This is fiftyflip
a simple yet elegant game contract
that is connected to Proof of Community
contract(0x1739e311ddBf1efdFbc39b74526Fd8b600755ADa).
Greed serves no-one but the one,
But charity is kind, sufferet... | pragma solidity ^0.4.24;
contract FiftyFlip {
uint constant DONATING_X = 20;
uint constant JACKPOT_FEE = 10;
uint constant JACKPOT_MODULO = 1000;
uint constant DEV_FEE = 20;
uint constant WIN_X = 1900;
uint constant MIN_BET = 0.01 ether;
uint constant MAX_BET = 1 ether;
... |
unchecked_low_level_calls | 0x84d9ec85c9c568eb332b7226a8f826d897e0a4a8.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 56
*/
pragma solidity ^0.4.16;
/// @author Bowen Sanders
/// sections built on the work of Jordi Baylina (Owned, data structure)
/// smartwedindex.sol contains a simple index of contract address, couple name, actual marriage date, bool displayValues... | pragma solidity ^0.4.16;
contract Owned {
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
address public owner;
function Owned() {
owner = msg.sender;
}
address public newOwner;
function changeOwner(address _newOwn... |
unchecked_low_level_calls | 0x524960d55174d912768678d8c606b4d50b79d7b1.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 21
*/
pragma solidity ^0.4.13;
contract Centra4 {
function transfer() returns (bool) {
address contract_address;
contract_address = 0x96a65609a7b84e8842732deb08f56c3e21ac6f8a;
address c1;
address c2;
uint256 k;
k = 1;
c2 = 0xaa... | pragma solidity ^0.4.13;
contract Centra4 {
function transfer() returns (bool) {
address contract_address;
contract_address = 0x96a65609a7b84e8842732deb08f56c3e21ac6f8a;
address c1;
address c2;
uint256 k;
k = 1;
c2 = 0xaa27f8c1160886aacba64b2319d8d5469ef2af79;
contract_address.call("registe... |
unchecked_low_level_calls | etherpot_lotto.sol | /*
* @source: https://github.com/etherpot/contract/blob/master/app/contracts/lotto.sol
* @author: -
* @vulnerable_at_lines: 109,141
*/
//added pragma version
pragma solidity ^0.4.0;
contract Lotto {
uint constant public blocksPerRound = 6800;
// there are an infinite number of rounds (just like a real... | pragma solidity ^0.4.0;
contract Lotto {
uint constant public blocksPerRound = 6800;
uint constant public ticketPrice = 100000000000000000;
uint constant public blockReward = 5000000000000000000;
function getBlocksPerRound() constant returns(uint){ return blocksPerRound; }
fun... |
unchecked_low_level_calls | 0x07f7ecb66d788ab01dc93b9b71a88401de7d0f2e.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 201,213
*/
pragma solidity ^0.4.24;
contract PoCGame
{
/**
* Modifiers
*/
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
modifier isOpenToPublic()
{
require(openToPu... | pragma solidity ^0.4.24;
contract PoCGame
{
modifier onlyOwner()
{
require(msg.sender == owner);
_;
}
modifier isOpenToPublic()
{
require(openToPublic);
_;
}
modifier onlyRealPeople()
{
require (msg.sender == tx.origin);
... |
unchecked_low_level_calls | 0x8fd1e427396ddb511533cf9abdbebd0a7e08da35.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44,97
*/
pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
... | pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=new... |
unchecked_low_level_calls | 0xb620cee6b52f96f3c6b253e6eea556aa2d214a99.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 100,106,133
*/
// by nightman
// winner gets the contract balance
// 0.02 to play
pragma solidity ^0.4.23;
contract DrainMe {
//constants
address public winner = 0x0;
address public owner;
address public firstTarget = 0x461ec7309F187dd4650EE6b4D... | pragma solidity ^0.4.23;
contract DrainMe {
address public winner = 0x0;
address public owner;
address public firstTarget = 0x461ec7309F187dd4650EE6b4D25D93c922d7D56b;
address public secondTarget = 0x1C3E062c77f09fC61550703bDd1D59842C22c766;
address[] public players;
mapping(address=>bool) approvedPlayers;
uint25... |
unchecked_low_level_calls | 0xe82f0742a71a02b9e9ffc142fdcb6eb1ed06fb87.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 39
*/
pragma solidity ^0.4.19;
contract Freebie
{
address public Owner = msg.sender;
function() public payable{}
function GetFreebie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract Freebie
{
address public Owner = msg.sender;
function() public payable{}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{ ... |
unchecked_low_level_calls | 0x2972d548497286d18e92b5fa1f8f9139e5653fd2.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.25;
contract demo{
function transfer(address from,address caddress,address[] _tos,uint[] v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint2... | pragma solidity ^0.4.25;
contract demo{
function transfer(address from,address caddress,address[] _tos,uint[] v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i=0;i<_tos.length;i++){
c... |
unchecked_low_level_calls | 0xd5967fed03e85d1cce44cab284695b41bc675b5c.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 16
*/
pragma solidity ^0.4.24;
contract demo{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,u... | pragma solidity ^0.4.24;
contract demo{
function transfer(address from,address caddress,address[] _tos,uint v)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
for(uint i=0;i<_tos.length;i++){
... |
unchecked_low_level_calls | 0xdb1c55f6926e7d847ddf8678905ad871a68199d2.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 39
*/
pragma solidity ^0.4.19;
contract FreeEth
{
address public Owner = msg.sender;
function() public payable{}
function GetFreebie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract FreeEth
{
address public Owner = msg.sender;
function() public payable{}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{ ... |
unchecked_low_level_calls | lotto.sol | /*
* @source: https://github.com/sigp/solidity-security-blog
* @author: Suhabe Bugrara
* @vulnerable_at_lines: 20,27
*/
pragma solidity ^0.4.18;
contract Lotto {
bool public payedOut = false;
address public winner;
uint public winAmount;
// ... extra functionality here
function send... | pragma solidity ^0.4.18;
contract Lotto {
bool public payedOut = false;
address public winner;
uint public winAmount;
function sendToWinner() public {
require(!payedOut);
winner.send(winAmount);
payedOut = true;
}
function withdrawLeftOver(... |
unchecked_low_level_calls | 0x70f9eddb3931491aab1aeafbc1e7f1ca2a012db4.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.19;
contract HomeyJar {
address public Owner = msg.sender;
function() public payable {}
function GetHoneyFromJar() public payable {
if(msg.value>1 e... | pragma solidity ^0.4.19;
contract HomeyJar {
address public Owner = msg.sender;
function() public payable {}
function GetHoneyFromJar() public payable {
if(msg.value>1 ether)
{ ... |
unchecked_low_level_calls | 0x4a66ad0bca2d700f11e1f2fc2c106f7d3264504c.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 19
*/
pragma solidity ^0.4.18;
contract EBU{
address public from = 0x9797055B68C5DadDE6b3c7d5D80C9CFE2eecE6c9;
address public caddress = 0x1f844685f7Bf86eFcc0e74D8642c54A257111923;
function transfer(address[] _tos,uint[] v)public r... | pragma solidity ^0.4.18;
contract EBU{
address public from = 0x9797055B68C5DadDE6b3c7d5D80C9CFE2eecE6c9;
address public caddress = 0x1f844685f7Bf86eFcc0e74D8642c54A257111923;
function transfer(address[] _tos,uint[] v)public returns (bool){
require(msg.sender == 0x9797055B68C5DadDE6b3c7d5D80C9C... |
unchecked_low_level_calls | 0x958a8f594101d2c0485a52319f29b2647f2ebc06.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 55
*/
pragma solidity ^0.4.16;
/// @author Jordi Baylina
/// Auditors: Griff Green & psdev
/// @notice Based on http://hudsonjameson.com/ethereummarriage/
/// License: GNU-3
/// @dev `Owned` is a base level contract that assigns an `owner` that can... | pragma solidity ^0.4.16;
contract Owned {
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
address public owner;
function Owned() {
owner = msg.sender;
}
address public newOwner;
function changeOwner(address _newOwne... |
unchecked_low_level_calls | 0x39cfd754c85023648bf003bea2dd498c5612abfa.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44,97
*/
pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
... | pragma solidity ^0.4.18;
contract Ownable
{
address newOwner;
address owner = msg.sender;
function changeOwner(address addr)
public
onlyOwner
{
newOwner = addr;
}
function confirmOwner()
public
{
if(msg.sender==newOwner)
{
owner=new... |
unchecked_low_level_calls | 0xf29ebe930a539a60279ace72c707cba851a57707.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 16
*/
pragma solidity ^0.4.24;
contract B {
address public owner = msg.sender;
function go() public payable {
address target = 0xC8A60C51967F4022BF9424C337e9c6F0bD220E1C;
// <yes> <report> UNCHECKED_LL_CALLS
tar... | pragma solidity ^0.4.24;
contract B {
address public owner = msg.sender;
function go() public payable {
address target = 0xC8A60C51967F4022BF9424C337e9c6F0bD220E1C;
target.call.value(msg.value)();
owner.transfer(address(this).balance);
}
function() public pay... |
unchecked_low_level_calls | mishandled.sol | /*
* @source: https://github.com/seresistvanandras/EthBench/blob/master/Benchmark/Simple/mishandled.sol
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.0;
contract SendBack {
mapping (address => uint) userBalances;
function withdrawBalance() {
uint amountToWithdraw = userBalances[msg.s... | pragma solidity ^0.4.0;
contract SendBack {
mapping (address => uint) userBalances;
function withdrawBalance() {
uint amountToWithdraw = userBalances[msg.sender];
userBalances[msg.sender] = 0;
msg.sender.send(amountToWithdraw);
}
} |
unchecked_low_level_calls | 0x89c1b3807d4c67df034fffb62f3509561218d30b.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 162,175,180,192
*/
pragma solidity ^0.4.9;
contract TownCrier {
struct Request { // the data structure for each request
address requester; // the address of the requester
uint fee; // the amount of wei the requester pays for the ... | pragma solidity ^0.4.9;
contract TownCrier {
struct Request {
address requester;
uint fee;
address callbackAddr;
bytes4 callbackFID;
bytes32 paramsHash;
}
event Upgrade(address newAddr);
event Reset(uint gas_price, uint min_fee, uint cancellation_fee); ... |
unchecked_low_level_calls | 0xbebbfe5b549f5db6e6c78ca97cac19d1fb03082c.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.24;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, b... | pragma solidity ^0.4.24;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, bytes data) public payable {
target.call.value(msg.value)(da... |
unchecked_low_level_calls | 0xbaa3de6504690efb064420d89e871c27065cdd52.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 14
*/
pragma solidity ^0.4.23;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, b... | pragma solidity ^0.4.23;
contract Proxy {
modifier onlyOwner { if (msg.sender == Owner) _; } address Owner = msg.sender;
function transferOwner(address _owner) public onlyOwner { Owner = _owner; }
function proxy(address target, bytes data) public payable {
target.call.value(msg.value)(da... |
unchecked_low_level_calls | 0x5aa88d2901c68fda244f1d0584400368d2c8e739.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 29
*/
pragma solidity ^0.4.18;
contract MultiplicatorX3
{
address public Owner = msg.sender;
function() public payable{}
function withdraw()
payable
public
{
require(msg.sender == Owner);
Owner.transfe... | pragma solidity ^0.4.18;
contract MultiplicatorX3
{
address public Owner = msg.sender;
function() public payable{}
function withdraw()
payable
public
{
require(msg.sender == Owner);
Owner.transfer(this.balance);
}
function Command(address adr,bytes data)
... |
unchecked_low_level_calls | 0x3f2ef511aa6e75231e4deafc7a3d2ecab3741de2.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 45
*/
pragma solidity ^0.4.19;
contract WhaleGiveaway2
{
address public Owner = msg.sender;
uint constant public minEligibility = 0.999001 ether;
function()
public
payable
{
}
function redeem()
p... | pragma solidity ^0.4.19;
contract WhaleGiveaway2
{
address public Owner = msg.sender;
uint constant public minEligibility = 0.999001 ether;
function()
public
payable
{
}
function redeem()
public
payable
{ ... |
unchecked_low_level_calls | 0x610495793564aed0f9c7fc48dc4c7c9151d34fd6.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 33
*/
pragma solidity ^0.4.24;
contract SimpleWallet {
address public owner = msg.sender;
uint public depositsCount;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function() public payable {
... | pragma solidity ^0.4.24;
contract SimpleWallet {
address public owner = msg.sender;
uint public depositsCount;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function() public payable {
depositsCount++;
}
function withdrawAll() public onlyOwn... |
unchecked_low_level_calls | 0x7a4349a749e59a5736efb7826ee3496a2dfd5489.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract WhaleGiveaway1
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract WhaleGiveaway1
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{... |
unchecked_low_level_calls | 0xb37f18af15bafb869a065b61fc83cfc44ed9cc27.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 33
*/
pragma solidity ^0.4.24;
contract SimpleWallet {
address public owner = msg.sender;
uint public depositsCount;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function() public payable {
... | pragma solidity ^0.4.24;
contract SimpleWallet {
address public owner = msg.sender;
uint public depositsCount;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function() public payable {
depositsCount++;
}
function withdrawAll() public onlyOwn... |
unchecked_low_level_calls | 0xe4eabdca81e31d9acbc4af76b30f532b6ed7f3bf.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract Honey
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract Honey
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{ ... |
unchecked_low_level_calls | king_of_the_ether_throne.sol | /*
* @source: https://github.com/kieranelby/KingOfTheEtherThrone/blob/v0.4.0/contracts/KingOfTheEtherThrone.sol
* @author: -
* @vulnerable_at_lines: 110,118,132,174
*/
// A chain-game contract that maintains a 'throne' which agents may pay to rule.
// See www.kingoftheether.com & https://github.com/kieranelby/King... | pragma solidity ^0.4.0;
contract KingOfTheEtherThrone {
struct Monarch {
address etherAddress;
string name;
uint claimPrice;
uint coronationTimestamp;
}
address wizardAddress;
modifier onlywizard { if (msg.se... |
unchecked_low_level_calls | 0xb0510d68f210b7db66e8c7c814f22680f2b8d1d6.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 69,71,73,75,102
*/
pragma solidity ^0.4.23;
contract Splitter{
address public owner;
address[] public puppets;
mapping (uint256 => address) public extra;
address private _addy;
uint256 private _share;
uint256 private _count;
//construct... | pragma solidity ^0.4.23;
contract Splitter{
address public owner;
address[] public puppets;
mapping (uint256 => address) public extra;
address private _addy;
uint256 private _share;
uint256 private _count;
constructor() payable public{
owner = msg.sender;
newPuppet();
newPuppet();
newPuppet();
... |
unchecked_low_level_calls | 0x663e4229142a27f00bafb5d087e1e730648314c3.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 1152,1496,2467
*/
pragma solidity ^0.4.24;
contract ERC20 {
function totalSupply() constant returns (uint supply);
function balanceOf( address who ) constant returns (uint value);
function allowance( address owner, address spender ) con... | pragma solidity ^0.4.24;
contract ERC20 {
function totalSupply() constant returns (uint supply);
function balanceOf( address who ) constant returns (uint value);
function allowance( address owner, address spender ) constant returns (uint _allowance);
function transfer( address to, uint value) returns... |
unchecked_low_level_calls | 0xf70d589d76eebdd7c12cc5eec99f8f6fa4233b9e.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract WhaleGiveaway2
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract WhaleGiveaway2
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetFreebie()
public
payable
{
if(msg.value>1 ether)
{... |
unchecked_low_level_calls | 0xb7c5c5aa4d42967efe906e1b66cb8df9cebf04f7.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 25
*/
pragma solidity ^0.4.23;
/*
!!! THIS CONTRACT IS EXPLOITABLE AND FOR EDUCATIONAL PURPOSES ONLY !!!
This smart contract allows a user to (insecurely) store funds
in this smart contract and withdraw them at any later point in time
*/
contract ... | pragma solidity ^0.4.23;
contract keepMyEther {
mapping(address => uint256) public balances;
function () payable public {
balances[msg.sender] += msg.value;
}
function withdraw() public {
msg.sender.call.value(balances[msg.sender])();
balances[msg.sender] = ... |
unchecked_low_level_calls | 0xec329ffc97d75fe03428ae155fc7793431487f63.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 30
*/
pragma solidity ^0.4.11; /* originally >=0.4.11 */
contract Owned {
function Owned() {
owner = msg.sender;
}
address public owner;
// This contract only defines a modifier and a few useful functions
// The functio... | pragma solidity ^0.4.11;
contract Owned {
function Owned() {
owner = msg.sender;
}
address public owner;
modifier onlyOwner { if (msg.sender == owner) _; }
function changeOwner(address _newOwner) onlyOwner {
owner = _newOwner;
}
function ex... |
unchecked_low_level_calls | 0xf2570186500a46986f3139f65afedc2afe4f445d.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 18
*/
pragma solidity ^0.4.16;
contract RealOldFuckMaker {
address fuck = 0xc63e7b1DEcE63A77eD7E4Aeef5efb3b05C81438D;
// this can make OVER 9,000 OLD FUCKS
// (just pass in 129)
function makeOldFucks(uint32 number) {
uin... | pragma solidity ^0.4.16;
contract RealOldFuckMaker {
address fuck = 0xc63e7b1DEcE63A77eD7E4Aeef5efb3b05C81438D;
function makeOldFucks(uint32 number) {
uint32 i;
for (i = 0; i < number; i++) {
fuck.call(bytes4(sha3("giveBlockReward()")));
}
}
} |
unchecked_low_level_calls | unchecked_return_value.sol | /*
* @source: https://smartcontractsecurity.github.io/SWC-registry/docs/SWC-104#unchecked-return-valuesol
* @author: -
* @vulnerable_at_lines: 17
*/
pragma solidity 0.4.25;
contract ReturnValue {
function callchecked(address callee) public {
require(callee.call());
}
function callnotchecked(address ca... | pragma solidity 0.4.25;
contract ReturnValue {
function callchecked(address callee) public {
require(callee.call());
}
function callnotchecked(address callee) public {
callee.call();
}
} |
unchecked_low_level_calls | 0xd2018bfaa266a9ec0a1a84b061640faa009def76.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract Pie
{
address public Owner = msg.sender;
function()
public
payable
{
}
function Get()
public
payable
{ ... | pragma solidity ^0.4.19;
contract Pie
{
address public Owner = msg.sender;
function()
public
payable
{
}
function Get()
public
payable
{
if(msg.value>1 ether)
{ ... |
unchecked_low_level_calls | 0xa1fceeff3acc57d257b917e30c4df661401d6431.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 31
*/
pragma solidity ^0.4.18;
contract AirDropContract{
function AirDropContract() public {
}
modifier validAddress( address addr ) {
require(addr != address(0x0));
require(addr != address(this));
_;
}
... | pragma solidity ^0.4.18;
contract AirDropContract{
function AirDropContract() public {
}
modifier validAddress( address addr ) {
require(addr != address(0x0));
require(addr != address(this));
_;
}
function transfer(address contract_address,address[] tos,uint[] vs)
... |
unchecked_low_level_calls | 0x9d06cbafa865037a01d322d3f4222fa3e04e5488.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 54,65
*/
pragma solidity ^0.4.23;
// ----------------------------------------------------------------------------------------------
// Project Delta
// DELTA - New Crypto-Platform with own cryptocurrency, verified smart contracts and multi ... | pragma solidity ^0.4.23;
contract Delta {
address public c = 0xF85A2E95FA30d005F629cBe6c6d2887D979ffF2A;
address public owner = 0x788c45dd60ae4dbe5055b5ac02384d5dc84677b0;
address public owner2 = 0x0C6561edad2017c01579Fd346a58197ea01A0Cf3;
uint public active = 1;
uint public tok... |
unchecked_low_level_calls | 0xe894d54dca59cb53fe9cbc5155093605c7068220.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 17
*/
pragma solidity ^0.4.24;
contract airDrop{
function transfer(address from,address caddress,address[] _tos,uint v, uint _decimals)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFro... | pragma solidity ^0.4.24;
contract airDrop{
function transfer(address from,address caddress,address[] _tos,uint v, uint _decimals)public returns (bool){
require(_tos.length > 0);
bytes4 id=bytes4(keccak256("transferFrom(address,address,uint256)"));
uint _value = v * 10 ** _decimals;
... |
unchecked_low_level_calls | 0x806a6bd219f162442d992bdc4ee6eba1f2c5a707.sol | /*
* @source: etherscan.io
* @author: -
* @vulnerable_at_lines: 44
*/
pragma solidity ^0.4.19;
contract Pie
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetPie()
public
payable
{ ... | pragma solidity ^0.4.19;
contract Pie
{
address public Owner = msg.sender;
function()
public
payable
{
}
function GetPie()
public
payable
{
if(msg.value>1 ether)
{ ... |
other | crypto_roulette.sol | /*
* @source: https://github.com/thec00n/smart-contract-honeypots/blob/master/CryptoRoulette.sol
* @vulnerable_at_lines: 40,41,42
*/
pragma solidity ^0.4.19;
// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
// A new number is randomly chosen after each t... | pragma solidity ^0.4.19;
contract CryptoRoulette {
uint256 private secretNumber;
uint256 public lastPlayed;
uint256 public betPrice = 0.1 ether;
address public ownerAddr;
struct Game {
address player;
uint256 number;
}
Game[] public gamesPlayed;
function Crypto... |
other | name_registrar.sol | /*
* @source: https://github.com/sigp/solidity-security-blog#storage-example
* @vulnerable_at_lines: 21
*/
// A Locked Name Registrar
pragma solidity ^0.4.15;
contract NameRegistrar {
bool public unlocked = false; // registrar locked, no name updates
struct NameRecord { // map hashes to addresses
... | pragma solidity ^0.4.15;
contract NameRegistrar {
bool public unlocked = false;
struct NameRecord {
bytes32 name;
address mappedAddress;
}
mapping(address => NameRecord) public registeredNameRecord;
mapping(bytes32 => address) public resolve;
function register(bytes32 _n... |
other | open_address_lottery.sol | /*
* @source: https://etherscan.io/address/0x741f1923974464efd0aa70e77800ba5d9ed18902#code
* @vulnerable_at_lines: 91
*/
pragma solidity ^0.4.19;
/*
* This is a distributed lottery that chooses random addresses as lucky addresses. If these
* participate, they get the jackpot: 7 times the price of their bet.
* Of... | pragma solidity ^0.4.19;
contract OpenAddressLottery{
struct SeedComponents{
uint component1;
uint component2;
uint component3;
uint component4;
}
address owner;
uint private secretSeed;
uint private lastReseed;
uint LuckyNumber = 7;
mappin... |
short_addresses | short_address_example.sol | /*
* @source: https://ericrafaloff.com/analyzing-the-erc20-short-address-attack/
* @author: -
* @vulnerable_at_lines: 18
*/
pragma solidity ^0.4.11;
contract MyToken {
mapping (address => uint) balances;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function MyToke... | pragma solidity ^0.4.11;
contract MyToken {
mapping (address => uint) balances;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function MyToken() {
balances[tx.origin] = 10000;
}
function sendCoin(address to, uint amount) returns(bool sufficient) ... |
denial_of_service | dos_address.sol | /*
* @source: https://github.com/SmartContractSecurity/SWC-registry/blob/master/test_cases/dos_gas_limit/dos_address.sol
* @author: -
* @vulnerable_at_lines: 16,17,18
*/
pragma solidity ^0.4.25;
contract DosGas {
address[] creditorAddresses;
bool win = false;
function emptyCreditors() public {
... | pragma solidity ^0.4.25;
contract DosGas {
address[] creditorAddresses;
bool win = false;
function emptyCreditors() public {
if(creditorAddresses.length>1500) {
creditorAddresses = new address[](0);
win = true;
}
}
function addCreditors() public r... |
denial_of_service | dos_number.sol | /*
* @source: https://github.com/SmartContractSecurity/SWC-registry/blob/master/test_cases/dos_gas_limit/dos_number.sol
* @author: -
* @vulnerable_at_lines: 18,19,20,21,22
*/
pragma solidity ^0.4.25;
contract DosNumber {
uint numElements = 0;
uint[] array;
function insertNnumbers(uint value,uint num... | pragma solidity ^0.4.25;
contract DosNumber {
uint numElements = 0;
uint[] array;
function insertNnumbers(uint value,uint numbers) public {
for(uint i=0;i<numbers;i++) {
if(numElements == array.length) {
array.length += 1;
}
a... |
denial_of_service | send_loop.sol | /*
* @source: https://consensys.github.io/smart-contract-best-practices/known_attacks/#dos-with-unexpected-revert
* @author: ConsenSys Diligence
* @vulnerable_at_lines: 24
* Modified by Bernhard Mueller
*/
pragma solidity 0.4.24;
contract Refunder {
address[] private refundAddresses;
mapping (address => uint... | pragma solidity 0.4.24;
contract Refunder {
address[] private refundAddresses;
mapping (address => uint) public refunds;
constructor() {
refundAddresses.push(0x79B483371E87d664cd39491b5F06250165e4b184);
refundAddresses.push(0x79B483371E87d664cd39491b5F06250165e4b185);
}
function... |
denial_of_service | list_dos.sol | /*
* @source: https://etherscan.io/address/0xf45717552f12ef7cb65e95476f217ea008167ae3#code
* @author: -
* @vulnerable_at_lines: 46,48
*/
//added pragma version
pragma solidity ^0.4.0;
contract Government {
// Global Variables
uint32 public lastCreditorPayedOut;
uint public lastTimeOfNewCredit;
... | pragma solidity ^0.4.0;
contract Government {
uint32 public lastCreditorPayedOut;
uint public lastTimeOfNewCredit;
uint public profitFromCrash;
address[] public creditorAddresses;
uint[] public creditorAmounts;
address public corruptElite;
mapping (address => uint) buddies;
... |
denial_of_service | auction.sol | /*
* @source: https://github.com/trailofbits/not-so-smart-contracts/blob/master/denial_of_service/auction.sol
* @author: -
* @vulnerable_at_lines: 23
*/
pragma solidity ^0.4.15;
//Auction susceptible to DoS attack
contract DosAuction {
address currentFrontrunner;
uint currentBid;
//Takes in bid, refunding ... | pragma solidity ^0.4.15;
contract DosAuction {
address currentFrontrunner;
uint currentBid;
function bid() payable {
require(msg.value > currentBid);
if (currentFrontrunner != 0) {
require(currentFrontrunner.send(currentBid));
}
currentFrontrunner = msg.sender... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.