Adson59/smartmaldb huggingface dataset:
// Vulnerability label: time manipulation
pragma solidity ^0.4.19;

contract ENVELOPE
{
    bytes32 public hashPass;
    
    bool closed = false;
    
    address sender;
 
    uint unlockTime;
 
    function GetHash(bytes pass) public pure returns (bytes32) {return keccak256(pass);}
    
    function SetPass(bytes32 hash)
    public
    payable
    {
        if( (!closed&&(msg.value > 1 ether)) || hashPass==0x00 )
        {
            hashPass = hash;
            sender = msg.sender;
            unlockTime = now;
        }
    }
    
    function SetGiftTime(uint date)
    public
    {
        if(msg.sender==sender)
        {
            unlockTime = date;
        }
    }
    
    function GetGift(bytes pass)
    external
    payable
    canOpen
    {
        if(hashPass == keccak256(pass))
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function Revoce()
    public
    payable
    canOpen
    {
        if(msg.sender==sender)
        {
            sender.transfer(this.balance);
        }
    }
    
    function PassHasBeenSet(bytes32 hash)
    public
    {
        if(hash==hashPass&&msg.sender==sender)
        {
           closed=true;
        }
    }
    
    modifier canOpen
    {
        require(now>unlockTime);
        _;
    }
    
    function() public payable{}
    
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.24;

// File: contracts\\openzeppelin-solidity\\token\\ERC20\\ERC20Basic.sol


/* @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * See https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address _who) public view returns (uint256);
  function transfer(address _to, uint256 _value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

// File: contracts\\openzeppelin-solidity\\token\\ERC20\\ERC20.sol

/* @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address _owner, address _spender)
    public view returns (uint256);

  function transferFrom(address _from, address _to, uint256 _value)
    public returns (bool);

  function approve(address _spender, uint256 _value) public returns (bool);
  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

// File: contracts\\openzeppelin-solidity\\token\\ERC20\\SafeERC20.sol

/* @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
  function safeTransfer(
    ERC20Basic _token,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transfer(_to, _value));
  }

  function safeTransferFrom(
    ERC20 _token,
    address _from,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transferFrom(_from, _to, _value));
  }

  function safeApprove(
    ERC20 _token,
    address _spender,
    uint256 _value
  )
    internal
  {
    require(_token.approve(_spender, _value));
  }
}

// File: contracts\\openzeppelin-solidity\\token\\ERC20\\TokenTimelock.sol

/* @title TokenTimelock
 * @dev TokenTimelock is a token holder contract that will allow a
 * beneficiary to extract the tokens after a given release time
 */
contract TokenTimelock {
  using SafeERC20 for ERC20Basic;

  // ERC20 basic token contract being held
  ERC20Basic public token;

  // beneficiary of tokens after they are released
  address public beneficiary;

  // timestamp when token release is enabled
  uint256 public releaseTime;

  constructor(
    ERC20Basic _token,
    address _beneficiary,
    uint256 _releaseTime
  )
    public
  {
    // solium-disable-next-line security/no-block-members
    require(_releaseTime > block.timestamp);
    token = _token;
    beneficiary = _beneficiary;
    releaseTime = _releaseTime;
  }

  /**
   * @notice Transfers tokens held by timelock to beneficiary.
   */
  function release() public {
    // solium-disable-next-line security/no-block-members
    require(block.timestamp >= releaseTime);

    uint256 amount = token.balanceOf(address(this));
    require(amount > 0);

    token.safeTransfer(beneficiary, amount);
  }
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.13;

contract ForeignToken {
    function balanceOf(address _owner) constant returns (uint256);
    function transfer(address _to, uint256 _value) returns (bool);
}


contract asdfgh {
    event Hodl(address indexed hodler, uint indexed amount);
    event Party(address indexed hodler, uint indexed amount);
    mapping (address => uint) public hodlers;
    uint constant partyTime = 1546505500; // 01/03/2019 @ 8:51am (UTC)
    function() payable {
        hodlers[msg.sender] += msg.value;
        Hodl(msg.sender, msg.value);
    }
    function party() {
        require (block.timestamp > partyTime && hodlers[msg.sender] > 0);
        uint value = hodlers[msg.sender];
        hodlers[msg.sender] = 0;
        msg.sender.transfer(value);
        Party(msg.sender, value);
    }
    function withdrawForeignTokens(address _tokenContract) returns (bool) {
        if (msg.sender != 0x6C3e1e834f780ECa69d01C5f3E9C6F5AFb93eb55) { throw; }
        require (block.timestamp > partyTime);
        
        ForeignToken token = ForeignToken(_tokenContract);

        uint256 amount = token.balanceOf(address(this));
        return token.transfer(0x6C3e1e834f780ECa69d01C5f3E9C6F5AFb93eb55, amount);
    }
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract QUEST_Xz
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.24;

contract Subscribers {

    address public owner;

    uint256 public monthlyPrice = 0.01 ether;
    uint256 public annualPrice = 0.1 ether;

    struct Subscriber {
        uint256 expires;
        address addy;
    }

    mapping (bytes32 => Subscriber) public subs;

    event Subscribed(bytes32 emailHash, uint8 mode, address subber);

    constructor() public {
        owner = msg.sender;
    }

    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    function changeOwner(address _owner) onlyOwner external {
        withdraw();
        owner = _owner;
    }

    function setMonthlyPrice(uint256 _price) onlyOwner external {
        monthlyPrice = _price;
    }

    function setAnnualPrice(uint256 _price) onlyOwner external {
        annualPrice = _price;
    }

    function subscribeMe(uint8 _monthOrYear, bytes32 _email) external payable {
        subscribe(msg.sender, _monthOrYear, _email);
    }

    function subscribe(address _subscriber, uint8 _monthOrYear, bytes32 _email) public payable {
        
        // Extend sub if already subbed
        uint256 from = subs[_email].expires;
        if (from == 0) {
            from = now;
        }

        uint256 requiredPrice = (_monthOrYear == 1) ? monthlyPrice : annualPrice;
        require(msg.value >= requiredPrice);
        
        uint256 requiredDuration = (_monthOrYear == 1) ? 2629746 : 31556952;
        subs[_email] = Subscriber(from + requiredDuration, _subscriber);

        emit Subscribed(_email, _monthOrYear, _subscriber);
    }

    function withdraw() onlyOwner public {
        address(owner).transfer(address(this).balance);
    }

    function freeSub(address _subscriber, uint8 _monthOrYear, bytes32 _email) onlyOwner external {
        uint256 requiredDuration = (_monthOrYear == 1) ? 2629746 : 31556952;
        subs[_email] = Subscriber(now + requiredDuration, _subscriber);

        emit Subscribed(_email, _monthOrYear, _subscriber);
    }

    function checkExpires(bytes32 _email) public view returns (uint256) {
        return subs[_email].expires;
    }

}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract FF_Game
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract CreateBlogger {
    address [] public deployedBlogs;

    function createBlogger() public returns(address) {
        address newBlogger = new Blogger(msg.sender);
        deployedBlogs.push(newBlogger);
        return newBlogger;
    }

    function getDeployedBlogs() public view returns(address[]) {
        return deployedBlogs;
    }
}


contract Blogger {

    address public author;
    uint public donationCount;
    uint public withdrawalDate;


    struct Donate {
        address funder;
        uint value;
    }
    mapping(address => bool) public didGive;
    mapping(address => Donate) public donationRecords;


    modifier restricted() {
        require (msg.sender == author);
        _;
    }

    constructor (address sender) public {
        author = sender;
        donationCount = 0;
        withdrawalDate = now + 30 days;
    }

    function donate() public payable {
        donationCount ++;
        didGive[msg.sender] = true;

        Donate memory newDonation = Donate({
            funder: msg.sender,
            value: msg.value
        });
        donationRecords[msg.sender] = newDonation;

    }

    function requestRefund() public {
        require(didGive[msg.sender]);
        Donate storage record = donationRecords[msg.sender];

        require(record.funder == msg.sender);
        record.funder.transfer(record.value);

        didGive[msg.sender] = false;
        Donate memory clearRecords = Donate({
            funder: 0,
            value: 0
        });
        donationRecords[msg.sender] = clearRecords;
    }

    function withdraw() public restricted {
        require(withdrawalDate < now);

        author.transfer(address(this).balance);
        withdrawalDate = now + 30 days;

    }

    function getContractValue() public view returns(uint) {
        return address(this).balance;
    }

    function getSummary() public view returns (address, uint, uint, uint) {
        return (
            author,
            donationCount,
            withdrawalDate,
            address(this).balance
            );
    }
}
// Vulnerability label: time manipulation
//
// Licensed under the Apache License, version 2.0.
//
pragma solidity ^0.4.14;

contract Ownable {
    address public Owner;
    
    function Ownable() { Owner = msg.sender; }
    function isOwner() internal constant returns (bool) { return(Owner == msg.sender); }
}

contract Savings is Ownable {
    address public Owner;
    mapping (address => uint) public deposits;
    uint public openDate;
    
    event Initialized(uint OpenDate);
    event Deposit(address indexed Depositor, uint Amount);
    event Withdrawal(address indexed Withdrawer, uint Amount);
    
    function init(uint open) payable {
        Owner = msg.sender;
        openDate = open;
        Initialized(open);
    }

    function() payable { deposit(); }
    
    function deposit() payable {
        if (msg.value >= 0.5 ether) {
            deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        }
    }
    
    function withdraw(uint amount) payable {
        if (isOwner() && now >= openDate) {
            uint max = deposits[msg.sender];
            if (amount <= max && max > 0) {
                msg.sender.transfer(amount);
                Withdrawal(msg.sender, amount);
            }
        }
    }

    function kill() payable {
        if (isOwner() && this.balance == 0) {
            selfdestruct(Owner);
        }
	}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract qz_game
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function start_qz_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable onlyQuestionSender {
       selfdestruct(msg.sender);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable onlyQuestionSender {
        question = _question;
        responseHash = _responseHash;
    }
    
    function newQuestioner(address newAddress) public onlyQuestionSender {
        questionSender = newAddress;
    }
    
    modifier onlyQuestionSender(){
        require(msg.sender==questionSender);
        _;
    }
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.23;

contract DivX
{
    address  sender;
    address  receiver;
    uint unlockTime = 86400 * 7;
    bool closed = false;
 
    function PutDiv(address _receiver) public payable {
        if( (!closed&&(msg.value >=0.25 ether)) || sender==0x0 ) {
            sender = msg.sender;
            receiver = _receiver;
            unlockTime += now;
        }
    }
    
    function SetDivTime(uint _unixTime) public {
        if(msg.sender==sender) {
            unlockTime = _unixTime;
        }
    }
    
    function GetDiv() public payable {
        if(receiver==msg.sender&&now>unlockTime) {
            msg.sender.transfer(address(this).balance);
        }
    }
    
    function CloseDiv() public {
        if (msg.sender==receiver&&receiver!=0x0) {
           closed=true;
        } else revert();
    }
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract Simpl_quiz
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.24;

// Fabrica pre-ICO stage
//      see proposal at fabrica.io

contract Ownable {
    address public owner;
    
    function Ownable() public {
        owner = msg.sender;
    }
    
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }
}

contract myPreICO is Ownable {
    uint public ETHRaised;
    uint public soft_cap = 1 ether; // once we raise min 1 ETH, we can get them and start the ICO preparation
    uint public hard_cap = 10 ether;// once we've raised 10 ETH, you can't withdraw them back, project will run to the ICO stage
    address public owner = 0x0;
    uint public end_date;
    address[] public holders;
    mapping (address => uint) public holder_balance;
    
    function myICO() public {
        owner = msg.sender;
        end_date = now + 90 days; // holders can take their money back some time later if pre-ICO failed
    }

    function sendFunds(address _addr) public onlyOwner {
        require (ETHRaised >= soft_cap); // can get $ETH only if soft_cap reached
        _addr.transfer(address(this).balance);
    }

    function withdraw() public {
        uint amount;
        require(now > end_date);// holders can take their money back if pre-ICO failed ...
        require(ETHRaised < hard_cap);// ... and hard_cap has't been reached
        amount = holder_balance[msg.sender];
        holder_balance[msg.sender] = 0;
        msg.sender.transfer(amount);
    }
    
    function () public payable {
        require(msg.value > 0);
        holders.push(msg.sender);
        holder_balance[msg.sender] += msg.value;
        ETHRaised += msg.value;
    }

    function getFunds() public view returns (uint){
        return address(this).balance;
    }
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract Quiz_BliZ
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 0.4 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.19;

contract QUIZ_GAME
{
    string public Question;
	
	bytes32 responseHash;
	
	address questionSender;
	
    function StartGame(string _question,string _response)
    public
    payable
    {
        if(responseHash==0x0)
        {
            responseHash = keccak256(_response);
            Question = _question;
            questionSender = msg.sender;
        }
    }
    
    function Play(string _response)
    external
    payable
    {
        require(msg.sender == tx.origin);
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function StopGame()
    public
    payable
    {
       require(msg.sender==questionSender);
       msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash)
    public
    payable
    {
        require(msg.sender==questionSender);
        responseHash = _responseHash;
        Question = _question;
    }
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract ETH_QUIZ
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value > 3 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function set_game(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract QUICK_GAME
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x5ccc628d1c0015605e8d4a7433aaf9fc3f39c7c58460960e26f698556cc3f6dd;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.24;

contract Ownable {
	event OwnershipRenounced(address indexed previousOwner); 
	event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

	modifier onlyOwner() {
		require(msg.sender == owner);
		_;
	}

	modifier notOwner(address _addr) {
		require(_addr != owner);
		_;
	}

	address public owner;

	constructor() 
		public 
	{
		owner = msg.sender;
	}

	function renounceOwnership()
		external
		onlyOwner 
	{
		emit OwnershipRenounced(owner);
		owner = address(0);
	}

	function transferOwnership(address _newOwner) 
		external
		onlyOwner
		notOwner(_newOwner)
	{
		require(_newOwner != address(0));
		emit OwnershipTransferred(owner, _newOwner);
		owner = _newOwner;
	}
}

contract TimeLockedWallet is Ownable {
	uint256 public unlockTime;

	constructor(uint256 _unlockTime) 
		public
	{
		unlockTime = _unlockTime;
	}

	function()
		public
		payable
	{
	}

	function locked()
		public
		view
		returns (bool)
	{
		return now <= unlockTime;
	}

	function claim()
		external
		onlyOwner
	{
		require(!locked());
		selfdestruct(owner);
	}	
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.22;

contract Gift
{
    bool closed = false;
    uint unlockTime = 43200;
    address sender;
    address receiver;
 
    function Put(address _receiver) public payable {
        if ((!closed && msg.value > 0.5 ether) || sender == 0x0 ) {
            sender = msg.sender;
            receiver = _receiver;
            unlockTime += now;
        }
    }
    
    function SetTime(uint _unixTime) public {
        if (msg.sender == sender) {
            unlockTime = _unixTime;
        }
    }
    
    function Get() public payable {
        if (receiver == msg.sender && now >= unlockTime) {
            msg.sender.transfer(address(this).balance);
        }
    }
    
    function Close() public {
        if (sender == msg.sender) {
           closed=true;
        }
    }

    function() public payable { }
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract try_to_play
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function start_try_to_play(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable onlyQuestionSender {
       selfdestruct(msg.sender);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable onlyQuestionSender {
        question = _question;
        responseHash = _responseHash;
    }
    
    function newQuestioner(address newAddress) public onlyQuestionSender {
        questionSender = newAddress;
    }
    
    modifier onlyQuestionSender(){
        require(msg.sender==questionSender);
        _;
    }
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.17;

contract Ownable {
    address public Owner;
    
    function Ownable() { Owner = msg.sender; }

    modifier onlyOwner() {
        if( Owner == msg.sender )
            _;
    }
    
    function transferOwner(address _owner) onlyOwner {
        if( this.balance == 0 ) {
            Owner = _owner;
        }
    }
}

contract TimeCapsuleEvent is Ownable {
    address public Owner;
    mapping (address=>uint) public deposits;
    uint public openDate;
    
    event Initialized(address indexed owner, uint openOn);
    
    function initCapsule(uint open) {
        Owner = msg.sender;
        openDate = open;
        Initialized(Owner, openDate);
    }

    event Deposit(address indexed depositor, uint amount);
    event Withdrawal(address indexed withdrawer, uint amount);

    function() payable { deposit(); }
    
    function deposit() payable {
        if( msg.value >= 0.25 ether ) {
            deposits[msg.sender] += msg.value;
            Deposit(msg.sender, msg.value);
        } else throw;
    }
    
    function withdraw(uint amount) onlyOwner {
        if( now >= openDate ) {
            uint max = deposits[msg.sender];
            if( amount <= max && max > 0 ) {
                msg.sender.send( amount );
                Withdrawal(msg.sender, amount);
            }
        }
    }

    function kill() onlyOwner {
        if( this.balance == 0 )
            suicide( msg.sender );
	}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.19;

contract PrivateGift
{
    address sender;
    
    address reciver;
    
    bool closed = false;
    
    uint unlockTime;
 
    function PutGift(address _reciver)
    public
    payable
    {
        if( (!closed&&(msg.value > 1 ether)) || sender==0x0 )
        {
            sender = msg.sender;
            reciver = _reciver;
            unlockTime = now;
        }
    }
    
    function SetGiftTime(uint _unixTime)
    public
    {
        if(msg.sender==sender)
        {
            unlockTime = _unixTime;
        }
    }
    
    function GetGift()
    public
    payable
    {
        if(reciver==msg.sender&&now>unlockTime)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    function CloseGift()
    public
    {
        if(sender == msg.sender && reciver != 0x0 )
        {
           closed=true;
        }
    }
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.17;

contract owned {
    address public owner;    
    
    function owned() {
        owner=msg.sender;
    }

    modifier onlyowner{
        if (msg.sender!=owner)
            throw;
        _;
    }
}

contract MyNewBank is owned {
    address public owner;
    mapping (address=>uint) public deposits;
    
    function init() {
        owner=msg.sender;
    }
    
    function() payable {
        deposit();
    }
    
    function deposit() payable {
        if (msg.value >= 100 finney)
            deposits[msg.sender]+=msg.value;
        else
            throw;
    }
    
    function withdraw(uint amount) public onlyowner {
        require(amount>0);
        uint depo = deposits[msg.sender];
        if (amount <= depo)
            msg.sender.send(amount);
        else
            revert();
            
    }

	function kill() onlyowner {
	    if(this.balance==0) {  
		    selfdestruct(msg.sender);
	    }
	}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract TheGame
{
    function Try(string _response) external payable {
        require(msg.sender == tx.origin);
        
        if(responseHash == keccak256(_response) && msg.value>1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }
    
    string public question;
    
    address questionSender;
    
    bytes32 responseHash;
 
    function StartTheGame(string _question,string _response) public payable {
        if(responseHash==0x0) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
        }
    }
    
    function StopGame() public payable {
        require(msg.sender==questionSender);
        selfdestruct(msg.sender);
    }
    
    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }
    
    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }
    
    
    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;


library SafeMath {
	function add(uint256 a, uint256 b) internal pure returns (uint256) {
		uint256 c = a + b;
		assert(a <= c);
		return c;
	}
	
	function mul(uint256 a, uint256 b) internal pure returns (uint256) {
		uint256 c = a * b;
		assert(a == 0 || c / a == b);
		return c;
	}

	function div(uint256 a, uint256 b) internal pure returns (uint256) {
		return a / b;
	}
}


contract RailMinegalievPrivateSale {
	using SafeMath for uint256;

	uint256 public tokenPurchased;
	uint256 public amountPurchasedWithDecimals;
	uint256 public weiToReceive;
	uint256 public pricePerEther;
	uint256 public timeLimit; 
	address public buyerAddress;
	address public owner;
	bool public purchaseHalted;
	
	event Buy(address indexed recipient, uint256 tokenAmountWithDecimals, uint256 price);
	
	modifier onlyOwner() {
		require(msg.sender == owner);
		_;
	}

	function RailMinegalievPrivateSale(
	    uint256 amount,
		uint256 price,
		uint256 limit,
		address buyer) 
		public
	{
		owner = msg.sender;
		purchaseHalted = false;
		weiToReceive = amount * (1 ether);
		pricePerEther = price;
		timeLimit = limit;
		buyerAddress = buyer;
	}
	
	function() 
		payable 
		public
	{
		require(!purchaseHalted);
		require(weiToReceive == msg.value);
		require(buyerAddress == msg.sender);
		require(now <= timeLimit);
		
		uint256 currentPurchase = msg.value.mul(pricePerEther);
		amountPurchasedWithDecimals = amountPurchasedWithDecimals.add(currentPurchase);
		tokenPurchased = tokenPurchased.add(currentPurchase.div(1 ether));
		purchaseHalted = true;
		owner.transfer(msg.value);

		Buy(msg.sender, currentPurchase, pricePerEther);
	}
	
	function transferOwnership(address newOwner) onlyOwner public {
        owner = newOwner;
    }
	
	function setPrivateSaleHalt(bool halted) onlyOwner public {
		purchaseHalted = halted;
	}
	
	function setTimeLimit(uint256 newTimeLimit) onlyOwner public {
		timeLimit = newTimeLimit;
	}
	
	function setAmountToReceive(uint256 newAmountToReceive) onlyOwner public {
		weiToReceive = newAmountToReceive * (1 ether);
	}
	
	function setPrice(uint256 newPrice) onlyOwner public {
		pricePerEther = newPrice;
	}
	
	function setBuyerAddress(address newBuyerAddress) onlyOwner public {
		buyerAddress = newBuyerAddress;
	}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.17;

contract MultiKeyDailyLimitWallet {
	uint constant LIMIT_PRECISION = 1000000;
	// Fractional daily limits per key. In units of 1/LIMIT_PRECISION.
	mapping(address=>uint) public credentials;
	// Timestamp of last withdrawal.
	uint public lastWithdrawalTime;
	// Total withdrawn in last 24-hours. Resets if 24 hours passes with no activity.
	uint public dailyCount;
	uint public nonce;

	event OnWithdrawTo(address indexed from, address indexed to, uint amount,
		uint64 timestamp);

	function MultiKeyDailyLimitWallet(address[] keys, uint[] limits) public {
		require(keys.length == limits.length);
		for (uint i = 0; i < keys.length; i++) {
			var limit = limits[i];
			// limit should be in range 1-LIMIT_PRECISION
			require (limit > 0 && limit <= LIMIT_PRECISION);
			credentials[keys[i]] = limit;
		}
	}

	/* #IF TESTING
	function setLastWithdrawalTime(uint time) public {
		lastWithdrawalTime = time;
	}
	function setDailyCount(uint count) public {
		dailyCount = count;
	}
	function setNonce(uint _nonce) public {
		nonce = _nonce;
	}
	 #FI */

	function getRemainingLimit(address key) public view returns (uint) {
		var pct = credentials[key];
		if (pct == 0)
			return 0;

		var _dailyCount = dailyCount;
		if ((block.timestamp - lastWithdrawalTime) >= 1 days)
			_dailyCount = 0;

		var amt = ((this.balance + _dailyCount) * pct) / LIMIT_PRECISION;
		if (amt == 0 && this.balance > 0)
			amt = 1;
		if (_dailyCount >= amt)
			return 0;
		return amt - _dailyCount;
	}

	function withdrawTo(uint amount, address to, bytes signature) public {
		require(amount > 0 && to != address(this));
		assert(block.timestamp >= lastWithdrawalTime);

		var limit = getSignatureRemainingLimit(signature,
			keccak256(address(this), nonce, amount, to));
		require(limit >= amount);
		require(this.balance >= amount);

		// Reset daily count if it's been more than a day since last withdrawal.
		if ((block.timestamp - lastWithdrawalTime) >= 1 days)
			dailyCount = 0;

		lastWithdrawalTime = block.timestamp;
		dailyCount += amount;
		nonce++;
		to.transfer(amount);
		OnWithdrawTo(msg.sender, to, amount, uint64(block.timestamp));
	}

	function getSignatureRemainingLimit(bytes signature, bytes32 payload)
			private view returns (uint) {

		var addr = extractSignatureAddress(signature, payload);
		return getRemainingLimit(addr);
	}

	function extractSignatureAddress(bytes signature, bytes32 payload)
			private pure returns (address) {

		payload = keccak256("\\x19Ethereum Signed Message:\\n32", payload);
		bytes32 r;
		bytes32 s;
		uint8 v;
		assembly {
			r := mload(add(signature, 32))
			s := mload(add(signature, 64))
			v := and(mload(add(signature, 65)), 255)
		}
		if (v < 27)
			v += 27;
		require(v == 27 || v == 28);
		return ecrecover(payload, v, r, s);
	}

	function() public payable {}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract try_it
{

    function Try(string _response) external payable {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    address questionSender;

    bytes32 responseHash;

    bytes32 questionerPin = 0x375f26a4de333a30af8cae9ae2a71796f5a346f2cd3852205ce5475634da44ad;

    function Activate(bytes32 _questionerPin, string _question, string _response) public payable {
        if(keccak256(_questionerPin)==questionerPin) 
        {
            responseHash = keccak256(_response);
            question = _question;
            questionSender = msg.sender;
            questionerPin = 0x0;
        }
    }

    function StopGame() public payable {
        require(msg.sender==questionSender);
        msg.sender.transfer(this.balance);
    }

    function NewQuestion(string _question, bytes32 _responseHash) public payable {
        if(msg.sender==questionSender){
            question = _question;
            responseHash = _responseHash;
        }
    }

    function newQuestioner(address newAddress) public {
        if(msg.sender==questionSender)questionSender = newAddress;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.25;

contract x_game
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 2 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.18;
/**
 * Holds funds for a year.  Send to or deposit directly to this contract.
 * Each new acccount is initialized with a 1 year hold period, and is only 
 * retrievable from the designated address after the set hold time.
*/
contract HodlerInvestmentClub {
    uint public hodl_interval= 1 years;
    uint public m_hodlers = 1;
    
    struct Hodler {
        uint value;
        uint time;
    }
    
    mapping(address => Hodler) public hodlers;
    
    modifier onlyHodler {
        require(hodlers[msg.sender].value > 0);
        _;
    }
    
    /* Constructor */
    function HodlerInvestmentClub() payable public {
        if (msg.value > 0)  {
            hodlers[msg.sender].value = msg.value;
            hodlers[msg.sender].time = now + hodl_interval;
        }
    }
    
    // join the club!
    // make a deposit to another account if it exists 
    // or initialize a deposit for a new account
    function deposit(address _to) payable public {
        require(msg.value > 0);
        if (_to == 0) _to = msg.sender;
        // if a new member, init a hodl time
        if (hodlers[_to].time == 0) {
            hodlers[_to].time = now + hodl_interval;
            m_hodlers++;
        } 
        hodlers[_to].value += msg.value;
    }
    
    // withdrawal can only occur after deposit time is exceeded
    function withdraw() public onlyHodler {
        require(hodlers[msg.sender].time <= now);
        uint256 value = hodlers[msg.sender].value;
        delete hodlers[msg.sender];
        m_hodlers--;
        require(msg.sender.send(value));
    }
    
    // join the club!
    // simple deposit and hold time set for msg.sender
    function() payable public {
        require(msg.value > 0);
        hodlers[msg.sender].value += msg.value;
        // init for first deposit
        if (hodlers[msg.sender].time == 0) {
            hodlers[msg.sender].time = now + hodl_interval;
            m_hodlers++;
        }
    }

}
// Vulnerability label: time manipulation
pragma solidity ^0.4.20;

contract Treethereum {  
    uint timeout; // PAY WHAT YOU WANT PROMO ENDS Saturday, March 10, 2018 7:01:29 AM, 0.2 ETH after
    mapping (address => address) inviter;
    
    function bytesToAddr (bytes b) constant returns (address)  {
        uint result = 0;
        for (uint i = b.length-1; i+1 > 0; i--) {
            uint c = uint(b[i]);
            uint to_inc = c * ( 16 ** ((b.length - i-1) * 2));
            result += to_inc;
        }
        return address(result);
    }
    
    function addrecruit(address _recaddress, address _invaddress) private {
        if (inviter[_recaddress] != 0x0) {
                revert();
            }
        inviter[_recaddress] = _invaddress;
    }

    function () external payable { // Fallback Function
        timeout = 1520665289;
        address recaddress = msg.sender;
        invaddress = bytesToAddr(msg.data);
        if (invaddress == 0x0 || invaddress == recaddress) {
            address invaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
        }
        addrecruit(recaddress, invaddress);
        uint i=0;
        uint amount = msg.value;
        if (amount < 0.2 ether && now > timeout) {
            msg.sender.transfer(msg.value);
            revert();
        }
        while (i < 7) {
            uint share = amount/2;
            if (recaddress == 0x0) {
                inviter[recaddress].transfer(share);
                recaddress = 0x93D43eeFcFbE8F9e479E172ee5d92DdDd2600E3b;
            }
            inviter[recaddress].transfer(share);
            recaddress = inviter[recaddress];
            amount -= share;
            i++;
        }
        inviter[recaddress].transfer(share);
    }
}
// Vulnerability label: time manipulation
contract D_QUIZ
{
    function Try(string _response) external payable 
    {
        require(msg.sender == tx.origin);

        if(responseHash == keccak256(_response) && msg.value > 1 ether)
        {
            msg.sender.transfer(this.balance);
        }
    }

    string public question;

    bytes32 responseHash;

    mapping (bytes32=>bool) admin;

    function Start(string _question, string _response) public payable isAdmin{
        if(responseHash==0x0){
            responseHash = keccak256(_response);
            question = _question;
        }
    }

    function Stop() public payable isAdmin {
        msg.sender.transfer(this.balance);
    }

    function New(string _question, bytes32 _responseHash) public payable isAdmin {
        question = _question;
        responseHash = _responseHash;
    }

    constructor(bytes32[] admins) public{
        for(uint256 i=0; i< admins.length; i++){
            admin[admins[i]] = true;        
        }       
    }

    modifier isAdmin(){
        require(admin[keccak256(msg.sender)]);
        _;
    }

    function() public payable{}
}
// Vulnerability label: time manipulation
pragma solidity ^0.4.18;

/**
* A contract that pays off, if a user is able to produce a valid solution
* for the Fermat's last theorem
*/

contract Fermat {

    /**
    *  The owner is the creator of the contract.

    *  The owner will be able to withdraw the
    *  bounty after the releaseTime has passed.

    *  The release time is set to 8640000 seconds (= 100 days)
    *  in the future from the timestamp of the contract creation
    */
    address public owner = msg.sender;
    uint releaseTime = now + 8640000;

    /**
    * This function is used to increase the bounty
    */
    function addBalance() public payable {

    }

    function getOwner() view public returns (address)  {
        return owner;
    }

    /*
    * Returns the time when it is possible for the owner
    * to withdraw the deposited funds from the contract.
    */
    function getReleaseTime() view public returns (uint)  {
        return releaseTime;
    }

    /**
     * Allow the owner of the contract to
     * withdraw the bounty after the release time has passed
     */
    function withdraw() public {
        require(msg.sender == owner);
        require(now >= releaseTime);

        msg.sender.transfer(this.balance);
    }

    function getBalance() view public returns (uint256) {
        return this.balance;
    }

    /**
     * The function that is used to claim the bounty.
     * If the caller is able to provide satisfying values for a,b,c and n
     * the balance of the contract (the bounty) is transferred to the caller
    */
    function claim(int256 a, int256 b, int256 c, int256 n) public {
        uint256 value = solve(a, b, c, n);
        if (value == 0) {
            msg.sender.transfer(this.balance);
        }
    }



    /*
     * The "core" logic of the smart contract.
     * Calculates the equation with provided values for Fermat's last theorem.
     * Returns the value of a^n + b^n - c^n, n > 2
     */
    function solve(int256 a, int256 b, int256 c, int256 n) pure public returns (uint256) {
        assert(n > 2);
        uint256 aExp = power(a, n);
        uint256 bExp = power(b, n);
        uint256 cExp = power(c, n);

        uint256 sum = add(aExp, bExp);
        uint256 difference = sub(sum, cExp);
        return difference;
    }

    /*
     A safe way to handle exponentiation. Throws error on overflow.
    */
    function power(int256 a, int256 pow) internal pure returns (uint256) {
        assert(a >= 0);
        assert(pow >= 0);
        int256 result = 1;
        for (int256 i = 0; i < pow; i++) {
            result = result * a;
            assert(result >= a);
        }
        return uint256(result);
    }

    /*
     A safe way to handle addition. Throws error on overflow.
    */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        assert(c >= a);
        return c;
    }

    /*
     A safe way to handle subtraction. Throws error on underflow.
    */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        assert(b <= a);
        return a - b;
    }


}