Contract 0x6c228badcf181febf7f3b4a61f8e26086942a3db

 

TxHash Block Age From To Value [TxFee]
0x0335d873eb9f13f764188c165808c8f2aa1c7a89070edbb4b125332e47410e3872542171 day 5 hrs ago0x1f64a8c8cfccb79aa77a94598a41189cb55ee251 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00043362
0x269d30023ab072e4c85406461f178b9e7453a3c4e38518a5b2be8c064fbc820d72535661 day 9 hrs ago0x334b2e415630f2fc389d69140fdc6e5e1513006d IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00050162
0xcfdd17dae5c0c4843aa8245bb877317c8c8c482629e3a4c0cc0376e3093c9fc172532901 day 11 hrs ago0xbe34bf908e942a7be53062a70b111affb23b9491 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00071724
0x183e442a22aa544387270d12aeb908839eba713180fba319f746d299f6ebfe7672532731 day 11 hrs ago0xbe34bf908e942a7be53062a70b111affb23b9491 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00071724
0xeb83753f3dfa7da45c5a8b579c3535d6678e9fc09b910fea9875807eda57a43272531041 day 12 hrs ago0x884bfa60cb5a4b519784dfad9931381f3bacf871 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00057328
0xdffd97635ca5ddebe82a6f4c9356651442ce21b966f0ad4e6eaabfd2bd05c69672530891 day 12 hrs ago0x884bfa60cb5a4b519784dfad9931381f3bacf871 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00051996
0x7e163a363370d0d2a86eca472ce06737fd8a47c3bce0cdb4d6972cf8dcea889f72495552 days 8 hrs ago0xc318d6ce96b7c066b78b51470445b013db9319d6 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0x7cc1be9a78811a564aa811b975ead6d189122afcf68501655fe12f850e58389772488012 days 12 hrs ago0x06e1a09f0f8835b0c8d2d01b5ad63701a17ef014 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00042996
0xcd70176f6f6d47df28ae4bf60c881067b2952119eb58946986a6270a3146091f72483722 days 15 hrs ago0x180f6972459393d28e75ec44af6e127bbdf988a2 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.000932412
0xcc4ec5eef028d6217544e80f7d788178ef4ec51353ac4289be6a354093be736172480512 days 17 hrs ago0x7de765cdc07ecb6fead84a743dd1b6acd898296a IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00057328
0x3c7fd064b7723f75892c5d26325c5ce88f753c823d0e9997159be55081f429ad72457453 days 5 hrs ago0x1f599fa8a6a76a6604101ed8b9a60f8d5702b9ab IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0x6306d641a4059ad80516e9288d771838d0fd99892c0e0ae9c97c12a8856e0a1f72452493 days 8 hrs ago0x9b0649e8109e10faab13b7b168c9924e69be5a33 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0007631712
0xc388d23e2b1c0774f0a36d328940cbfb46d456a51bc8f6789b4b006247def30472451733 days 9 hrs ago0xe55940494b49a0869ef15cd781e4b2c0cf1d4ec4 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00035894
0x9f7f69fe1d2bb8b621ef2a6b9055365ccd25b7c70a994daa01f9f8c7bc016a5b72448223 days 11 hrs ago0xaec6c2035e98efa5b463ed41d7dc51d8c560b823 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00051996
0x7b6d4f48a73ea35010e1cc162a3e728e47c76ec0f3a569f4423e97db53bd0c5c72446913 days 11 hrs ago0xdefd6cb3df2e9f43767b19647e8e7d7754aaa5e7 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0009790326
0x037abd681ce78a37a83f540b6294dc2251b0f436dff9c0f0917c7b14f311304972446783 days 12 hrs ago0xdefd6cb3df2e9f43767b19647e8e7d7754aaa5e7 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0009790326
0x41c9590ef883e91e9ef56ae2d875f308b32178d4f8d9464d04059df950746cb072445693 days 12 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0006294816
0xa060aca2c74de291dc207d0851ac44364c0490c1bd2d798faf0d075f3f18663f72445673 days 12 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0xb2fee19ed1244d62f545a18002347d63a4b32d7a8a197c1bb2ef49a66621585b72445253 days 12 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0xbecd1c39c835f1da4a90b822053d78cc678ca85456a07fccaa35d4925371f23472445133 days 13 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0x74487157453130e8af3ffeee0f016f29415d75328d8a577a0013a83c573ba05272444883 days 13 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.0003583
0x300653edd2d68ec679d7014283bb12c2e91b80296f2a062a1f9b5a7350660fc772444743 days 13 hrs ago0xb51ebe56f8dcc911c97d1c8697d56b3bb37409d3 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00035862
0x2dc56fed0eefe0f122abd0306942195c7dad5bbca478ee5ebe3df033811aa7c872443213 days 14 hrs ago0x51f12b14ebd64a4d9f21d9464e489734dc760573 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.000537292
0x0099016af1f73a1e7c9de98bec1b62502212f310052d63ddc2af0aae4226469e72442073 days 14 hrs ago0x71a318de81189818c79db1b4c18f015265356236 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00051996
0x1c6c4d077e43ad266c2b26d4e38ffc39c0cedc5a6bf68b76cd75a823187cae8372441693 days 14 hrs ago0xbf86bf0e90277c742cc98c9f3f4ed304c7f39d39 IN  0x6c228badcf181febf7f3b4a61f8e26086942a3db0 Ether0.00095326
[ Download CSV Export 

Internal Transactions as a result of Contract Execution

Parent TxHash Block Age From To Value
Warning: The compiled contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) Solidity Compiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: EmcoVoucher
Compiler Version: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimizer):  200


Contract Source Code
pragma solidity 0.4.24;
/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (a == 0) {
      return 0;
    }

    c = a * b;
    assert(c / a == b);
    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 a, uint256 b) internal pure returns (uint256) {
    // assert(b > 0); // Solidity automatically throws when dividing by 0
    // uint256 c = a / b;
    // assert(a == b * c + a % b); // There is no case in which this doesn't hold
    return a / b;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
    c = a + b;
    assert(c >= a);
    return c;
  }
}


/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev 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);
}

/**
 * @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
  );
}

/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances.
 */
contract BasicToken is ERC20Basic {
  using SafeMath for uint256;

  mapping(address => uint256) balances;

  uint256 totalSupply_;

  /**
  * @dev total number of tokens in existence
  */
  function totalSupply() public view returns (uint256) {
    return totalSupply_;
  }

  /**
  * @dev transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  function transfer(address _to, uint256 _value) public returns (bool) {
    require(_to != address(0));
    require(_value <= balances[msg.sender]);

    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    emit Transfer(msg.sender, _to, _value);
    return true;
  }

  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of.
  * @return An uint256 representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) public view returns (uint256) {
    return balances[_owner];
  }

}

/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * @dev https://github.com/ethereum/EIPs/issues/20
 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20, BasicToken {

  mapping (address => mapping (address => uint256)) internal allowed;


  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(
    address _from,
    address _to,
    uint256 _value
  )
    public
    returns (bool)
  {
    require(_to != address(0));
    require(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    emit Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
   *
   * Beware that changing an allowance with this method brings the risk that someone may use both the old
   * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
   * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
   * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    emit Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(
    address _owner,
    address _spender
   )
    public
    view
    returns (uint256)
  {
    return allowed[_owner][_spender];
  }

  /**
   * @dev Increase the amount of tokens that an owner allowed to a spender.
   *
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _addedValue The amount of tokens to increase the allowance by.
   */
  function increaseApproval(
    address _spender,
    uint _addedValue
  )
    public
    returns (bool)
  {
    allowed[msg.sender][_spender] = (
      allowed[msg.sender][_spender].add(_addedValue));
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  /**
   * @dev Decrease the amount of tokens that an owner allowed to a spender.
   *
   * approve should be called when allowed[_spender] == 0. To decrement
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _subtractedValue The amount of tokens to decrease the allowance by.
   */
  function decreaseApproval(
    address _spender,
    uint _subtractedValue
  )
    public
    returns (bool)
  {
    uint oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue > oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}


/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
  address public owner;


  event OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


  /**
   * @dev The Ownable constructor sets the original `owner` of the contract to the sender
   * account.
   */
  constructor() public {
    owner = msg.sender;
  }

  /**
   * @dev Throws if called by any account other than the owner.
   */
  modifier onlyOwner() {
    require(msg.sender == owner);
    _;
  }

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

/**
* @title Emco token
* @dev Emco token implementation
*/
contract EmcoToken is StandardToken, Ownable {

	string public constant name = "EmcoToken";
	string public constant symbol = "EMCO";
	uint8 public constant decimals = 18;

	uint public constant INITIAL_SUPPLY = 1500000 * (10 ** uint(decimals));
	uint public constant MAX_SUPPLY = 36000000 * (10 ** uint(decimals));

	mapping (address => uint) public miningBalances;
	mapping (address => uint) public lastMiningBalanceUpdateTime;

	address systemAddress;

	uint public constant DAY_MINING_DEPOSIT_LIMIT = 360000 * (10 ** uint(decimals));
	uint public constant TOTAL_MINING_DEPOSIT_LIMIT = 3600000 * (10 ** uint(decimals));
	uint currentDay;
	uint currentDayDeposited;
	uint public miningTotalDeposited;

	mapping(address => bytes32) public userReferralCodes;
	mapping(bytes32 => address) public referralCodeOwners;
	mapping(address => address) public referrals;

	event Mine(address indexed beneficiary, uint value);

	event MiningBalanceUpdated(address indexed owner, uint amount, bool isDeposit);

	constructor() public {
		balances[msg.sender] = INITIAL_SUPPLY;
		systemAddress = msg.sender;
		totalSupply_ = INITIAL_SUPPLY;
		emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
	}

	function setReferralCode(bytes32 _code) public returns (bytes32) {
		require(_code != "", "Ref code should not be empty");
		require(referralCodeOwners[_code] == address(0), "This referral code is already used");
		require(userReferralCodes[msg.sender] == "", "Referal code is already set");
		userReferralCodes[msg.sender] = _code;
		referralCodeOwners[_code] = msg.sender;
		return userReferralCodes[msg.sender];
	}

	function setReferral(bytes32 _code) public {
		require(referralCodeOwners[_code] != address(0), "Invalid referral code");
		require(referrals[msg.sender] == address(0), "You already have a referrer");
		address referrer = referralCodeOwners[_code];
		require(referrer != msg.sender, "Can not invite yourself");
		referrals[msg.sender] = referrer;
	}

	/**
	* @dev Gets the balance of specified address (amount of tokens on main balance 
	* plus amount of tokens on mining balance).
	* @param _owner The address to query the balance of.
	* @return An uint256 representing the amount owned by the passed address.
	*/
	function balanceOf(address _owner) public view returns (uint balance) {
		return balances[_owner].add(miningBalances[_owner]);
	}

	/**
	* @dev Gets the mining balance if caller.
	* @param _owner The address to query the balance of.
	* @return An uint256 representing the amount of tokens of caller's mining balance
	*/
	function miningBalanceOf(address _owner) public view returns (uint balance) {
		return miningBalances[_owner];
	}

	/**
	* @dev Moves specified amount of tokens from main balance to mining balance 
	* @param _amount An uint256 representing the amount of tokens to transfer to main balance
	*/
	function depositToMiningBalance(uint _amount) public {
		require(balances[msg.sender] >= _amount, "not enough tokens");
		require(getCurrentDayDeposited().add(_amount) <= DAY_MINING_DEPOSIT_LIMIT,
			"Day mining deposit exceeded");
		require(miningTotalDeposited.add(_amount) <= TOTAL_MINING_DEPOSIT_LIMIT,
			"Total mining deposit exceeded");

		balances[msg.sender] = balances[msg.sender].sub(_amount);
		miningBalances[msg.sender] = miningBalances[msg.sender].add(_amount);
		miningTotalDeposited = miningTotalDeposited.add(_amount);
		updateCurrentDayDeposited(_amount);
		lastMiningBalanceUpdateTime[msg.sender] = now;
		emit MiningBalanceUpdated(msg.sender, _amount, true);
	}

	/**
	* @dev Moves specified amount of tokens from mining balance to main balance
	* @param _amount An uint256 representing the amount of tokens to transfer to mining balance
	*/
	function withdrawFromMiningBalance(uint _amount) public {
		require(miningBalances[msg.sender] >= _amount, "not enough tokens on mining balance");

		miningBalances[msg.sender] = miningBalances[msg.sender].sub(_amount);
		balances[msg.sender] = balances[msg.sender].add(_amount);

		//updating mining limits
		miningTotalDeposited.sub(_amount);
		lastMiningBalanceUpdateTime[msg.sender] = now;
		emit MiningBalanceUpdated(msg.sender, _amount, false);
	}

	/**
	* @dev Mine tokens. For every 24h for each user�s token on mining balance, 
	* 1% is burnt on mining balance and Reward % is minted to the main balance. 15% fee of difference 
	* between minted coins and burnt coins goes to system address.
	*/ 
	function mine() public {
		require(totalSupply_ < MAX_SUPPLY, "mining is over");
		uint reward = getReward(totalSupply_);
		uint daysForReward = getDaysForReward();

		uint mintedAmount = miningBalances[msg.sender].mul(reward.sub(1000000000))
										.mul(daysForReward).div(100000000000);
		require(mintedAmount != 0, "mining will not produce any reward");

		uint amountToBurn = miningBalances[msg.sender].mul(daysForReward).div(100);

		//check exceeding max number of tokens
		if(totalSupply_.add(mintedAmount) > MAX_SUPPLY) {
			uint availableToMint = MAX_SUPPLY.sub(totalSupply_);
			amountToBurn = availableToMint.div(mintedAmount).mul(amountToBurn);
			mintedAmount = availableToMint;
		}

		totalSupply_ = totalSupply_.add(mintedAmount);

		miningBalances[msg.sender] = miningBalances[msg.sender].sub(amountToBurn);
		balances[msg.sender] = balances[msg.sender].add(amountToBurn);

		uint userReward;
		uint referrerReward = 0;
		address referrer = referrals[msg.sender];
		
		if(referrer == address(0)) {
			userReward = mintedAmount.mul(85).div(100);
		} else {
			userReward = mintedAmount.mul(86).div(100);
			referrerReward = mintedAmount.div(100);
			balances[referrer] = balances[referrer].add(referrerReward);
			emit Mine(referrer, referrerReward);
			emit Transfer(address(0), referrer, referrerReward);
		}
		balances[msg.sender] = balances[msg.sender].add(userReward);

		emit Mine(msg.sender, userReward);
		emit Transfer(address(0), msg.sender, userReward);

		//update limits
		miningTotalDeposited = miningTotalDeposited.sub(amountToBurn);
		emit MiningBalanceUpdated(msg.sender, amountToBurn, false);

		//set system fee
		uint systemFee = mintedAmount.sub(userReward).sub(referrerReward);
		balances[systemAddress] = balances[systemAddress].add(systemFee);

		emit Mine(systemAddress, systemFee);
		emit Transfer(address(0), systemAddress, systemFee);

		lastMiningBalanceUpdateTime[msg.sender] = now;
	}

	/**
	* @dev Set system address
	* @param _systemAddress An address to set
	*/
	function setSystemAddress(address _systemAddress) public onlyOwner {
		systemAddress = _systemAddress;
	}

	/**
	* @dev Get sum of deposits to mining accounts for current day
	*/
	function getCurrentDayDeposited() public view returns (uint) {
		if(now / 1 days == currentDay) {
			return currentDayDeposited;
		} else {
			return 0;
		}
	}

	/**
	* @dev Get number of days for reward on mining. Maximum 100 days.
	* @return An uint256 representing number of days user will get reward for.
	*/
	function getDaysForReward() public view returns (uint rewardDaysNum){
		if(lastMiningBalanceUpdateTime[msg.sender] == 0) {
			return 0;
		} else {
			uint value = (now - lastMiningBalanceUpdateTime[msg.sender]) / (1 days);
			if(value > 100) {
				return 100;
			} else {
				return value;
			}
		}
	}

	/**
	* @dev Calculate current mining reward based on total supply of tokens
	* @return An uint256 representing reward in percents multiplied by 1000000000
	*/
	function getReward(uint _totalSupply) public pure returns (uint rewardPercent){
		uint rewardFactor = 1000000 * (10 ** uint256(decimals));
		uint decreaseFactor = 41666666;

		if(_totalSupply < 23 * rewardFactor) {
			return 2000000000 - (decreaseFactor.mul(_totalSupply.div(rewardFactor)));
		}

		if(_totalSupply < MAX_SUPPLY) {
			return 1041666666;
		} else {
			return 1000000000;
		} 
	}

	function updateCurrentDayDeposited(uint _addedTokens) private {
		if(now / 1 days == currentDay) {
			currentDayDeposited = currentDayDeposited.add(_addedTokens);
		} else {
			currentDay = now / 1 days;
			currentDayDeposited = _addedTokens;
		}
	}

}

/**
* @title Emco voucher
* @dev Emco voucher implementation
*/
contract EmcoVoucher is Ownable {

	address signerAddress;
	EmcoToken public token;

	mapping (uint => bool) usedNonces;

	event VoucherRedemption(address indexed caller, uint indexed nonce, uint amount);

	constructor(EmcoToken _token) public {
		require(_token != address(0), "token address should not be empty");
		token = _token;
	}

	/**
	* @dev Sets the signer address. Signatures of vouchers would be checked with this address.
	* @param _address address of signer
	*/
	function setSignerAddress(address _address) public onlyOwner {
		require(_address != address(0), "signer address should not be empty");
		signerAddress = _address;
	}

	/**
	* @dev Function to withdraw tokens from conract. Is awailable only for token owner
	* @param _to Address tokens would be sent to
	* @param _amount An uint256 representing amount of tokens than would be sent
	*/
	function withdrawTokens(address _to, uint _amount) public onlyOwner {
		token.transfer(_to, _amount);
	}

	/**
	* @dev Check if nonce is used
	* @param _nonce Nonce to check
	* @return True is nonce is used
	*/
	function isNonceUsed(uint _nonce) public view returns (bool isUsed) {
		return usedNonces[_nonce];
	}

	/**
	* @dev Activates voucher. Checks nonce amount and signature and if it is correct
	* send amount of tokens to caller
	* @param nonce voucher's nonce
	* @param amount voucher's amount
	* @param signature voucher's signature
	*/
	function activateVoucher(uint256 nonce, uint256 amount, bytes signature) public {
		require(!usedNonces[nonce], "nonce is already used");
		require(nonce != 0, "nonce should be greater than zero");
		require(amount != 0, "amount should be greater than zero");
		usedNonces[nonce] = true;

		address beneficiary = msg.sender;

		bytes32 message = prefixed(keccak256(abi.encodePacked(
			this,
			nonce,
			amount,
		  beneficiary)));

		address signedBy = recoverSigner(message, signature);
		require(signedBy == signerAddress);

		require(token.transfer(beneficiary, amount));
		emit VoucherRedemption(msg.sender, nonce, amount);
	}

	function splitSignature(bytes sig) internal pure returns (uint8, bytes32, bytes32) {
		require(sig.length == 65);

		bytes32 r;
		bytes32 s;
		uint8 v;

		assembly {
			r := mload(add(sig, 32))
			s := mload(add(sig, 64))
			v := byte(0, mload(add(sig, 96)))
		}

		return (v, r, s);
	}

	function recoverSigner(bytes32 message, bytes sig) internal pure returns (address) {
		uint8 v;
		bytes32 r;
		bytes32 s;

		(v, r, s) = splitSignature(sig);

		return ecrecover(message, v, r, s);
	}

	// Builds a prefixed hash to mimic the behavior of eth_sign.
	function prefixed(bytes32 hash) internal pure returns (bytes32) {
		return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
	}

}

Contract ABI
[{"constant":false,"inputs":[{"name":"_address","type":"address"}],"name":"setSignerAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"withdrawTokens","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_nonce","type":"uint256"}],"name":"isNonceUsed","outputs":[{"name":"isUsed","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"nonce","type":"uint256"},{"name":"amount","type":"uint256"},{"name":"signature","type":"bytes"}],"name":"activateVoucher","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"caller","type":"address"},{"indexed":true,"name":"nonce","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"VoucherRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Contract Creation Code
608060405234801561001057600080fd5b50604051602080610a6f833981016040525160008054600160a060020a03191633179055600160a060020a03811615156100d157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f746f6b656e20616464726573732073686f756c64206e6f7420626520656d707460448201527f7900000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60028054600160a060020a031916600160a060020a039290921691909117905561096f806101006000396000f30060806040526004361061008d5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663046dc166811461009257806306b091f9146100b55780635d00bb12146100d9578063715018a6146101055780638da5cb5b1461011a578063dc21d5211461014b578063f2fde38b146101ab578063fc0c546a146101cc575b600080fd5b34801561009e57600080fd5b506100b3600160a060020a03600435166101e1565b005b3480156100c157600080fd5b506100b3600160a060020a03600435166024356102ad565b3480156100e557600080fd5b506100f1600435610363565b604080519115158252519081900360200190f35b34801561011157600080fd5b506100b3610378565b34801561012657600080fd5b5061012f6103e4565b60408051600160a060020a039092168252519081900360200190f35b34801561015757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526100b39482359460248035953695946064949201919081908401838280828437509497506103f39650505050505050565b3480156101b757600080fd5b506100b3600160a060020a036004351661072a565b3480156101d857600080fd5b5061012f61074d565b600054600160a060020a031633146101f857600080fd5b600160a060020a038116151561027e576040805160e560020a62461bcd02815260206004820152602260248201527f7369676e657220616464726573732073686f756c64206e6f7420626520656d7060448201527f7479000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031633146102c457600080fd5b600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561033357600080fd5b505af1158015610347573d6000803e3d6000fd5b505050506040513d602081101561035d57600080fd5b50505050565b60009081526003602052604090205460ff1690565b600054600160a060020a0316331461038f57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b6000838152600360205260408120548190819060ff161561045e576040805160e560020a62461bcd02815260206004820152601560248201527f6e6f6e636520697320616c726561647920757365640000000000000000000000604482015290519081900360640190fd5b8515156104db576040805160e560020a62461bcd02815260206004820152602160248201527f6e6f6e63652073686f756c642062652067726561746572207468616e207a657260448201527f6f00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b841515610558576040805160e560020a62461bcd02815260206004820152602260248201527f616d6f756e742073686f756c642062652067726561746572207468616e207a6560448201527f726f000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600086815260036020908152604091829020805460ff1916600117905581516c0100000000000000000000000030810282840152603482018a90526054820189905233908102607483015283516068818403018152608890920193849052815190965061061c9391928291908401908083835b602083106105ea5780518252601f1990920191602091820191016105cb565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902061075c565b91506106288285610806565b600154909150600160a060020a0380831691161461064557600080fd5b600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018990529151919092169163a9059cbb9160448083019260209291908290030181600087803b1580156106b457600080fd5b505af11580156106c8573d6000803e3d6000fd5b505050506040513d60208110156106de57600080fd5b505115156106eb57600080fd5b604080518681529051879133917f63a68ae837e5978794ee766a078db1dd98e02ca34057b407e853b89534e9568f9181900360200190a3505050505050565b600054600160a060020a0316331461074157600080fd5b61074a8161088d565b50565b600254600160a060020a031681565b604080517f19457468657265756d205369676e6564204d6573736167653a0a333200000000602080830191909152603c80830185905283518084039091018152605c909201928390528151600093918291908401908083835b602083106107d45780518252601f1990920191602091820191016107b5565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912095945050505050565b6000806000806108158561090a565b60408051600080825260208083018085528d905260ff8716838501526060830186905260808301859052925195985093965091945060019360a0808401949293601f19830193908390039091019190865af1158015610878573d6000803e3d6000fd5b5050604051601f190151979650505050505050565b600160a060020a03811615156108a257600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806000806000808651604114151561092357600080fd5b505050506020830151604084015160609094015160001a949093925090505600a165627a7a72305820a4a83defada8b821d3dc906c4d3ea5a572b78cd6acf16449b2c814e2eaf4d0660029000000000000000000000000d97e471695f73d8186deabc1ab5b8765e667cd96


    Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000d97e471695f73d8186deabc1ab5b8765e667cd96

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d97e471695f73d8186deabc1ab5b8765e667cd96


   Swarm Source:
bzzr://a4a83defada8b821d3dc906c4d3ea5a572b78cd6acf16449b2c814e2eaf4d066
Block Age transaction Difficulty GasUsed Reward
Block Age Uncle Number Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.