Sponsored:   Ubex.com - Crypto Valley IAB member. Traded on Bitforex, Bitmart, Btc-Alpha, IDEX, Bilaxy, soon on Lbank.
Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 2 txns
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
 Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0xc15e47d094516a66f45d87e532d3eb75ef6d5b2fded6678683a45c394e7417b35456105160 days 3 hrs ago0xfd9815bcf3eda991864552b5c8b26f2be28d038b  Contract Creation0 Ether
[ Download CSV Export  ] 
Warning: The Compiled Contract might be susceptible to ExpExponentCleanup (medium/high-severity), EventStructWrongData (very low-severity), NestedArrayFunctionCallDecoder (medium-severity) SolidityCompiler Bugs.

Contract Source Code Verified (Exact Match)
Contract Name: preICO
Compiler Text: v0.4.20+commit.3155dd80
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

pragma solidity ^0.4.20;

/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
    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;
    }

    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;
    }
}

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
    uint256 public totalSupply;

    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);
}

contract ShortAddressProtection {

    modifier onlyPayloadSize(uint256 numwords) {
        assert(msg.data.length >= numwords * 32 + 4);
        _;
    }
}

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

    mapping(address => uint256) internal balances;

    /**
    * @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) onlyPayloadSize(2) public 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);
        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 balance) {
        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) onlyPayloadSize(3) 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);
        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) onlyPayloadSize(2) public returns (bool) {
        //require user to set to zero before resetting to nonzero
        require((_value == 0) || (allowed[msg.sender][_spender] == 0));

        allowed[msg.sender][_spender] = _value;
        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) onlyPayloadSize(2) public returns (bool) {
        allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
        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) onlyPayloadSize(2) 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);
        }
        Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        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.
     */
    function Ownable() 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));
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

/**
 * @title MintableToken token
 */
contract MintableToken is Ownable, StandardToken {

    event Mint(address indexed to, uint256 amount);
    event MintFinished();

    bool public mintingFinished = false;

    address public saleAgent;

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

    modifier onlySaleAgent() {
        require(msg.sender == saleAgent);
        _;
    }

    function setSaleAgent(address _saleAgent) onlyOwner public {
        require(_saleAgent != address(0));
        saleAgent = _saleAgent;
    }

    /**
     * @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) onlySaleAgent canMint public returns (bool) {
        totalSupply = totalSupply.add(_amount);
        balances[_to] = balances[_to].add(_amount);
        Mint(_to, _amount);
        Transfer(address(0), _to, _amount);
        return true;
    }

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

contract Token is MintableToken {
    string public constant name = "TOKPIE";
    string public constant symbol = "TKP";
    uint8 public constant decimals = 18;
}

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
    event Pause();
    event Unpause();

    bool public paused = false;


    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     */
    modifier whenPaused() {
        require(paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() onlyOwner whenNotPaused public {
        paused = true;
        Pause();
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() onlyOwner whenPaused public {
        paused = false;
        Unpause();
    }
}

/**
 * @title WhitelistedCrowdsale
 * @dev Crowdsale in which only whitelisted users can contribute.
 */
contract WhitelistedCrowdsale is 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;
        }
    }
}

/**
 * @title FinalizableCrowdsale
 * @dev Extension of Crowdsale where an owner can do extra work
 * after finishing.
 */
contract FinalizableCrowdsale is Pausable {
    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);

        finalization();
        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;
}

/**
 * @title RefundVault
 * @dev This contract is used for storing funds while a crowdsale
 * is in progress. Supports refunding the money if crowdsale fails,
 * and forwarding it if crowdsale is successful.
 */
contract RefundVault is Ownable {
    using SafeMath for uint256;

    enum State {Active, Refunding, Closed}

    mapping(address => uint256) public deposited;
    address public wallet;
    State public state;

    event Closed();
    event RefundsEnabled();
    event Refunded(address indexed beneficiary, uint256 weiAmount);

    /**
     * @param _wallet Vault address
     */
    function RefundVault(address _wallet) public {
        require(_wallet != address(0));
        wallet = _wallet;
        state = State.Active;
    }

    /**
     * @param investor Investor address
     */
    function deposit(address investor) onlyOwner public payable {
        require(state == State.Active);
        deposited[investor] = deposited[investor].add(msg.value);
    }

    function close() onlyOwner public {
        require(state == State.Active);
        state = State.Closed;
        Closed();
        wallet.transfer(this.balance);
    }

    function enableRefunds() onlyOwner public {
        require(state == State.Active);
        state = State.Refunding;
        RefundsEnabled();
    }

    /**
     * @param investor Investor address
     */
    function refund(address investor) public {
        require(state == State.Refunding);
        uint256 depositedValue = deposited[investor];
        deposited[investor] = 0;
        investor.transfer(depositedValue);
        Refunded(investor, depositedValue);
    }
}

contract preICO is FinalizableCrowdsale, WhitelistedCrowdsale {
    Token public token;

    // May 01, 2018 @ UTC 0:01
    uint256 public startDate;

    // May 14, 2018 @ UTC 23:59
    uint256 public endDate;

    // amount of raised money in wei
    uint256 public weiRaised;

    // how many token units a buyer gets per wei
    uint256 public constant rate = 1920;

    uint256 public constant softCap = 500 * (1 ether);

    uint256 public constant hardCap = 1000 * (1 ether);

    // refund vault used to hold funds while crowdsale is running
    RefundVault public vault;

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

    /**
     * @dev _wallet where collect funds during crowdsale
     * @dev _startDate should be 1525132860
     * @dev _endDate should be 1526342340
     * @dev _maxEtherPerInvestor should be 10 ether
     */
    function preICO(address _token, address _wallet, uint256 _startDate, uint256 _endDate) public {
        require(_token != address(0) && _wallet != address(0));
        require(_endDate > _startDate);
        startDate = _startDate;
        endDate = _endDate;
        token = Token(_token);
        vault = new RefundVault(_wallet);
    }

    /**
     * @dev Investors can claim refunds here if crowdsale is unsuccessful
     */
    function claimRefund() public {
        require(isFinalized);
        require(!goalReached());

        vault.refund(msg.sender);
    }

    /**
     * @dev Checks whether funding goal was reached.
     * @return Whether funding goal was reached
     */
    function goalReached() public view returns (bool) {
        return weiRaised >= softCap;
    }

    /**
     * @dev vault finalization task, called when owner calls finalize()
     */
    function finalization() internal {
        require(hasEnded());
        if (goalReached()) {
            vault.close();
        } else {
            vault.enableRefunds();
        }
    }

    // fallback function can be used to buy tokens
    function() external payable {
        buyTokens(msg.sender);
    }

    // low level token purchase function
    function buyTokens(address beneficiary) whenNotPaused isWhitelisted(beneficiary) isWhitelisted(msg.sender) public payable {
        require(beneficiary != address(0));
        require(validPurchase());
        require(!hasEnded());

        uint256 weiAmount = msg.value;

        // calculate token amount to be created
        uint256 tokens = weiAmount.mul(rate);

        // Minimum contribution level in TKP tokens for each investor = 100 TKP
        require(tokens >= 100 * (10 ** 18));

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

        token.mint(beneficiary, tokens);
        TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
        forwardFunds();
    }

    // send ether to the fund collection wallet
    function forwardFunds() internal {
        vault.deposit.value(msg.value)(msg.sender);
    }

    // @return true if the transaction can buy tokens
    function validPurchase() internal view returns (bool) {
        return !isFinalized && now >= startDate && msg.value != 0;
    }

    // @return true if crowdsale event has ended
    function hasEnded() public view returns (bool) {
        return (now > endDate || weiRaised >= hardCap);
    }
}

contract ICO is Pausable, WhitelistedCrowdsale {
    using SafeMath for uint256;

    Token public token;

    // June 01, 2018 @ UTC 0:01
    uint256 public startDate;

    // July 05, 2018 on UTC 23:59
    uint256 public endDate;

    uint256 public hardCap;

    // amount of raised money in wei
    uint256 public weiRaised;

    address public wallet;

    mapping(address => uint256) public deposited;

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

    /**
     * @dev _wallet where collect funds during crowdsale
     * @dev _startDate should be 1527811260
     * @dev _endDate should be 1530835140
     * @dev _maxEtherPerInvestor should be 10 ether
     * @dev _hardCap should be 8700 ether
     */
    function ICO(address _token, address _wallet, uint256 _startDate, uint256 _endDate, uint256 _hardCap) public {
        require(_token != address(0) && _wallet != address(0));
        require(_endDate > _startDate);
        require(_hardCap > 0);
        startDate = _startDate;
        endDate = _endDate;
        hardCap = _hardCap;
        token = Token(_token);
        wallet = _wallet;
    }

    function claimFunds() onlyOwner public {
        require(hasEnded());
        wallet.transfer(this.balance);
    }

    function getRate() public view returns (uint256) {
        if (now < startDate || hasEnded()) return 0;

        // Period: from June 01, 2018 @ UTC 0:01 to June 7, 2018 @ UTC 23:59; Price: 1 ETH = 1840 TKP
        if (now >= startDate && now < startDate + 604680) return 1840;
        // Period: from June 08, 2018 @ UTC 0:00 to June 14, 2018 @ UTC 23:59; Price: 1 ETH = 1760 TKP
        if (now >= startDate + 604680 && now < startDate + 1209480) return 1760;
        // Period: from June 15, 2018 @ UTC 0:00 to June 21, 2018 @ UTC 23:59; Price: 1 ETH = 1680 TKP
        if (now >= startDate + 1209480 && now < startDate + 1814280) return 1680;
        // Period: from June 22, 2018 @ UTC 0:00 to June 28, 2018 @ UTC 23:59; Price: 1 ETH = 1648 TKP
        if (now >= startDate + 1814280 && now < startDate + 2419080) return 1648;
        // Period: from June 29, 2018 @ UTC 0:00 to July 5, 2018 @ UTC 23:59; Price: 1 ETH = 1600 TKP
        if (now >= startDate + 2419080) return 1600;
    }

    // fallback function can be used to buy tokens
    function() external payable {
        buyTokens(msg.sender);
    }

    // low level token purchase function
    function buyTokens(address beneficiary) whenNotPaused isWhitelisted(beneficiary) isWhitelisted(msg.sender) public payable {
        require(beneficiary != address(0));
        require(validPurchase());
        require(!hasEnded());

        uint256 weiAmount = msg.value;

        // calculate token amount to be created
        uint256 tokens = weiAmount.mul(getRate());

        // Minimum contribution level in TKP tokens for each investor = 100 TKP
        require(tokens >= 100 * (10 ** 18));

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

        token.mint(beneficiary, tokens);
        TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
    }

    // @return true if the transaction can buy tokens
    function validPurchase() internal view returns (bool) {
        return now >= startDate && msg.value != 0;
    }

    // @return true if crowdsale event has ended
    function hasEnded() public view returns (bool) {
        return (now > endDate || weiRaised >= hardCap);
    }
}

contract postICO is Ownable {
    using SafeMath for uint256;

    Token public token;

    address public walletE;
    address public walletB;
    address public walletC;
    address public walletF;
    address public walletG;

    // 05.07.18 @ UTC 23:59
    uint256 public endICODate;

    bool public finished = false;

    uint256 public FTST;

    // Save complete of transfers (due to schedule) to these wallets 
    mapping(uint8 => bool) completedE;
    mapping(uint8 => bool) completedBC;

    uint256 public paymentSizeE;
    uint256 public paymentSizeB;
    uint256 public paymentSizeC;

    /**
     * @dev _endICODate should be 1530835140
     */
    function postICO(
        address _token,
        address _walletE,
        address _walletB,
        address _walletC,
        address _walletF,
        address _walletG,
        uint256 _endICODate
    ) public {
        require(_token != address(0));
        require(_walletE != address(0));
        require(_walletB != address(0));
        require(_walletC != address(0));
        require(_walletF != address(0));
        require(_walletG != address(0));
        require(_endICODate >= now);

        token = Token(_token);
        endICODate = _endICODate;

        walletE = _walletE;
        walletB = _walletB;
        walletC = _walletC;
        walletF = _walletF;
        walletG = _walletG;
    }

    function finish() onlyOwner public {
        require(now > endICODate);
        require(!finished);
        require(token.saleAgent() == address(this));

        FTST = token.totalSupply().mul(100).div(65);

        // post ICO token allocation: 35% of final total supply of tokens (FTST) will be distributed to the wallets E, B, C, F, G due to the schedule described below. Where FTST = the number of tokens sold during crowdsale x 100 / 65.
        // Growth reserve: 21% (4-years lock). Distribute 2.625% of the final total supply of tokens (FTST*2625/100000) 8 (eight) times every half a year during 4 (four) years after the endICODate to the wallet [E].
        // hold this tokens on postICO contract
        paymentSizeE = FTST.mul(2625).div(100000);
        uint256 tokensE = paymentSizeE.mul(8);
        token.mint(this, tokensE);

        // Team: 9.6% (2-years lock).
        // Distribute 0.25% of final total supply of tokens (FTST*25/10000) 4 (four) times every half a year during 2 (two) years after endICODate to the wallet [B].
        // hold this tokens on postICO contract
        paymentSizeB = FTST.mul(25).div(10000);
        uint256 tokensB = paymentSizeB.mul(4);
        token.mint(this, tokensB);

        // Distribute 2.15% of final total supply of tokens (FTST*215/10000) 4 (four) times every half a year during 2 (two) years after endICODate to the wallet [C]. 
        // hold this tokens on postICO contract
        paymentSizeC = FTST.mul(215).div(10000);
        uint256 tokensC = paymentSizeC.mul(4);
        token.mint(this, tokensC);

        // Angel investors: 2%. Distribute 2% of final total supply of tokens (FTST*2/100) after endICODate to the wallet [F].
        uint256 tokensF = FTST.mul(2).div(100);
        token.mint(walletF, tokensF);

        // Referral program 1,3% + Bounty program: 1,1%. Distribute 2,4% of final total supply of tokens (FTST*24/1000) after endICODate to the wallet [G]. 
        uint256 tokensG = FTST.mul(24).div(1000);
        token.mint(walletG, tokensG);

        token.finishMinting();
        finished = true;
    }

    function claimTokensE(uint8 order) onlyOwner public {
        require(finished);
        require(order >= 1 && order <= 8);
        require(!completedE[order]);

        // On January 03, 2019 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 1) {
            // Thursday, 3 January 2019 г., 23:59:00
            require(now >= endICODate + 15724800);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On July 05, 2019 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 2) {
            // Friday, 5 July 2019 г., 23:59:00
            require(now >= endICODate + 31536000);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On January 03, 2020 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 3) {
            // Friday, 3 January 2020 г., 23:59:00
            require(now >= endICODate + 47260800);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On July 04, 2020 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 4) {
            // Saturday, 4 July 2020 г., 23:59:00
            require(now >= endICODate + 63072000);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On January 02, 2021 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 5) {
            // Saturday, 2 January 2021 г., 23:59:00
            require(now >= endICODate + 78796800);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On July 04, 2021 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 6) {
            // Sunday, 4 July 2021 г., 23:59:00
            require(now >= endICODate + 94608000);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On January 02, 2022 @ UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 7) {
            // Sunday, 2 January 2022 г., 23:59:00
            require(now >= endICODate + 110332800);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
        // On July 04, [email protected] UTC 23:59 = FTST*2625/100000 (2.625% of final total supply of tokens) to the wallet [E].
        if (order == 8) {
            // Monday, 4 July 2022 г., 23:59:00
            require(now >= endICODate + 126144000);
            token.transfer(walletE, paymentSizeE);
            completedE[order] = true;
        }
    }

    function claimTokensBC(uint8 order) onlyOwner public {
        require(finished);
        require(order >= 1 && order <= 4);
        require(!completedBC[order]);

        // On January 03, 2019 @ UTC 23:59 = FTST*25/10000 (0.25% of final total supply of tokens) to the wallet [B] and FTST*215/10000 (2.15% of final total supply of tokens) to the wallet [C].
        if (order == 1) {
            // Thursday, 3 January 2019 г., 23:59:00
            require(now >= endICODate + 15724800);
            token.transfer(walletB, paymentSizeB);
            token.transfer(walletC, paymentSizeC);
            completedBC[order] = true;
        }
        // On July 05, 2019 @ UTC 23:59 = FTST*25/10000 (0.25% of final total supply of tokens) to the wallet [B] and FTST*215/10000 (2.15% of final total supply of tokens) to the wallet [C].
        if (order == 2) {
            // Friday, 5 July 2019 г., 23:59:00
            require(now >= endICODate + 31536000);
            token.transfer(walletB, paymentSizeB);
            token.transfer(walletC, paymentSizeC);
            completedBC[order] = true;
        }
        // On January 03, 2020 @ UTC 23:59 = FTST*25/10000 (0.25% of final total supply of tokens) to the wallet [B] and FTST*215/10000 (2.15% of final total supply of tokens) to the wallet [C].
        if (order == 3) {
            // Friday, 3 January 2020 г., 23:59:00
            require(now >= endICODate + 47260800);
            token.transfer(walletB, paymentSizeB);
            token.transfer(walletC, paymentSizeC);
            completedBC[order] = true;
        }
        // On July 04, 2020 @ UTC 23:59 = FTST*25/10000 (0.25% of final total supply of tokens) to the wallet [B] and FTST*215/10000 (2.15% of final total supply of tokens) to the wallet [C].
        if (order == 4) {
            // Saturday, 4 July 2020 г., 23:59:00
            require(now >= endICODate + 63072000);
            token.transfer(walletB, paymentSizeB);
            token.transfer(walletC, paymentSizeC);
            completedBC[order] = true;
        }
    }
}

contract Controller is Ownable {
    Token public token;
    preICO public pre;
    ICO public ico;
    postICO public post;

    enum State {NONE, PRE_ICO, ICO, POST}

    State public state;

    function Controller(address _token, address _preICO, address _ico, address _postICO) public {
        require(_token != address(0x0));
        token = Token(_token);
        pre = preICO(_preICO);
        ico = ICO(_ico);
        post = postICO(_postICO);

        require(post.endICODate() == ico.endDate());

        require(pre.weiRaised() == 0);
        require(ico.weiRaised() == 0);

        require(token.totalSupply() == 0);
        state = State.NONE;
    }

    function startPreICO() onlyOwner public {
        require(state == State.NONE);
        require(token.owner() == address(this));
        token.setSaleAgent(pre);
        state = State.PRE_ICO;
    }

    function startICO() onlyOwner public {
        require(now > pre.endDate());
        require(state == State.PRE_ICO);
        require(token.owner() == address(this));
        token.setSaleAgent(ico);
        state = State.ICO;
    }

    function startPostICO() onlyOwner public {
        require(now > ico.endDate());
        require(state == State.ICO);
        require(token.owner() == address(this));
        token.setSaleAgent(post);
        state = State.POST;
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"startDate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"rate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unpause","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"weiRaised","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":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"goalReached","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"pause","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":"softCap","outputs":[{"name":"","type":"uint256"}],"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":false,"inputs":[],"name":"claimRefund","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"endDate","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":true,"inputs":[],"name":"hasEnded","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":true,"inputs":[],"name":"hardCap","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"vault","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_token","type":"address"},{"name":"_wallet","type":"address"},{"name":"_startDate","type":"uint256"},{"name":"_endDate","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"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"},{"anonymous":false,"inputs":[],"name":"Finalized","type":"event"},{"anonymous":false,"inputs":[],"name":"Pause","type":"event"},{"anonymous":false,"inputs":[],"name":"Unpause","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
60606040526000805460a060020a61ffff0219169055341561002057600080fd5b6040516080806112268339810160405280805191906020018051919060200180519190602001805160008054600160a060020a03191633600160a060020a0390811691909117909155909250851615801591506100855750600160a060020a03831615155b151561009057600080fd5b81811161009c57600080fd5b6003829055600481905560028054600160a060020a031916600160a060020a038616179055826100ca61011a565b600160a060020a039091168152602001604051809103906000f08015156100f057600080fd5b60068054600160a060020a031916600160a060020a03929092169190911790555061012a92505050565b60405161060c80610c1a83390190565b610ae1806101396000396000f30060606040526004361061010e5763ffffffff60e060020a6000350416630b97bc8681146101195780632c4e722e1461013e5780633f4ba83a146101515780634042b66f146101645780634bb278f3146101775780635c975abb1461018a5780637d3d6522146101b15780638456cb59146101c45780638c10671c146101d75780638d4e4083146101f55780638da5cb5b14610208578063906a26e0146102375780639b19251a1461024a578063b5545a3c14610269578063c24a0f8b1461027c578063e43252d71461028f578063ec8ac4d8146102ae578063ecb70fb7146102c2578063f2fde38b146102d5578063fb86a404146102f4578063fbfa77cf14610307578063fc0c546a1461031a575b6101173361032d565b005b341561012457600080fd5b61012c6104ed565b60405190815260200160405180910390f35b341561014957600080fd5b61012c6104f3565b341561015c57600080fd5b6101176104f9565b341561016f57600080fd5b61012c610578565b341561018257600080fd5b61011761057e565b341561019557600080fd5b61019d61060b565b604051901515815260200160405180910390f35b34156101bc57600080fd5b61019d61061b565b34156101cf57600080fd5b61011761062e565b34156101e257600080fd5b61011760048035602481019101356106b2565b341561020057600080fd5b61019d610729565b341561021357600080fd5b61021b610739565b604051600160a060020a03909116815260200160405180910390f35b341561024257600080fd5b61012c610748565b341561025557600080fd5b61019d600160a060020a0360043516610755565b341561027457600080fd5b61011761076a565b341561028757600080fd5b61012c6107f5565b341561029a57600080fd5b610117600160a060020a03600435166107fb565b610117600160a060020a036004351661032d565b34156102cd57600080fd5b61019d61083d565b34156102e057600080fd5b610117600160a060020a036004351661085f565b34156102ff57600080fd5b61012c6108fa565b341561031257600080fd5b61021b610907565b341561032557600080fd5b61021b610916565b60008054819060a060020a900460ff161561034757600080fd5b600160a060020a038316600090815260016020526040902054839060ff16151561037057600080fd5b33600160a060020a03811660009081526001602052604090205460ff16151561039857600080fd5b600160a060020a03851615156103ad57600080fd5b6103b5610925565b15156103c057600080fd5b6103c861083d565b156103d257600080fd5b3493506103e78461078063ffffffff61095016565b925068056bc75e2d631000008310156103ff57600080fd5b600554610412908563ffffffff61098616565b600555600254600160a060020a03166340c10f19868560006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561047457600080fd5b6102c65a03f1151561048557600080fd5b505050604051805190505084600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18868660405191825260208201526040908101905180910390a36104e6610995565b5050505050565b60035481565b61078081565b60005433600160a060020a0390811691161461051457600080fd5b60005460a060020a900460ff16151561052c57600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60055481565b60005433600160a060020a0390811691161461059957600080fd5b60005460a860020a900460ff16156105b057600080fd5b6105b86109fc565b7f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a16000805475ff000000000000000000000000000000000000000000191660a860020a179055565b60005460a060020a900460ff1681565b600554681b1ae4d6e2ef50000090101590565b60005433600160a060020a0390811691161461064957600080fd5b60005460a060020a900460ff161561066057600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000805433600160a060020a039081169116146106ce57600080fd5b5060005b818110156107245760018060008585858181106106eb57fe5b60209081029290920135600160a060020a0316835250810191909152604001600020805460ff19169115159190911790556001016106d2565b505050565b60005460a860020a900460ff1681565b600054600160a060020a031681565b681b1ae4d6e2ef50000081565b60016020526000908152604090205460ff1681565b60005460a860020a900460ff16151561078257600080fd5b61078a61061b565b1561079457600080fd5b600654600160a060020a031663fa89401a3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156107e457600080fd5b6102c65a03f1151561072457600080fd5b60045481565b60005433600160a060020a0390811691161461081657600080fd5b600160a060020a03166000908152600160208190526040909120805460ff19169091179055565b600060045442118061085a5750683635c9adc5dea0000060055410155b905090565b60005433600160a060020a0390811691161461087a57600080fd5b600160a060020a038116151561088f57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b683635c9adc5dea0000081565b600654600160a060020a031681565b600254600160a060020a031681565b6000805460a860020a900460ff1615801561094257506003544210155b801561085a57505034151590565b600080831515610963576000915061097f565b5082820282848281151561097357fe5b041461097b57fe5b8091505b5092915050565b60008282018381101561097b57fe5b600654600160a060020a031663f340fa01343360405160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016000604051808303818588803b15156109e557600080fd5b6125ee5a03f115156109f657600080fd5b50505050565b610a0461083d565b1515610a0f57600080fd5b610a1761061b565b15610a7457600654600160a060020a03166343d726d66040518163ffffffff1660e060020a028152600401600060405180830381600087803b1515610a5b57600080fd5b6102c65a03f11515610a6c57600080fd5b505050610ab3565b600654600160a060020a0316638c52dc416040518163ffffffff1660e060020a028152600401600060405180830381600087803b15156107e457600080fd5b5600a165627a7a723058207f57ea24de90e148e7983c4c2bb71f8cc9865a40fe609e257a9b94af3a9677c300296060604052341561000f57600080fd5b60405160208061060c8339810160405280805160008054600160a060020a03191633600160a060020a039081169190911790915590925082161515905061005557600080fd5b60028054600160a060020a031916600160a060020a03929092169190911760a060020a60ff021916905561057e8061008e6000396000f3006060604052600436106100985763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166343d726d6811461009d578063521eb273146100b25780638c52dc41146100e15780638da5cb5b146100f4578063c19d93fb14610107578063cb13cddb1461013e578063f2fde38b1461016f578063f340fa011461018e578063fa89401a146101a2575b600080fd5b34156100a857600080fd5b6100b06101c1565b005b34156100bd57600080fd5b6100c561029c565b604051600160a060020a03909116815260200160405180910390f35b34156100ec57600080fd5b6100b06102ab565b34156100ff57600080fd5b6100c561033c565b341561011257600080fd5b61011a61034b565b6040518082600281111561012a57fe5b60ff16815260200191505060405180910390f35b341561014957600080fd5b61015d600160a060020a036004351661035b565b60405190815260200160405180910390f35b341561017a57600080fd5b6100b0600160a060020a036004351661036d565b6100b0600160a060020a0360043516610408565b34156101ad57600080fd5b6100b0600160a060020a036004351661048c565b60005433600160a060020a039081169116146101dc57600080fd5b60006002805460a060020a900460ff16908111156101f657fe5b1461020057600080fd5b6002805474ff00000000000000000000000000000000000000001916740200000000000000000000000000000000000000001790557f1cdde67b72a90f19919ac732a437ac2f7a10fc128d28c2a6e525d89ce5cd9d3a60405160405180910390a1600254600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561029a57600080fd5b565b600254600160a060020a031681565b60005433600160a060020a039081169116146102c657600080fd5b60006002805460a060020a900460ff16908111156102e057fe5b146102ea57600080fd5b6002805474ff0000000000000000000000000000000000000000191660a060020a1790557f599d8e5a83cffb867d051598c4d70e805d59802d8081c1c7d6dffc5b6aca2b8960405160405180910390a1565b600054600160a060020a031681565b60025460a060020a900460ff1681565b60016020526000908152604090205481565b60005433600160a060020a0390811691161461038857600080fd5b600160a060020a038116151561039d57600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a0390811691161461042357600080fd5b60006002805460a060020a900460ff169081111561043d57fe5b1461044757600080fd5b600160a060020a038116600090815260016020526040902054610470903463ffffffff61053c16565b600160a060020a03909116600090815260016020526040902055565b600060016002805460a060020a900460ff16908111156104a857fe5b146104b257600080fd5b50600160a060020a038116600081815260016020526040808220805492905590919082156108fc0290839051600060405180830381858888f1935050505015156104fb57600080fd5b81600160a060020a03167fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d06518260405190815260200160405180910390a25050565b60008282018381101561054b57fe5b93925050505600a165627a7a723058209a79b34c1b753f72ad4d704bdecf1895dbb5352a959ad9ca2f496f7c2cab0b9a002900000000000000000000000085da32246e44be963f67361a6e317684ffb9b91f000000000000000000000000041481693613a1eb83331ac6b6a79c1a1246fb34000000000000000000000000000000000000000000000000000000005ae7ae3c000000000000000000000000000000000000000000000000000000005afa22c4

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

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000085da32246e44be963f67361a6e317684ffb9b91f
Arg [1] : 000000000000000000000000041481693613a1eb83331ac6b6a79c1a1246fb34
Arg [2] : 000000000000000000000000000000000000000000000000000000005ae7ae3c
Arg [3] : 000000000000000000000000000000000000000000000000000000005afa22c4


   Swarm Source:
bzzr://9a79b34c1b753f72ad4d704bdecf1895dbb5352a959ad9ca2f496f7c2cab0b9a

 

View All
Block Age transaction Difficulty 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.