Sponsored Link:   trade.io - The Future of Crypto Trading - A Better, Faster, Smarter Crypto Exchange - Pre-Register Now!
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 2 txns
Misc
Address Watch: Add To Watch List
Contract Creator: 0x9fc05b2dae3a22ac99a1bcc4328311da09090fb4at txn 0xa2a9625a4a2dca70f8154849cc2a7b908bd5d9faf92172f64d29586180e2d6e9
Token Balances:
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact match)
Contract Name: lockEtherPay
Compiler Version: v0.4.24-nightly.2018.5.10+commit.85d417a8
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.18;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  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) {
    // 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 c;
  }
  function sub(uint256 a, uint256 b) internal pure returns (uint256) {
    assert(b <= a);
    return a - b;
  }
  function add(uint256 a, uint256 b) internal pure returns (uint256) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract token {

  function balanceOf(address _owner) public constant returns (uint256 balance);
  function transfer(address _to, uint256 _value) public returns (bool success);

}

contract Ownable {
  address public owner;
  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 transfer control of the contract to a newOwner.
   * @param newOwner The address to transfer ownership to.
   */
  function transferOwnership(address newOwner) onlyOwner public {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }
}

contract lockEtherPay is Ownable {
	using SafeMath for uint256;

  token token_reward;
  address public beneficiary;
  bool public isLocked = false;
  bool public isReleased = false;
  uint256 public start_time;
  uint256 public end_time;
  uint256 public fifty_two_weeks = 29289600;

  event TokenReleased(address beneficiary, uint256 token_amount);

  constructor() public{
    token_reward = token(0xAa1ae5e57dc05981D83eC7FcA0b3c7ee2565B7D6);
    beneficiary = 0x0B15efCAD4C610b04C435d22872bBf6CB461fecB;
  }

  function tokenBalance() constant public returns (uint256){
    return token_reward.balanceOf(this);
  }

  function lock() public onlyOwner returns (bool){
  	require(!isLocked);
  	require(tokenBalance() > 0);
  	start_time = now;
  	end_time = start_time.add(fifty_two_weeks);
  	isLocked = true;
  }

  function lockOver() constant public returns (bool){
  	uint256 current_time = now;
	return current_time > end_time;
  }

	function release() onlyOwner public{
    require(isLocked);
    require(!isReleased);
    require(lockOver());
    uint256 token_amount = tokenBalance();
    token_reward.transfer( beneficiary, token_amount);
    emit TokenReleased(beneficiary, token_amount);
    isReleased = true;
  }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"end_time","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"beneficiary","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"fifty_two_weeks","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"start_time","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"release","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lockOver","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenBalance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isLocked","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"lock","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isReleased","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"name":"beneficiary","type":"address"},{"indexed":false,"name":"token_amount","type":"uint256"}],"name":"TokenReleased","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526002805460a060020a61ffff02191690556301beec8060055534801561002957600080fd5b5060008054600160a060020a0319908116331790915560018054821673aa1ae5e57dc05981d83ec7fca0b3c7ee2565b7d617905560028054909116730b15efcad4c610b04c435d22872bbf6cb461fecb17905561063f8061008b6000396000f3006080604052600436106100b95763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631624335681146100be57806338af3eed146100e55780636e15266a14610116578063834ee4171461012b57806386d1a69f146101405780638da5cb5b146101575780639b7faaf01461016c5780639e1a4d1914610195578063a4e2d634146101aa578063f2fde38b146101bf578063f83d08ba146101e0578063fa2a8997146101f5575b600080fd5b3480156100ca57600080fd5b506100d361020a565b60408051918252519081900360200190f35b3480156100f157600080fd5b506100fa610210565b60408051600160a060020a039092168252519081900360200190f35b34801561012257600080fd5b506100d361021f565b34801561013757600080fd5b506100d3610225565b34801561014c57600080fd5b5061015561022b565b005b34801561016357600080fd5b506100fa6103d1565b34801561017857600080fd5b506101816103e0565b604080519115158252519081900360200190f35b3480156101a157600080fd5b506100d36103e8565b3480156101b657600080fd5b5061018161047e565b3480156101cb57600080fd5b50610155600160a060020a036004351661049f565b3480156101ec57600080fd5b50610181610533565b34801561020157600080fd5b506101816105db565b60045481565b600254600160a060020a031681565b60055481565b60035481565b60008054600160a060020a0316331461024357600080fd5b60025474010000000000000000000000000000000000000000900460ff16151561026c57600080fd5b6002547501000000000000000000000000000000000000000000900460ff161561029557600080fd5b61029d6103e0565b15156102a857600080fd5b6102b06103e8565b600154600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a03928316600482015260248101859052905193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561032457600080fd5b505af1158015610338573d6000803e3d6000fd5b505050506040513d602081101561034e57600080fd5b505060025460408051600160a060020a0390921682526020820183905280517f9cf9e3ab58b33f06d81842ea0ad850b6640c6430d6396973312e1715792e7a919281900390910190a1506002805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000179055565b600054600160a060020a031681565b600454421190565b600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600092600160a060020a0316916370a0823191602480830192602092919082900301818787803b15801561044d57600080fd5b505af1158015610461573d6000803e3d6000fd5b505050506040513d602081101561047757600080fd5b5051905090565b60025474010000000000000000000000000000000000000000900460ff1681565b600054600160a060020a031633146104b657600080fd5b600160a060020a03811615156104cb57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008054600160a060020a0316331461054b57600080fd5b60025474010000000000000000000000000000000000000000900460ff161561057357600080fd5b600061057d6103e8565b1161058757600080fd5b4260038190556005546105a0919063ffffffff6105fd16565b6004556002805474ff000000000000000000000000000000000000000019167401000000000000000000000000000000000000000017905590565b6002547501000000000000000000000000000000000000000000900460ff1681565b60008282018381101561060c57fe5b93925050505600a165627a7a7230582034b8b290fbd50fae9703b99b68531f0579b6890cb96d0db24ad6d067ab2ac69e0029

   Swarm Source:
bzzr://34b8b290fbd50fae9703b99b68531f0579b6890cb96d0db24ad6d067ab2ac69e

 

View All
Block Age txn Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "downvote" button for any spammy posts, and the "upvote" for interesting conversations.