Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 17 txns
Misc:
Address Watch: Add To Watch List
Contract Creator: 0x87cf2332f4e4cd44cbf33be0979c0cb1be2e592fat txn 0x39c8fd560f417b548a8d81b893ae5690f11cbbb5c3664b5cf964d0af8056b887
 Latest 17 txns

TxHash Age From To Value [TxFee]
0xd6b3b6573a574b09f7789832147e55ad73648ff0a314f30e3d7b5b3848164ce518 days 5 hrs ago0x69a8e1b6f1bd0c2e2fe1bff06f80bd23d5e7b0b3  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.495 Ether0.001588293
0xbac6e83b7cfa9ec8a998a7646b31d529bc51cddc48eb1ddb86f9168df2d9439718 days 10 hrs ago0xac420f68d143773312405be49347f88eb381fc7e  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.99 Ether0.001588293
0xe312f8ab6164bb04b87ae3e9ffbb3bbb4c157aaa491e0d8c6a283377f9c4eeef18 days 10 hrs ago0xab85de589813fca428656b32b0f3844399f5a906  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf91 Ether0.001588293
0x840d554901c734be081ef8c233e14213c24e93cc4d1763407185619441199fee19 days 9 hrs ago0xda437c7a11ddaa2f6658e9a234ed3df68302bfbd  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf91.329975924 Ether0.000147
0x8530cf84574084780a018c6ae600a6ee94f51ba7f92035bef6de838036e84aa723 days 19 hrs ago0x62c9c4f2206685347cb9061aea5cd6da259189de  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.25 Ether0.001588293
0x108c432c19537369e6e09a170ecdbd4ff5ee6eeb4586c35f4d2dc39fef2e905a25 days 10 hrs ago0x4955d556402976dc29cb29a65be6f1305c32e400  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90 Ether0.00070944
0x57ae1bf27872ddaa1c9ee8b5e95e11731485cceabd041b13cd5c1de2d4b8e24128 days 6 hrs ago0x77632f7461e149769f7c28ed482b264d891618c1  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.04 Ether0.000171904
0x4cdb7ea111ffb928b94e256c8746d7b1b580eccfca6d51373fbef6b3419286b528 days 21 hrs ago0x19128c5d8ae78770811b4a040321d7c3dc7b8248  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf91.827905415 Ether0.000378165
0x1543d1029a3a40fef1e9aa6efa86042a4037eab68192f45a474a318e87484eb531 days 19 hrs ago0x19128c5d8ae78770811b4a040321d7c3dc7b8248  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf92 Ether0.000063
0xc758b7b8d87e60257997cb158b435c9862992ca899cd1b37af6ffaee32e1450431 days 21 hrs ago0x1d7505087ffd0024e8cc215eef4c509854f93c82  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.25 Ether0.004159815
0xb7c44220eb4b4b4d40011cc15b8fe5ba3e58b5c31bd11a8e2e54027cb9c8c99b32 days 19 hrs ago0x1d7505087ffd0024e8cc215eef4c509854f93c82  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.25 Ether0.00118184
0x2e0b6193a71084e21a84a98c85071a4576bba045dce6e2bc0def6453ba278e5532 days 20 hrs ago0x1d7505087ffd0024e8cc215eef4c509854f93c82  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.25 Ether0.000861
0x5f1cb86a80a153b7bc642d18a8219ba67527e68055449536189d61db8ea4542233 days 15 hrs ago0x41254e347bdc2a3566df4a875ac0fb89e1d44a47  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.5 Ether0.001588293
0x17e5a0f50b7184ea7a6a976d4698e70584d56b03aecd7efec2d83a232a4acf4235 days 12 hrs ago0xe3d4041e7f4fc01314ff2334228bc7f249d08a7e  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf9182.784 Ether0.00121266
0x8b39427813218a5a0e5f450fdbca03bd0a03c22cd71a7935d760fc42c81b56a635 days 12 hrs ago0xe3d4041e7f4fc01314ff2334228bc7f249d08a7e  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.25 Ether0.00151266
0x64aa7593e060187593e9011b3f9f4b00b522d16740029ff832c5fee6d4f72c3136 days 9 hrs ago0x247695a20b0536f952a9c5f20360124f1549348b  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf93.32 Ether0.001588293
0x3242d9a1cbda87331de891c523d68a77fde779ce0a48cee29ae3b775f1c5283c36 days 14 hrs ago0xb6ea3fd3ef4a957032cf840cb5b33ef3a37fd00d  IN   0x0990a01c880d016e19dcd49ec549f266f8b41bf90.46 Ether0.00422532
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 2 Internal Transactions

ParentTxHash Block Age From To Value
0x20f4f0e74806243910008101dfe2c1ffed30dc29c8af72508399206a3c4e3c18661462716 days 16 hrs ago0x0990a01c880d016e19dcd49ec549f266f8b41bf90xaeb3d7d5a6b52619b36d3bd0b6794e75e65a92bd192.126905415 Ether
0x39c8fd560f417b548a8d81b893ae5690f11cbbb5c3664b5cf964d0af8056b887638257354 days 13 hrs ago0x87cf2332f4e4cd44cbf33be0979c0cb1be2e592f  Contract Creation0 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: TokenSale
Compiler Text: v0.4.24+commit.e67f0147
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.24;

contract Crowdsale {
  using SafeMath for uint256;

  // The token being sold
  ERC20Interface public token;

  // Address where funds are collected
  address public wallet;

  // How many token units a buyer gets per wei
  uint256 public rate;

  // Amount of wei raised
  uint256 public weiRaised;

  /**
   * Event for token purchase logging
   * @param purchaser who paid for the tokens
   * @param beneficiary who got the tokens
   * @param value weis paid for purchase
   * @param amount amount of tokens purchased
   */
  event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);

  /**
   * @param _rate Number of token units a buyer gets per wei
   * @param _wallet Address where collected funds will be forwarded to
   * @param _token Address of the token being sold
   */
  constructor(uint256 _rate, address _wallet, ERC20Interface _token) public {
    require(_rate > 0);
    require(_wallet != address(0));
    require(_token != address(0));

    rate = _rate;
    wallet = _wallet;
    token = _token;
  }

  // -----------------------------------------
  // Crowdsale external interface
  // -----------------------------------------

  /**
   * @dev fallback function ***DO NOT OVERRIDE***
   */
  function () external payable {
    buyTokens(msg.sender);
  }

  /**
   * @dev low level token purchase ***DO NOT OVERRIDE***
   * @param _beneficiary Address performing the token purchase
   */
  function buyTokens(address _beneficiary) public payable {

    uint256 weiAmount = msg.value;
    _preValidatePurchase(_beneficiary, weiAmount);

    // calculate token amount to be created
    uint256 tokens = _getTokenAmount(weiAmount);

    // update state
    weiRaised = weiRaised.add(weiAmount);

    _processPurchase(_beneficiary, tokens);
    emit TokenPurchase(msg.sender, _beneficiary, weiAmount, tokens);

    _updatePurchasingState(_beneficiary, weiAmount);

    _forwardFunds();
    _postValidatePurchase(_beneficiary, weiAmount);
  }

  // -----------------------------------------
  // Internal interface (extensible)
  // -----------------------------------------

  /**
   * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
   * @param _beneficiary Address performing the token purchase
   * @param _weiAmount Value in wei involved in the purchase
   */
  function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
    require(_beneficiary != address(0));
    require(_weiAmount != 0);
  }

  /**
   * @dev Validation of an executed purchase. Observe state and use revert statements to undo rollback when valid conditions are not met.
   * @param _beneficiary Address performing the token purchase
   * @param _weiAmount Value in wei involved in the purchase
   */
  function _postValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
    // optional override
  }

  /**
   * @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
   * @param _beneficiary Address performing the token purchase
   * @param _tokenAmount Number of tokens to be emitted
   */
  function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
    token.transfer(_beneficiary, _tokenAmount);
  }

  /**
   * @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
   * @param _beneficiary Address receiving the tokens
   * @param _tokenAmount Number of tokens to be purchased
   */
  function _processPurchase(address _beneficiary, uint256 _tokenAmount) internal {
    _deliverTokens(_beneficiary, _tokenAmount);
  }

  /**
   * @dev Override for extensions that require an internal state to check for validity (current user contributions, etc.)
   * @param _beneficiary Address receiving the tokens
   * @param _weiAmount Value in wei involved in the purchase
   */
  function _updatePurchasingState(address _beneficiary, uint256 _weiAmount) internal {
    // optional override
  }

  /**
   * @dev Override to extend the way in which ether is converted to tokens.
   * @param _weiAmount Value in wei to be converted into tokens
   * @return Number of tokens that can be purchased with the specified _weiAmount
   */
  function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
    return _weiAmount.mul(rate);
  }

  /**
   * @dev Determines how ETH is stored/forwarded on purchases.
   */
  function _forwardFunds() internal {
    wallet.transfer(msg.value);
  }
}

contract ERC20Interface {
  function totalSupply() external view returns (uint256);
  function balanceOf(address who) external view returns (uint256);
  function transfer(address to, uint256 value) external returns (bool);
  function allowance(address owner, address spender) external view returns (uint256);
  function transferFrom(address from, address to, uint256 value) external returns (bool);
  function approve(address spender, uint256 value) external returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}

contract ERC20Standard is ERC20Interface {
  using SafeMath for uint256;

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

  uint256 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) external returns (bool) {
    require(_to != address(0));
    require(_value <= balances[msg.sender]);

    // SafeMath.sub will throw if there is not enough balance.
    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    emit Transfer(msg.sender, _to, _value);
    return true;
  }

  /**
   * @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) external 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
   * 
   * To avoid this issue, allowances are only allowed to be changed between zero and non-zero.
   *
   * @param _spender The address which will spend the funds.
   * @param _value The amount of tokens to be spent.
   */
  function approve(address _spender, uint256 _value) external returns (bool) {
    require(allowed[msg.sender][_spender] == 0 || _value == 0);
    allowed[msg.sender][_spender] = _value;
    emit Approval(msg.sender, _spender, _value);
    return true;
  }

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

  /**
  * @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) external view returns (uint256 balance) {
    return balances[_owner];
  }

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

}

contract ERC223Interface {
    function totalSupply() external view returns (uint256);
    function balanceOf(address who) external view returns (uint256);
    function transfer(address to, uint256 value) external returns (bool);
    function transfer(address to, uint256 value, bytes data) external returns (bool);
    event Transfer(address indexed from, address indexed to, uint256 value);
}

contract ERC223ReceivingContract { 
/**
 * @dev Standard ERC223 function that will handle incoming token transfers.
 *
 * @param _from  Token sender address.
 * @param _value Amount of tokens.
 * @param _data  Transaction metadata.
 */
    function tokenFallback(address _from, uint _value, bytes _data) public;
}

contract ERC223Standard is ERC223Interface, ERC20Standard {
    using SafeMath for uint256;

    /**
     * @dev Transfer the specified amount of tokens to the specified address.
     *      Invokes the `tokenFallback` function if the recipient is a contract.
     *      The token transfer fails if the recipient is a contract
     *      but does not implement the `tokenFallback` function
     *      or the fallback function to receive funds.
     *
     * @param _to    Receiver address.
     * @param _value Amount of tokens that will be transferred.
     * @param _data  Transaction metadata.
     */
    function transfer(address _to, uint256 _value, bytes _data) external returns(bool){
        // Standard function transfer similar to ERC20 transfer with no _data .
        // Added due to backwards compatibility reasons .
        uint256 codeLength;

        assembly {
            // Retrieve the size of the code on target address, this needs assembly .
            codeLength := extcodesize(_to)
        }

        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        if(codeLength>0) {
            ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
            receiver.tokenFallback(msg.sender, _value, _data);
        }
        emit Transfer(msg.sender, _to, _value);
    }
    
    /**
     * @dev Transfer the specified amount of tokens to the specified address.
     *      This function works the same with the previous one
     *      but doesn't contain `_data` param.
     *      Added due to backwards compatibility reasons.
     *
     * @param _to    Receiver address.
     * @param _value Amount of tokens that will be transferred.
     */
    function transfer(address _to, uint256 _value) external returns(bool){
        uint256 codeLength;
        bytes memory empty;

        assembly {
            // Retrieve the size of the code on target address, this needs assembly .
            codeLength := extcodesize(_to)
        }

        balances[msg.sender] = balances[msg.sender].sub(_value);
        balances[_to] = balances[_to].add(_value);
        if(codeLength>0) {
            ERC223ReceivingContract receiver = ERC223ReceivingContract(_to);
            receiver.tokenFallback(msg.sender, _value, empty);
        }
        emit Transfer(msg.sender, _to, _value);
        return true;
    }
 
}

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) public onlyOwner {
    require(newOwner != address(0));
    emit OwnershipTransferred(owner, newOwner);
    owner = newOwner;
  }

}

contract MintableToken is ERC223Standard, Ownable {
  event Mint(address indexed to, uint256 amount);
  event MintFinished();

  bool public mintingFinished = false;

  modifier canMint() {
    require(!mintingFinished);
    _;
  }

  /**
   * @dev Function to mint tokens
   * @param _to The address that will receive the minted tokens.
   * @param _amount The amount of tokens to mint.
   * @return A boolean that indicates if the operation was successful.
   */
  function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
    totalSupply_ = totalSupply_.add(_amount);
    balances[_to] = balances[_to].add(_amount);
    emit Mint(_to, _amount);
    emit Transfer(address(0), _to, _amount);
    return true;
  }

  /**
   * @dev Function to stop minting new tokens.
   * @return True if the operation was successful.
   */
  function finishMinting() onlyOwner canMint public returns (bool) {
    mintingFinished = true;
    emit MintFinished();
    return true;
  }
}

contract PoolAndSaleInterface {
    address public tokenSaleAddr;
    address public votingAddr;
    address public votingTokenAddr;
    uint256 public tap;
    uint256 public initialTap;
    uint256 public initialRelease;

    function setTokenSaleContract(address _tokenSaleAddr) external;
    function startProject() external;
}

library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 a, uint256 b) internal pure returns (uint256) {
    if (a == 0) {
      return 0;
    }
    uint256 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) {
    uint256 c = a + b;
    assert(c >= a);
    return c;
  }
}

contract TimeLockPool{
    using SafeMath for uint256;

    struct LockedBalance {
      uint256 balance;
      uint256 releaseTime;
    }

    /*
      structure: lockedBalnces[owner][token] = LockedBalance(balance, releaseTime);
      token address = '0x0' stands for ETH (unit = wei)
    */
    mapping (address => mapping (address => LockedBalance[])) public lockedBalances;

    event Deposit(
        address indexed owner,
        address indexed tokenAddr,
        uint256 amount,
        uint256 releaseTime
    );

    event Withdraw(
        address indexed owner,
        address indexed tokenAddr,
        uint256 amount
    );

    /// @dev Constructor. 
    /// @return 
    constructor() public {}

    /// @dev Deposit tokens to specific account with time-lock.
    /// @param tokenAddr The contract address of a ERC20/ERC223 token.
    /// @param account The owner of deposited tokens.
    /// @param amount Amount to deposit.
    /// @param releaseTime Time-lock period.
    /// @return True if it is successful, revert otherwise.
    function depositERC20 (
        address tokenAddr,
        address account,
        uint256 amount,
        uint256 releaseTime
    ) external returns (bool) {
        require(account != address(0x0));
        require(tokenAddr != 0x0);
        require(msg.value == 0);
        require(amount > 0);
        require(ERC20Interface(tokenAddr).transferFrom(msg.sender, this, amount));

        lockedBalances[account][tokenAddr].push(LockedBalance(amount, releaseTime));
        emit Deposit(account, tokenAddr, amount, releaseTime);

        return true;
    }

    /// @dev Deposit ETH to specific account with time-lock.
    /// @param account The owner of deposited tokens.
    /// @param releaseTime Timestamp to release the fund.
    /// @return True if it is successful, revert otherwise.
    function depositETH (
        address account,
        uint256 releaseTime
    ) external payable returns (bool) {
        require(account != address(0x0));
        address tokenAddr = address(0x0);
        uint256 amount = msg.value;
        require(amount > 0);

        lockedBalances[account][tokenAddr].push(LockedBalance(amount, releaseTime));
        emit Deposit(account, tokenAddr, amount, releaseTime);

        return true;
    }

    /// @dev Release the available balance of an account.
    /// @param account An account to receive tokens.
    /// @param tokenAddr An address of ERC20/ERC223 token.
    /// @param index_from Starting index of records to withdraw.
    /// @param index_to Ending index of records to withdraw.
    /// @return True if it is successful, revert otherwise.
    function withdraw (address account, address tokenAddr, uint256 index_from, uint256 index_to) external returns (bool) {
        require(account != address(0x0));

        uint256 release_amount = 0;
        for (uint256 i = index_from; i < lockedBalances[account][tokenAddr].length && i < index_to + 1; i++) {
            if (lockedBalances[account][tokenAddr][i].balance > 0 &&
                lockedBalances[account][tokenAddr][i].releaseTime <= block.timestamp) {

                release_amount = release_amount.add(lockedBalances[account][tokenAddr][i].balance);
                lockedBalances[account][tokenAddr][i].balance = 0;
            }
        }

        require(release_amount > 0);

        if (tokenAddr == 0x0) {
            if (!account.send(release_amount)) {
                revert();
            }
            emit Withdraw(account, tokenAddr, release_amount);
            return true;
        } else {
            if (!ERC20Interface(tokenAddr).transfer(account, release_amount)) {
                revert();
            }
            emit Withdraw(account, tokenAddr, release_amount);
            return true;
        }
    }

    /// @dev Returns total amount of balances which already passed release time.
    /// @param account An account to receive tokens.
    /// @param tokenAddr An address of ERC20/ERC223 token.
    /// @return Available balance of specified token.
    function getAvailableBalanceOf (address account, address tokenAddr) 
        external
        view
        returns (uint256)
    {
        require(account != address(0x0));

        uint256 balance = 0;
        for(uint256 i = 0; i < lockedBalances[account][tokenAddr].length; i++) {
            if (lockedBalances[account][tokenAddr][i].releaseTime <= block.timestamp) {
                balance = balance.add(lockedBalances[account][tokenAddr][i].balance);
            }
        }
        return balance;
    }

    /// @dev Returns total amount of balances which are still locked.
    /// @param account An account to receive tokens.
    /// @param tokenAddr An address of ERC20/ERC223 token.
    /// @return Locked balance of specified token.
    function getLockedBalanceOf (address account, address tokenAddr)
        external
        view
        returns (uint256) 
    {
        require(account != address(0x0));

        uint256 balance = 0;
        for(uint256 i = 0; i < lockedBalances[account][tokenAddr].length; i++) {
            if(lockedBalances[account][tokenAddr][i].releaseTime > block.timestamp) {
                balance = balance.add(lockedBalances[account][tokenAddr][i].balance);
            }
        }
        return balance;
    }

    /// @dev Returns next release time of locked balances.
    /// @param account An account to receive tokens.
    /// @param tokenAddr An address of ERC20/ERC223 token.
    /// @return Timestamp of next release.
    function getNextReleaseTimeOf (address account, address tokenAddr)
        external
        view
        returns (uint256) 
    {
        require(account != address(0x0));

        uint256 nextRelease = 2**256 - 1;
        for (uint256 i = 0; i < lockedBalances[account][tokenAddr].length; i++) {
            if (lockedBalances[account][tokenAddr][i].releaseTime > block.timestamp &&
               lockedBalances[account][tokenAddr][i].releaseTime < nextRelease) {

                nextRelease = lockedBalances[account][tokenAddr][i].releaseTime;
            }
        }

        /* returns 0 if there are no more locked balances. */
        if (nextRelease == 2**256 - 1) {
            nextRelease = 0;
        }
        return nextRelease;
    }
}

contract TimedCrowdsale is Crowdsale {
  using SafeMath for uint256;

  uint256 public openingTime;
  uint256 public closingTime;

  /**
   * @dev Reverts if not in crowdsale time range.
   */
  modifier onlyWhileOpen {
    require(block.timestamp >= openingTime && block.timestamp <= closingTime);
    _;
  }

  /**
   * @dev Constructor, takes crowdsale opening and closing times.
   * @param _openingTime Crowdsale opening time
   * @param _closingTime Crowdsale closing time
   */
  constructor(uint256 _openingTime, uint256 _closingTime) public {
    require(_openingTime >= block.timestamp);
    require(_closingTime >= _openingTime);

    openingTime = _openingTime;
    closingTime = _closingTime;
  }

  /**
   * @dev Checks whether the period in which the crowdsale is open has already elapsed.
   * @return Whether crowdsale period has elapsed
   */
  function hasClosed() public view returns (bool) {
    return block.timestamp > closingTime;
  }

  /**
   * @dev Extend parent behavior requiring to be within contributing period
   * @param _beneficiary Token purchaser
   * @param _weiAmount Amount of wei contributed
   */
  function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal onlyWhileOpen {
    super._preValidatePurchase(_beneficiary, _weiAmount);
  }

}

contract FinalizableCrowdsale is TimedCrowdsale, Ownable {
  using SafeMath for uint256;

  bool public isFinalized = false;

  event Finalized();

  /**
   * @dev Must be called after crowdsale ends, to do some extra finalization
   * work. Calls the contract's finalization function.
   */
  function finalize() onlyOwner public {
    require(!isFinalized);
    require(hasClosed());

    finalization();
    emit Finalized();

    isFinalized = true;
  }

  /**
   * @dev Can be overridden to add finalization logic. The overriding function
   * should call super.finalization() to ensure the chain of finalization is
   * executed entirely.
   */
  function finalization() internal {
  }

}

contract TokenController is Ownable {
    using SafeMath for uint256;

    MintableToken public targetToken;
    address public votingAddr;
    address public tokensaleManagerAddr;

    State public state;

    enum State {
        Init,
        Tokensale,
        Public
    }

    /// @dev The deployer must change the ownership of the target token to this contract.
    /// @param _targetToken : The target token this contract manage the rights to mint.
    /// @return 
    constructor (
        MintableToken _targetToken
    ) public {
        targetToken = MintableToken(_targetToken);
        state = State.Init;
    }

    /// @dev Mint and distribute specified amount of tokens to an address.
    /// @param to An address that receive the minted tokens.
    /// @param amount Amount to mint.
    /// @return True if the distribution is successful, revert otherwise.
    function mint (address to, uint256 amount) external returns (bool) {
        /*
          being called from voting contract will be available in the future
          ex. if (state == State.Public && msg.sender == votingAddr) 
        */

        if ((state == State.Init && msg.sender == owner) ||
            (state == State.Tokensale && msg.sender == tokensaleManagerAddr)) {
            return targetToken.mint(to, amount);
        }

        revert();
    }

    /// @dev Change the phase from "Init" to "Tokensale".
    /// @param _tokensaleManagerAddr A contract address of token-sale.
    /// @return True if the change of the phase is successful, revert otherwise.
    function openTokensale (address _tokensaleManagerAddr)
        external
        onlyOwner
        returns (bool)
    {
        /* check if the owner of the target token is set to this contract */
        require(MintableToken(targetToken).owner() == address(this));
        require(state == State.Init);
        require(_tokensaleManagerAddr != address(0x0));

        tokensaleManagerAddr = _tokensaleManagerAddr;
        state = State.Tokensale;
        return true;
    }

    /// @dev Change the phase from "Tokensale" to "Public". This function will be
    ///      cahnged in the future to receive an address of voting contract as an
    ///      argument in order to handle the result of minting proposal.
    /// @return True if the change of the phase is successful, revert otherwise.
    function closeTokensale () external returns (bool) {
        require(state == State.Tokensale && msg.sender == tokensaleManagerAddr);

        state = State.Public;
        return true;
    }

    /// @dev Check if the state is "Init" or not.
    /// @return True if the state is "Init", false otherwise.
    function isStateInit () external view returns (bool) {
        return (state == State.Init);
    }

    /// @dev Check if the state is "Tokensale" or not.
    /// @return True if the state is "Tokensale", false otherwise.
    function isStateTokensale () external view returns (bool) {
        return (state == State.Tokensale);
    }

    /// @dev Check if the state is "Public" or not.
    /// @return True if the state is "Public", false otherwise.
    function isStatePublic () external view returns (bool) {
        return (state == State.Public);
    }
}

contract TokenSaleManager is Ownable {
    using SafeMath for uint256;

    ERC20Interface public token;
    address public poolAddr;
    address public tokenControllerAddr;
    address public timeLockPoolAddr;
    address[] public tokenSales;
    mapping( address => bool ) public tokenSaleIndex;
    bool public isStarted = false;
    bool public isFinalized = false;

    modifier onlyDaicoPool {
        require(msg.sender == poolAddr);
        _;
    }

    modifier onlyTokenSale {
        require(tokenSaleIndex[msg.sender]);
        _;
    }

    /// @dev Constructor. It set the DaicoPool to receive the starting signal from this contract.
    /// @param _tokenControllerAddr The contract address of TokenController.
    /// @param _timeLockPoolAddr The contract address of a TimeLockPool.
    /// @param _daicoPoolAddr The contract address of DaicoPool.
    /// @param _token The contract address of a ERC20 token.
    constructor (
        address _tokenControllerAddr,
        address _timeLockPoolAddr,
        address _daicoPoolAddr,
        ERC20Interface _token
    ) public {
        require(_tokenControllerAddr != address(0x0));
        tokenControllerAddr = _tokenControllerAddr;

        require(_timeLockPoolAddr != address(0x0));
        timeLockPoolAddr = _timeLockPoolAddr;

        token = _token;

        poolAddr = _daicoPoolAddr;
        require(PoolAndSaleInterface(poolAddr).votingTokenAddr() == address(token));
        PoolAndSaleInterface(poolAddr).setTokenSaleContract(this);

    }

    /// @dev This contract doen't receive any ETH.
    function() external payable {
        revert();
    }

    /// @dev Add a new token sale with specific parameters. New sale should start
    /// @dev after the previous one closed.
    /// @param openingTime A timestamp of the date this sale will start.
    /// @param closingTime A timestamp of the date this sale will end.
    /// @param tokensCap Number of tokens to be sold. Can be 0 if it accepts carryover.
    /// @param rate Number of tokens issued with 1 ETH. [minimal unit of the token / ETH]  
    /// @param carryover If true, unsold tokens will be carryovered to next sale. 
    /// @param timeLockRate Specified rate of issued tokens will be locked. ex. 50 = 50%
    /// @param timeLockEnd A timestamp of the date locked tokens will be released.
    /// @param minAcceptableWei Minimum contribution.
    function addTokenSale (
        uint256 openingTime,
        uint256 closingTime,
        uint256 tokensCap,
        uint256 rate,
        bool carryover,
        uint256 timeLockRate,
        uint256 timeLockEnd,
        uint256 minAcceptableWei
    ) external onlyOwner {
        require(!isStarted);
        require(
            tokenSales.length == 0 ||
            TimedCrowdsale(tokenSales[tokenSales.length-1]).closingTime() < openingTime
        );

        require(TokenController(tokenControllerAddr).state() == TokenController.State.Init);

        tokenSales.push(new TokenSale(
            rate,
            token,
            poolAddr,
            openingTime,
            closingTime,
            tokensCap,
            timeLockRate,
            timeLockEnd,
            carryover,
            minAcceptableWei
        ));
        tokenSaleIndex[tokenSales[tokenSales.length-1]] = true;

    }

    /// @dev Initialize the tokensales. No other sales can be added after initialization.
    /// @return True if successful, revert otherwise.
    function initialize () external onlyOwner returns (bool) {
        require(!isStarted);
        TokenSale(tokenSales[0]).initialize(0);
        isStarted = true;
    }

    /// @dev Request TokenController to mint new tokens. This function is only called by 
    /// @dev token sales.
    /// @param _beneficiary The address to receive the new tokens.
    /// @param _tokenAmount Token amount to be minted.
    /// @return True if successful, revert otherwise.
    function mint (
        address _beneficiary,
        uint256 _tokenAmount
    ) external onlyTokenSale returns(bool) {
        require(isStarted && !isFinalized);
        require(TokenController(tokenControllerAddr).mint(_beneficiary, _tokenAmount));
        return true;
    }

    /// @dev Mint new tokens with time-lock. This function is only called by token sales.
    /// @param _beneficiary The address to receive the new tokens.
    /// @param _tokenAmount Token amount to be minted.
    /// @param _releaseTime A timestamp of the date locked tokens will be released.
    /// @return True if successful, revert otherwise.
    function mintTimeLocked (
        address _beneficiary,
        uint256 _tokenAmount,
        uint256 _releaseTime
    ) external onlyTokenSale returns(bool) {
        require(isStarted && !isFinalized);
        require(TokenController(tokenControllerAddr).mint(this, _tokenAmount));
        require(ERC20Interface(token).approve(timeLockPoolAddr, _tokenAmount));
        require(TimeLockPool(timeLockPoolAddr).depositERC20(
            token,
            _beneficiary,
            _tokenAmount,
            _releaseTime
        ));
        return true;
    }

    /// @dev Adds single address to whitelist of all token sales.
    /// @param _beneficiary Address to be added to the whitelist
    function addToWhitelist(address _beneficiary) external onlyOwner {
        require(isStarted);
        for (uint256 i = 0; i < tokenSales.length; i++ ) {
            WhitelistedCrowdsale(tokenSales[i]).addToWhitelist(_beneficiary);
        }
    }

    /// @dev Adds multiple addresses to whitelist of all token sales.
    /// @param _beneficiaries Addresses to be added to the whitelist
    function addManyToWhitelist(address[] _beneficiaries) external onlyOwner {
        require(isStarted);
        for (uint256 i = 0; i < tokenSales.length; i++ ) {
            WhitelistedCrowdsale(tokenSales[i]).addManyToWhitelist(_beneficiaries);
        }
    }


    /// @dev Finalize the specific token sale. Can be done if end date has come or 
    /// @dev all tokens has been sold out. It process carryover if it is set.
    /// @param _indexTokenSale index of the target token sale. 
    function finalize (uint256 _indexTokenSale) external {
        require(isStarted && !isFinalized);
        TokenSale ts = TokenSale(tokenSales[_indexTokenSale]);

        if (ts.canFinalize()) {
            ts.finalize();
            uint256 carryoverAmount = 0;
            if (ts.carryover() &&
                ts.tokensCap() > ts.tokensMinted() &&
                _indexTokenSale.add(1) < tokenSales.length) {
                carryoverAmount = ts.tokensCap().sub(ts.tokensMinted());
            } 
            if(_indexTokenSale.add(1) < tokenSales.length) {
                TokenSale(tokenSales[_indexTokenSale.add(1)]).initialize(carryoverAmount);
            }
        }

    }

    /// @dev Finalize the manager. Can be done if all token sales are already finalized.
    /// @dev It makes the DaicoPool open the TAP.
    function finalizeTokenSaleManager () external{
        require(isStarted && !isFinalized);
        for (uint256 i = 0; i < tokenSales.length; i++ ) {
            require(FinalizableCrowdsale(tokenSales[i]).isFinalized());
        }
        require(TokenController(tokenControllerAddr).closeTokensale());
        isFinalized = true;
        PoolAndSaleInterface(poolAddr).startProject();
    }
}

contract WhitelistedCrowdsale is Crowdsale, Ownable {

  mapping(address => bool) public whitelist;

  /**
   * @dev Reverts if beneficiary is not whitelisted. Can be used when extending this contract.
   */
  modifier isWhitelisted(address _beneficiary) {
    require(whitelist[_beneficiary]);
    _;
  }

  /**
   * @dev Adds single address to whitelist.
   * @param _beneficiary Address to be added to the whitelist
   */
  function addToWhitelist(address _beneficiary) external onlyOwner {
    whitelist[_beneficiary] = true;
  }

  /**
   * @dev Adds list of addresses to whitelist. Not overloaded due to limitations with truffle testing.
   * @param _beneficiaries Addresses to be added to the whitelist
   */
  function addManyToWhitelist(address[] _beneficiaries) external onlyOwner {
    for (uint256 i = 0; i < _beneficiaries.length; i++) {
      whitelist[_beneficiaries[i]] = true;
    }
  }

  /**
   * @dev Removes single address from whitelist.
   * @param _beneficiary Address to be removed to the whitelist
   */
  function removeFromWhitelist(address _beneficiary) external onlyOwner {
    whitelist[_beneficiary] = false;
  }

  /**
   * @dev Extend parent behavior requiring beneficiary to be in whitelist.
   * @param _beneficiary Token beneficiary
   * @param _weiAmount Amount of wei contributed
   */
  function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal isWhitelisted(_beneficiary) {
    super._preValidatePurchase(_beneficiary, _weiAmount);
  }

}

contract TokenSale is FinalizableCrowdsale,
                      WhitelistedCrowdsale {
    using SafeMath for uint256;

    address public managerAddr; 
    address public poolAddr;
    bool public isInitialized = false;
    uint256 public timeLockRate;
    uint256 public timeLockEnd;
    uint256 public tokensMinted = 0;
    uint256 public tokensCap;
    uint256 public minAcceptableWei;
    bool public carryover;

    modifier onlyManager{
        require(msg.sender == managerAddr);
        _;
    }

    /// @dev Constructor.
    /// @param _rate Number of tokens issued with 1 ETH. [minimal unit of the token / ETH]
    /// @param _token The contract address of a ERC20 token.
    /// @param _poolAddr The contract address of DaicoPool.
    /// @param _openingTime A timestamp of the date this sale will start.
    /// @param _closingTime A timestamp of the date this sale will end.
    /// @param _tokensCap Number of tokens to be sold. Can be 0 if it accepts carryover.
    /// @param _timeLockRate Specified rate of issued tokens will be locked. ex. 50 = 50%
    /// @param _timeLockEnd A timestamp of the date locked tokens will be released.
    /// @param _carryover If true, unsold tokens will be carryovered to next sale. 
    /// @param _minAcceptableWei Minimum contribution.
    /// @return 
    constructor (
        uint256 _rate, /* The unit of rate is [nano tokens / ETH] in this contract */
        ERC20Interface _token,
        address _poolAddr,
        uint256 _openingTime,
        uint256 _closingTime,
        uint256 _tokensCap,
        uint256 _timeLockRate,
        uint256 _timeLockEnd,
        bool _carryover,
        uint256 _minAcceptableWei
    ) public Crowdsale(_rate, _poolAddr, _token) TimedCrowdsale(_openingTime, _closingTime) {
        require(_timeLockRate >= 0 && _timeLockRate <=100);
        require(_poolAddr != address(0x0));

        managerAddr = msg.sender;
        poolAddr = _poolAddr;
        timeLockRate = _timeLockRate;
        timeLockEnd = _timeLockEnd;
        tokensCap = _tokensCap;
        carryover = _carryover;
        minAcceptableWei = _minAcceptableWei;
    }

    /// @dev Initialize the sale. If carryoverAmount is given, it added the tokens to be sold.
    /// @param carryoverAmount Amount of tokens to be added to capTokens.
    /// @return 
    function initialize(uint256 carryoverAmount) external onlyManager {
        require(!isInitialized);
        isInitialized = true;
        tokensCap = tokensCap.add(carryoverAmount);
    }

    /// @dev Finalize the sale. It transfers all the funds it has. Can be repeated.
    /// @return 
    function finalize() onlyOwner public {
        //require(!isFinalized);
        require(isInitialized);
        require(canFinalize());

        finalization();
        emit Finalized();

        isFinalized = true;
    }

    /// @dev Check if the sale can be finalized.
    /// @return True if closing time has come or tokens are sold out.
    function canFinalize() public view returns(bool) {
        return (hasClosed() || (isInitialized && tokensCap <= tokensMinted));
    }


    /// @dev It transfers all the funds it has.
    /// @return 
    function finalization() internal {
        if(address(this).balance > 0){
            poolAddr.transfer(address(this).balance);
        }
    }

    /**
     * @dev Overrides delivery by minting tokens upon purchase.
     * @param _beneficiary Token purchaser
     * @param _tokenAmount Number of tokens to be minted
     */
    function _deliverTokens(address _beneficiary, uint256 _tokenAmount) internal {
        //require(tokensMinted.add(_tokenAmount) <= tokensCap);
        require(tokensMinted < tokensCap);

        uint256 time_locked = _tokenAmount.mul(timeLockRate).div(100); 
        uint256 instant = _tokenAmount.sub(time_locked);

        if (instant > 0) {
            require(TokenSaleManager(managerAddr).mint(_beneficiary, instant));
        }
        if (time_locked > 0) {
            require(TokenSaleManager(managerAddr).mintTimeLocked(
                _beneficiary,
                time_locked,
                timeLockEnd
            ));
        }
  
        tokensMinted = tokensMinted.add(_tokenAmount);
    }

    /// @dev Overrides _forwardFunds to do nothing. 
    function _forwardFunds() internal {}

    /// @dev Overrides _preValidatePurchase to check minimam contribution and initialization.
    /// @param _beneficiary Token purchaser
    /// @param _weiAmount weiAmount to pay
    function _preValidatePurchase(address _beneficiary, uint256 _weiAmount) internal {
        super._preValidatePurchase(_beneficiary, _weiAmount);
        require(isInitialized);
        require(_weiAmount >= minAcceptableWei);
    }

    /**
     * @dev Overridden in order to change the unit of rate with [nano toekns / ETH]
     * instead of original [minimal unit of the token / wei].
     * @param _weiAmount Value in wei to be converted into tokens
     * @return Number of tokens that can be purchased with the specified _weiAmount
     */
    function _getTokenAmount(uint256 _weiAmount) internal view returns (uint256) {
      return _weiAmount.mul(rate).div(10**18); //The unit of rate is [nano tokens / ETH].
    }

}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"tokensCap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"minAcceptableWei","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"hasClosed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"managerAddr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isInitialized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"carryover","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"timeLockEnd","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"closingTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"finalize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"timeLockRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"poolAddr","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokensMinted","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"canFinalize","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"removeFromWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiaries","type":"address[]"}],"name":"addManyToWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"isFinalized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"whitelist","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"openingTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"addToWhitelist","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"buyTokens","outputs":[],"payable":true,"stateMutability":"payable","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"},{"constant":false,"inputs":[{"name":"carryoverAmount","type":"uint256"}],"name":"initialize","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_rate","type":"uint256"},{"name":"_token","type":"address"},{"name":"_poolAddr","type":"address"},{"name":"_openingTime","type":"uint256"},{"name":"_closingTime","type":"uint256"},{"name":"_tokensCap","type":"uint256"},{"name":"_timeLockRate","type":"uint256"},{"name":"_timeLockEnd","type":"uint256"},{"name":"_carryover","type":"bool"},{"name":"_minAcceptableWei","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[],"name":"Finalized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"TokenPurchase","type":"event"}]

  Contract Creation Code Switch To Opcodes View
60806040526006805460a060020a60ff02199081169091556009805490911690556000600c5534801561003157600080fd5b5060405161014080610d9183398101604090815281516020830151918301516060840151608085015160a086015160c087015160e08801516101008901516101209099015196989596949593949293919290919086868b8a8c6000831161009757600080fd5b600160a060020a03821615156100ac57600080fd5b600160a060020a03811615156100c157600080fd5b60029290925560018054600160a060020a03928316600160a060020a031991821617909155600080549290931691161790554282101561010057600080fd5b8181101561010d57600080fd5b60049190915560055560068054600160a060020a031916331790556000841080159061013a575060648411155b151561014557600080fd5b600160a060020a038816151561015a57600080fd5b6008805433600160a060020a03199182161790915560098054909116600160a060020a039990991698909817909755600a92909255600b55600d91909155600f805460ff19169115159190911790555050600e5550610bd19050806101c06000396000f30060806040526004361061015e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663085ceb308114610169578063136eb583146101905780631515bc2b146101a55780632c4e722e146101ce5780632e3c9e99146101e3578063392e53cd146102145780633d74a03e146102295780633dddd0a51461023e5780634042b66f146102535780634b6753bc146102685780634bb278f31461027d578063521eb273146102925780636041f7a9146102a75780636046cd99146102bc5780636de9f32b146102d157806371e28126146102e65780638ab1d681146102fb5780638c10671c1461031c5780638d4e40831461033c5780638da5cb5b146103515780639b19251a14610366578063b7a8807c14610387578063e43252d71461039c578063ec8ac4d8146103bd578063f2fde38b146103d1578063fc0c546a146103f2578063fe4b84df14610407575b6101673361041f565b005b34801561017557600080fd5b5061017e6104c1565b60408051918252519081900360200190f35b34801561019c57600080fd5b5061017e6104c7565b3480156101b157600080fd5b506101ba6104cd565b604080519115158252519081900360200190f35b3480156101da57600080fd5b5061017e6104d5565b3480156101ef57600080fd5b506101f86104db565b60408051600160a060020a039092168252519081900360200190f35b34801561022057600080fd5b506101ba6104ea565b34801561023557600080fd5b506101ba6104fa565b34801561024a57600080fd5b5061017e610503565b34801561025f57600080fd5b5061017e610509565b34801561027457600080fd5b5061017e61050f565b34801561028957600080fd5b50610167610515565b34801561029e57600080fd5b506101f86105ae565b3480156102b357600080fd5b5061017e6105bd565b3480156102c857600080fd5b506101f86105c3565b3480156102dd57600080fd5b5061017e6105d2565b3480156102f257600080fd5b506101ba6105d8565b34801561030757600080fd5b50610167600160a060020a036004351661060a565b34801561032857600080fd5b506101676004803560248101910135610642565b34801561034857600080fd5b506101ba6106b3565b34801561035d57600080fd5b506101f86106c3565b34801561037257600080fd5b506101ba600160a060020a03600435166106d2565b34801561039357600080fd5b5061017e6106e7565b3480156103a857600080fd5b50610167600160a060020a03600435166106ed565b610167600160a060020a036004351661041f565b3480156103dd57600080fd5b50610167600160a060020a0360043516610728565b3480156103fe57600080fd5b506101f86107bd565b34801561041357600080fd5b506101676004356107cc565b34600061042c8383610837565b6104358261086c565b60035490915061044b908363ffffffff6108a116565b60035561045883826108bb565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36104aa8383610868565b6104b26108c5565b6104bc8383610868565b505050565b600d5481565b600e5481565b600554421190565b60025481565b600854600160a060020a031681565b60095460a060020a900460ff1681565b600f5460ff1681565b600b5481565b60035481565b60055481565b600654600160a060020a0316331461052c57600080fd5b60095460a060020a900460ff16151561054457600080fd5b61054c6105d8565b151561055757600080fd5b61055f6108c7565b6040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a16006805474ff0000000000000000000000000000000000000000191660a060020a179055565b600154600160a060020a031681565b600a5481565b600954600160a060020a031681565b600c5481565b60006105e26104cd565b80610605575060095460a060020a900460ff1680156106055750600c54600d5411155b905090565b600654600160a060020a0316331461062157600080fd5b600160a060020a03166000908152600760205260409020805460ff19169055565b600654600090600160a060020a0316331461065c57600080fd5b5060005b818110156104bc5760016007600085858581811061067a57fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff1916911515919091179055600101610660565b60065460a060020a900460ff1681565b600654600160a060020a031681565b60076020526000908152604090205460ff1681565b60045481565b600654600160a060020a0316331461070457600080fd5b600160a060020a03166000908152600760205260409020805460ff19166001179055565b600654600160a060020a0316331461073f57600080fd5b600160a060020a038116151561075457600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a031681565b600854600160a060020a031633146107e357600080fd5b60095460a060020a900460ff16156107fa57600080fd5b6009805474ff0000000000000000000000000000000000000000191660a060020a179055600d54610831908263ffffffff6108a116565b600d5550565b610841828261090e565b60095460a060020a900460ff16151561085957600080fd5b600e5481101561086857600080fd5b5050565b600061089b670de0b6b3a764000061088f6002548561094190919063ffffffff16565b9063ffffffff61096c16565b92915050565b6000828201838110156108b057fe5b8091505b5092915050565b6108688282610981565b565b6000303111156108c557600954604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561090b573d6000803e3d6000fd5b50565b600160a060020a038216600090815260076020526040902054829060ff16151561093757600080fd5b6104bc8383610b49565b60008083151561095457600091506108b4565b5082820282848281151561096457fe5b04146108b057fe5b6000818381151561097957fe5b049392505050565b600080600d54600c5410151561099657600080fd5b6109b0606461088f600a548661094190919063ffffffff16565b91506109c2838363ffffffff610b7216565b90506000811115610a7357600854604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a03878116600483015260248201859052915191909216916340c10f199160448083019260209291908290030181600087803b158015610a3c57600080fd5b505af1158015610a50573d6000803e3d6000fd5b505050506040513d6020811015610a6657600080fd5b50511515610a7357600080fd5b6000821115610b2d57600854600b54604080517fb762e6e8000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820187905260448201939093529051919092169163b762e6e89160648083019260209291908290030181600087803b158015610af657600080fd5b505af1158015610b0a573d6000803e3d6000fd5b505050506040513d6020811015610b2057600080fd5b50511515610b2d57600080fd5b600c54610b40908463ffffffff6108a116565b600c5550505050565b6004544210158015610b5d57506005544211155b1515610b6857600080fd5b6108688282610b84565b600082821115610b7e57fe5b50900390565b600160a060020a0382161515610b9957600080fd5b80151561086857600080fd00a165627a7a7230582018a568d52216bd356ff6b36052b5f5452f0f0f7240f7a133f1474b895673ecae0029000000000000000000000000000000000000000000000000000000aaaa3462000000000000000000000000008232875761b97a5242a4cffb94828dff5c101950000000000000000000000000aeb3d7d5a6b52619b36d3bd0b6794e75e65a92bd000000000000000000000000000000000000000000000000000000005bbd4100000000000000000000000000000000000000000000000000000000005bd8f044000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000003782dace9d90000

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

-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000aaaa346200
Arg [1] : 0000000000000000000000008232875761b97a5242a4cffb94828dff5c101950
Arg [2] : 000000000000000000000000aeb3d7d5a6b52619b36d3bd0b6794e75e65a92bd
Arg [3] : 000000000000000000000000000000000000000000000000000000005bbd4100
Arg [4] : 000000000000000000000000000000000000000000000000000000005bd8f044
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [8] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [9] : 00000000000000000000000000000000000000000000000003782dace9d90000


   Swarm Source:
bzzr://18a568d52216bd356ff6b36052b5f5452f0f0f7240f7a133f1474b895673ecae

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.