Sponsored Link:   Buy your 1st Ethereum in 5 minutes. Trusted by more than 100k buyers.
Contract Overview | MyWishToken
ETH Balance: 0 Ether
ETH USD Value: $0
No Of Transactions: 1662 txns
Token Tracker 0x1b22c32cd936cb97c28c5690a0695a82abf688e6
  Latest 25 txns from a total Of 1662 transactions View All

TxHash Age From To Value [TxFee]
0xd92d40dbac4254e2dc5d7f32531848007a75c964813b82fd0344cbdbffb6648a27 mins ago0xcc89b0a6c72986886917f6627a0a12c9149b9912  IN   MyWishToken0 Ether0.00088728
0xeda76407f2fe6ce19783d201867b851aa8595166651885d8536b502ef6556a1732 mins ago0xcc89b0a6c72986886917f6627a0a12c9149b9912  IN   MyWishToken0 Ether0.00208728
0x13bdc7381b94e7eafb49583315b613a23b48606a1b6e268da785a29cf44209f843 mins ago0xe77d31bcd9849d837f67e2df4da3ab8863aeefd3  IN   MyWishToken0 Ether0.00093792
0xb0e5a282f7184e17b73063a7dfb4c7caba409aa4dc7e5d0247229a3155b6b2551 hr 5 mins ago0x915d89a29dfdb5ba24d59d9f190994c3e5be7e4a  IN   MyWishToken0 Ether0.00138297
0xd0e66b6130988f69ccb1f5811686a8e9797329df00d9c46a8483887e4a23a9b31 hr 8 mins ago0xe350ff7da4eb736284900af29ee141742db52f90  IN   MyWishToken0 Ether0.000690525
0x6f419a29321abf5244bb9768e800c09cff4deeb85c87d7c8d19e9eae6e631fce1 hr 29 mins ago0xf3b7f55b141aa737dae98439ee9964ec23a41ca3  IN   MyWishToken0 Ether0.001078278
0xa2c67ac68024ee4ea5394ed579ae88f70a8bc51006fd84eb15f6d517b40cd8881 hr 59 mins ago0xcb4abf4638be0765d226fb43641d9a67c8a716c4  IN   MyWishToken0 Ether0.001095822
0x97c5f10368fc72b764bd61b0c4a58510da0726abff04b7a4c223f6aa7eefb8b22 hrs 12 mins ago0x7476436384f2ef63a1a193f2da5b58c7b819129b  IN   MyWishToken0 Ether0.00009207
0x7e595bf0fe9b49d198e957f6088c178337f0cf811d9ab34bee2b250f8bc48d9b2 hrs 18 mins ago0x5f395745c5e17437b1bcf49a33bc24bca90761bd  IN   MyWishToken0 Ether0.00230495
0xb96eaaa908a6bd12eb5ecfa559cca9f5cfc1b2d9fe339a7d430288c3c47a439e2 hrs 53 mins ago0x15435d696c8d4ba3f2a944111d90c3096407b828  IN   MyWishToken0 Ether0.00297968
0x18e299baa3cf1be1bd2b050730cf9724af5dc8712a25d5b814ab90d5ef568aa93 hrs 16 mins ago0x2cd6df1b5ee3892b36c36c5e66b3c8baac6e9acf  IN   MyWishToken0 Ether0.00018414
0xb7369eb92549bf5c6eb5ef4835470abbc6b749a49d20fd7ccdf04064d77a3f193 hrs 51 mins ago0x39c53e4869b5d0c617315a7ce9dc57105ebf9dd5  IN   MyWishToken0 Ether0.00009207
0xa78245a1c419d80b6d209d9d79a7dff8c1170b90346db3f396961849aca125264 hrs 20 mins ago0xb73d84d1f9a2396223627a25831ac9793801aede  IN   MyWishToken0 Ether0.00027621
0x8372b348bff6a6108d4cb24bf4857e80165ac464be8907308a4e8cba5bec6b844 hrs 30 mins ago0x7ca7dd14181ea21483ee67cfa7a7de405aed958d  IN   MyWishToken0 Ether0.000208728
0x53357c320bd1c37a315d21d7b0343eceaaad43c5ee1dfaf3dc68247a14ed03344 hrs 34 mins ago0xd34e2dd306d73a4775fa39d8a52165cefa200fb8  IN   MyWishToken0 Ether0.000183884
0x61ba1e079935df9f4a8278e4b395edf33bce45acaabc2c3052576047d57e0e305 hrs 29 mins ago0x89c75cd65cfb05bf1fd8f86c84bd286015df7cc8  IN   MyWishToken0 Ether0.00018414
0x2730490afab0c99a57e50797eb21bbf689ea56598c6c8f31e9240edaf2e1c9956 hrs 28 mins ago0x8cfde7deea6969af4d5b8c5dcc99952d86c5092c  IN   MyWishToken0 Ether0.000966735
0x6ef2670577e7953260db68c8b23a8bbf6cd537a5505cb8f63d378388d7f02ae76 hrs 44 mins ago0xb74095f03274162f6fc211e37af8c3c299b2b084  IN   MyWishToken0 Ether0.000465822
0x2471c5754629c1e73f992e74e954b5ffca2b90a39abddb62940c06f4017a52ac6 hrs 46 mins ago0x2da4508f12cf70c92beb4d517ada86d24461edac  IN   MyWishToken0 Ether0.0018591
0xff7adde370a4df2f8d08368fb359a8e0b212daa1a7d1377c6d279fe8331265a76 hrs 56 mins ago0x79a9b6c92314c45b9e6d6ef3a8b5ee71b3ca514b  IN   MyWishToken0 Ether0.00027621
0x6fe4875aa9ef5b8db7072668eb5336ba2c29596e646cd409b1b9876013d0a7007 hrs 31 mins ago0xc944d89460c7dafe0d949fdeff5fe1d484244a17  IN   MyWishToken0 Ether0.00018591
0xa570b8f401458c5ef35e60cad9cefc8708abee5b4641d15626a2e008ab3bbbfc7 hrs 31 mins ago0xcc1b7569442f89b18727506203b72f9511692512  IN   MyWishToken0 Ether0.00027621
0x146e9676271100368c1ad1368fc05a140a4bcdba00e17f1345a6b941deb805e77 hrs 34 mins ago0x886735aa4d348cb656bf1bd71a3b23d643264ffd  IN   MyWishToken0 Ether0.00018414
0x610574471131752871565aeba8a58bcd635a4259be88a3e60964714a77ec71cf7 hrs 38 mins ago0x6d620e3b3afe5585f5fddec87b0f91f42f03f05a  IN   MyWishToken0 Ether0.000133092
0x8045e290d623942625285b320d3381982bef30dd7c18331790eda39532e076bf7 hrs 41 mins ago0xf22640a3d0351782d35d6f206feda9cafd7068cc  IN   MyWishToken0 Ether0.000133092
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
  Latest 1 Internal Transaction

ParentTxHash Block Age From To Value
0x3bb36a045c43aef477d41268ca97406c1bdc1c265fb0d3286e667385e1b67ca8439773756 days 18 hrs ago0x4eb5f89549c4d7a57267340c13fcca1049b57f9e  Contract Creation0 Ether
[ Download CSV Export  ] 
Contract Source Code Verified
Contract Name: MyWishToken
Compiler Version: v0.4.18+commit.9cf6e910
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts
pragma solidity ^0.4.18;


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


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


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


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


    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) onlyOwner {
        require(newOwner != address(0));
        OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }

}

contract usingMyWishConsts {
    uint constant TOKEN_DECIMALS = 18;
    uint8 constant TOKEN_DECIMALS_UINT8 = 18;
    uint constant TOKEN_DECIMAL_MULTIPLIER = 10 ** TOKEN_DECIMALS;

    uint constant TEAM_TOKENS =   3161200 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant BOUNTY_TOKENS = 2000000 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant PREICO_TOKENS = 3038800 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant MINIMAL_PURCHASE = 0.05 ether;

    address constant TEAM_ADDRESS = 0xE4F0Ff4641f3c99de342b06c06414d94A585eFfb;
    address constant BOUNTY_ADDRESS = 0x76d4136d6EE53DB4cc087F2E2990283d5317A5e9;
    address constant PREICO_ADDRESS = 0x195610851A43E9685643A8F3b49F0F8a019204f1;
    address constant COLD_WALLET = 0x80826b5b717aDd3E840343364EC9d971FBa3955C;

    string constant TOKEN_NAME = "MyWish Token";
    bytes32 constant TOKEN_SYMBOL = "WISH";
}
/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {
  function mul(uint256 a, uint256 b) internal constant returns (uint256) {
    uint256 c = a * b;
    assert(a == 0 || c / a == b);
    return c;
  }

  function div(uint256 a, uint256 b) internal constant 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 constant returns (uint256) {
    assert(b <= a);
    return a - b;
  }

  function add(uint256 a, uint256 b) internal constant 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) constant returns (uint256);
  function transfer(address to, uint256 value) 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) constant returns (uint256);
  function transferFrom(address from, address to, uint256 value) returns (bool);
  function approve(address spender, uint256 value) returns (bool);
  event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
 * @title Basic token
 * @dev Basic version of StandardToken, with no allowances. 
 */
contract BasicToken is ERC20Basic {
    using SafeMath for uint256;

    mapping (address => uint256) balances;

    /**
    * @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) returns (bool) {
        require(_to != address(0));

        // 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) constant 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)) 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) returns (bool) {
        require(_to != address(0));

        var _allowance = allowed[_from][msg.sender];

        // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
        // require (_value <= _allowance);

        balances[_from] = balances[_from].sub(_value);
        balances[_to] = balances[_to].add(_value);
        allowed[_from][msg.sender] = _allowance.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.
     * @param _spender The address which will spend the funds.
     * @param _value The amount of tokens to be spent.
     */
    function approve(address _spender, uint256 _value) returns (bool) {

        // To change the approve amount you first have to reduce the addresses`
        //  allowance to zero by calling `approve(_spender, 0)` if it is not
        //  already 0 to mitigate the race condition described here:
        //  https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
        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) constant returns (uint256 remaining) {
        return allowed[_owner][_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
     */
    function increaseApproval(address _spender, uint _addedValue) returns (bool success) {
        allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
        Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
        return true;
    }

    function decreaseApproval(address _spender, uint _subtractedValue) returns (bool success) {
        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;
    }

}

/**
 * @title Mintable token
 * @dev Simple ERC20 Token example, with mintable token creation
 * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
 */

contract MintableToken is StandardToken, 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 returns (bool) {
        totalSupply = totalSupply.add(_amount);
        balances[_to] = balances[_to].add(_amount);
        Mint(_to, _amount);
        Transfer(0x0, _to, _amount);
        return true;
    }

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

/**
 * @title Burnable Token
 * @dev Token that can be irreversibly burned (destroyed).
 */
contract BurnableToken is StandardToken {

    event Burn(address indexed burner, uint256 value);

    /**
     * @dev Burns a specific amount of tokens.
     * @param _value The amount of token to be burned.
     */
    function burn(uint256 _value) public {
        require(_value > 0);

        address burner = msg.sender;
        balances[burner] = balances[burner].sub(_value);
        totalSupply = totalSupply.sub(_value);
        Burn(burner, _value);
    }
}

contract MyWishToken is usingMyWishConsts, MintableToken, BurnableToken {
    /**
     * @dev Pause token transfer. After successfully finished crowdsale it becomes true.
     */
    bool public paused = true;
    /**
     * @dev Accounts who can transfer token even if paused. Works only during crowdsale.
     */
    mapping(address => bool) excluded;

    function name() constant public returns (string _name) {
        return TOKEN_NAME;
    }

    function symbol() constant public returns (bytes32 _symbol) {
        return TOKEN_SYMBOL;
    }

    function decimals() constant public returns (uint8 _decimals) {
        return TOKEN_DECIMALS_UINT8;
    }

    function crowdsaleFinished() onlyOwner {
        paused = false;
        finishMinting();
    }

    function addExcluded(address _toExclude) onlyOwner {
        excluded[_toExclude] = true;
    }

    function transferFrom(address _from, address _to, uint256 _value) returns (bool) {
        require(!paused || excluded[_from]);
        return super.transferFrom(_from, _to, _value);
    }

    function transfer(address _to, uint256 _value) returns (bool) {
        require(!paused || excluded[msg.sender]);
        return super.transfer(_to, _value);
    }

    /**
     * @dev Burn tokens from the specified address.
     * @param _from     address The address which you want to burn tokens from.
     * @param _value    uint    The amount of tokens to be burned.
     */
    function burnFrom(address _from, uint256 _value) returns (bool) {
        require(_value > 0);
        var allowance = allowed[_from][msg.sender];
        balances[_from] = balances[_from].sub(_value);
        totalSupply = totalSupply.sub(_value);
        allowed[_from][msg.sender] = allowance.sub(_value);
        Burn(_from, _value);
        return true;
    }
}
contract MyWishRateProviderI {
    /**
     * @dev Calculate actual rate using the specified parameters.
     * @param buyer     Investor (buyer) address.
     * @param totalSold Amount of sold tokens.
     * @param amountWei Amount of wei to purchase.
     * @return ETH to Token rate.
     */
    function getRate(address buyer, uint totalSold, uint amountWei) public constant returns (uint);

    /**
     * @dev rate scale (or divider), to support not integer rates.
     * @return Rate divider.
     */
    function getRateScale() public constant returns (uint);

    /**
     * @return Absolute base rate.
     */
    function getBaseRate() public constant returns (uint);
}

contract MyWishRateProvider is usingMyWishConsts, MyWishRateProviderI, Ownable {
    // rate calculate accuracy
    uint constant RATE_SCALE = 10000;
    uint constant STEP_30 = 3200000 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant STEP_20 = 6400000 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant STEP_10 = 9600000 * TOKEN_DECIMAL_MULTIPLIER;
    uint constant RATE_30 = 1950 * RATE_SCALE;
    uint constant RATE_20 = 1800 * RATE_SCALE;
    uint constant RATE_10 = 1650 * RATE_SCALE;
    uint constant BASE_RATE = 1500 * RATE_SCALE;

    struct ExclusiveRate {
        // be careful, accuracies this about 15 minutes
        uint32 workUntil;
        // exclusive rate or 0
        uint rate;
        // rate bonus percent, which will be divided by 1000 or 0
        uint16 bonusPercent1000;
        // flag to check, that record exists
        bool exists;
    }

    mapping(address => ExclusiveRate) exclusiveRate;

    function getRateScale() public constant returns (uint) {
        return RATE_SCALE;
    }

    function getBaseRate() public constant returns (uint) {
        return BASE_RATE;
    }

    function getRate(address buyer, uint totalSold, uint amountWei) public constant returns (uint) {
        uint rate;
        // apply sale
        if (totalSold < STEP_30) {
            rate = RATE_30;
        }
        else if (totalSold < STEP_20) {
            rate = RATE_20;
        }
        else if (totalSold < STEP_10) {
            rate = RATE_10;
        }
        else {
            rate = BASE_RATE;
        }

        // apply bonus for amount
        if (amountWei >= 1000 ether) {
            rate += rate * 13 / 100;
        }
        else if (amountWei >= 500 ether) {
            rate += rate * 10 / 100;
        }
        else if (amountWei >= 100 ether) {
            rate += rate * 7 / 100;
        }
        else if (amountWei >= 50 ether) {
            rate += rate * 5 / 100;
        }
        else if (amountWei >= 30 ether) {
            rate += rate * 4 / 100;
        }
        else if (amountWei >= 10 ether) {
            rate += rate * 25 / 1000;
        }

        ExclusiveRate memory eRate = exclusiveRate[buyer];
        if (eRate.exists && eRate.workUntil >= now) {
            if (eRate.rate != 0) {
                rate = eRate.rate;
            }
            rate += rate * eRate.bonusPercent1000 / 1000;
        }
        return rate;
    }

    function setExclusiveRate(address _investor, uint _rate, uint16 _bonusPercent1000, uint32 _workUntil) onlyOwner {
        exclusiveRate[_investor] = ExclusiveRate(_workUntil, _rate, _bonusPercent1000, true);
    }

    function removeExclusiveRate(address _investor) onlyOwner {
        delete exclusiveRate[_investor];
    }
}
/**
 * @title Crowdsale 
 * @dev Crowdsale is a base contract for managing a token crowdsale.
 *
 * Crowdsales have a start and end timestamps, where investors can make
 * token purchases and the crowdsale will assign them tokens based
 * on a token per ETH rate. Funds collected are forwarded to a wallet 
 * as they arrive.
 */
contract Crowdsale {
    using SafeMath for uint;

    // The token being sold
    MintableToken public token;

    // start and end timestamps where investments are allowed (both inclusive)
    uint32 internal startTime;
    uint32 internal endTime;

    // address where funds are collected
    address public wallet;

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

    /**
     * @dev Amount of already sold tokens.
     */
    uint public soldTokens;

    /**
     * @dev Maximum amount of tokens to mint.
     */
    uint internal hardCap;

    /**
     * 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, uint value, uint amount);

    function Crowdsale(uint _startTime, uint _endTime, uint _hardCap, address _wallet) {
        require(_endTime >= _startTime);
        require(_wallet != 0x0);
        require(_hardCap > 0);

        token = createTokenContract();
        startTime = uint32(_startTime);
        endTime = uint32(_endTime);
        hardCap = _hardCap;
        wallet = _wallet;
    }

    // creates the token to be sold.
    // override this method to have crowdsale of a specific mintable token.
    function createTokenContract() internal returns (MintableToken) {
        return new MintableToken();
    }

    /**
     * @dev this method might be overridden for implementing any sale logic.
     * @return Actual rate.
     */
    function getRate(uint amount) internal constant returns (uint);

    function getBaseRate() internal constant returns (uint);

    /**
     * @dev rate scale (or divider), to support not integer rates.
     * @return Rate divider.
     */
    function getRateScale() internal constant returns (uint) {
        return 1;
    }

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

    // low level token purchase function
    function buyTokens(address beneficiary, uint amountWei) internal {
        require(beneficiary != 0x0);

        // total minted tokens
        uint totalSupply = token.totalSupply();

        // actual token minting rate (with considering bonuses and discounts)
        uint actualRate = getRate(amountWei);
        uint rateScale = getRateScale();

        require(validPurchase(amountWei, actualRate, totalSupply));

        // calculate token amount to be created
        uint tokens = amountWei.mul(actualRate).div(rateScale);

        // update state
        weiRaised = weiRaised.add(amountWei);
        soldTokens = soldTokens.add(tokens);

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

        forwardFunds(amountWei);
    }

    // send ether to the fund collection wallet
    // override to create custom fund forwarding mechanisms
    function forwardFunds(uint amountWei) internal {
        wallet.transfer(amountWei);
    }

    /**
     * @dev Check if the specified purchase is valid.
     * @return true if the transaction can buy tokens
     */
    function validPurchase(uint _amountWei, uint _actualRate, uint _totalSupply) internal constant returns (bool) {
        bool withinPeriod = now >= startTime && now <= endTime;
        bool nonZeroPurchase = _amountWei != 0;
        bool hardCapNotReached = _totalSupply <= hardCap;

        return withinPeriod && nonZeroPurchase && hardCapNotReached;
    }

    /**
     * @dev Because of discount hasEnded might be true, but validPurchase returns false.
     * @return true if crowdsale event has ended
     */
    function hasEnded() public constant returns (bool) {
        return now > endTime || token.totalSupply() > hardCap;
    }

    /**
     * @return true if crowdsale event has started
     */
    function hasStarted() public constant returns (bool) {
        return now >= startTime;
    }
}

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

    bool public isFinalized = false;

    event Finalized();

    function FinalizableCrowdsale(uint _startTime, uint _endTime, uint _hardCap, address _wallet)
            Crowdsale(_startTime, _endTime, _hardCap, _wallet) {
    }

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

        finalization();
        Finalized();

        isFinalized = true;
    }

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

    modifier notFinalized() {
        require(!isFinalized);
        _;
    }
}

contract MyWishCrowdsale is usingMyWishConsts, FinalizableCrowdsale {
    MyWishRateProviderI public rateProvider;

    function MyWishCrowdsale(
            uint _startTime,
            uint _endTime,
            uint _hardCapTokens
    )
            FinalizableCrowdsale(_startTime, _endTime, _hardCapTokens * TOKEN_DECIMAL_MULTIPLIER, COLD_WALLET) {

        token.mint(TEAM_ADDRESS, TEAM_TOKENS);
        token.mint(BOUNTY_ADDRESS, BOUNTY_TOKENS);
        token.mint(PREICO_ADDRESS, PREICO_TOKENS);

        MyWishToken(token).addExcluded(TEAM_ADDRESS);
        MyWishToken(token).addExcluded(BOUNTY_ADDRESS);
        MyWishToken(token).addExcluded(PREICO_ADDRESS);

        MyWishRateProvider provider = new MyWishRateProvider();
        provider.transferOwnership(owner);
        rateProvider = provider;
    }

    /**
     * @dev override token creation to integrate with MyWill token.
     */
    function createTokenContract() internal returns (MintableToken) {
        return new MyWishToken();
    }

    /**
     * @dev override getRate to integrate with rate provider.
     */
    function getRate(uint _value) internal constant returns (uint) {
        return rateProvider.getRate(msg.sender, soldTokens, _value);
    }

    function getBaseRate() internal constant returns (uint) {
        return rateProvider.getRate(msg.sender, soldTokens, MINIMAL_PURCHASE);
    }

    /**
     * @dev override getRateScale to integrate with rate provider.
     */
    function getRateScale() internal constant returns (uint) {
        return rateProvider.getRateScale();
    }

    /**
     * @dev Admin can set new rate provider.
     * @param _rateProviderAddress New rate provider.
     */
    function setRateProvider(address _rateProviderAddress) onlyOwner {
        require(_rateProviderAddress != 0);
        rateProvider = MyWishRateProviderI(_rateProviderAddress);
    }

    /**
     * @dev Admin can move end time.
     * @param _endTime New end time.
     */
    function setEndTime(uint _endTime) onlyOwner notFinalized {
        require(_endTime > startTime);
        endTime = uint32(_endTime);
    }

    function setHardCap(uint _hardCapTokens) onlyOwner notFinalized {
        require(_hardCapTokens * TOKEN_DECIMAL_MULTIPLIER > hardCap);
        hardCap = _hardCapTokens * TOKEN_DECIMAL_MULTIPLIER;
    }

    function setStartTime(uint _startTime) onlyOwner notFinalized {
        require(_startTime < endTime);
        startTime = uint32(_startTime);
    }

    function addExcluded(address _address) onlyOwner notFinalized {
        MyWishToken(token).addExcluded(_address);
    }

    function validPurchase(uint _amountWei, uint _actualRate, uint _totalSupply) internal constant returns (bool) {
        if (_amountWei < MINIMAL_PURCHASE) {
            return false;
        }
        return super.validPurchase(_amountWei, _actualRate, _totalSupply);
    }

    function finalization() internal {
        super.finalization();
        token.finishMinting();
        MyWishToken(token).crowdsaleFinished();
        token.transferOwnership(owner);
    }
}

    Contract ABI  
[{"constant":true,"inputs":[],"name":"mintingFinished","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"_name","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_value","type":"uint256"}],"name":"approve","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"totalSupply","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transferFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"_decimals","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_amount","type":"uint256"}],"name":"mint","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"paused","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"}],"name":"burnFrom","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"finishMinting","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"_symbol","type":"bytes32"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_toExclude","type":"address"}],"name":"addExcluded","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"success","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"remaining","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"crowdsaleFinished","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"anonymous":false,"inputs":[{"indexed":true,"name":"burner","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"Mint","type":"event"},{"anonymous":false,"inputs":[],"name":"MintFinished","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":"owner","type":"address"},{"indexed":true,"name":"spender","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"from","type":"address"},{"indexed":true,"name":"to","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Transfer","type":"event"}]

  Contract Creation Code Switch To Opcodes View
606060405260038054750100000000000000000000000000000000000000000060a060020a61ffff021990911617600160a060020a03191633600160a060020a0316179055610efe806100536000396000f30060606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f457806323b872dd14610219578063313ce5671461024157806340c10f191461026a57806342966c681461028c5780635c975abb146102a457806366188463146102b757806370a08231146102d957806379cc6790146102f85780637d64bcb41461031a5780638da5cb5b1461032d57806395d89b411461035c578063a9059cbb1461036f578063a932157314610391578063d73dd623146103b0578063dd62ed3e146103d2578063ece84fd5146103f7578063f2fde38b1461040a575b600080fd5b341561012c57600080fd5b610134610429565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b61044a565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a036004351660243561048b565b34156101ff57600080fd5b610207610531565b60405190815260200160405180910390f35b341561022457600080fd5b610134600160a060020a0360043581169060243516604435610537565b341561024c57600080fd5b61025461059b565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b610134600160a060020a03600435166024356105a0565b341561029757600080fd5b6102a26004356106be565b005b34156102af57600080fd5b610134610762565b34156102c257600080fd5b610134600160a060020a0360043516602435610784565b34156102e457600080fd5b610207600160a060020a036004351661087e565b341561030357600080fd5b610134600160a060020a0360043516602435610899565b341561032557600080fd5b610134610997565b341561033857600080fd5b610340610a1c565b604051600160a060020a03909116815260200160405180910390f35b341561036757600080fd5b610207610a2b565b341561037a57600080fd5b610134600160a060020a0360043516602435610a4f565b341561039c57600080fd5b6102a2600160a060020a0360043516610ab1565b34156103bb57600080fd5b610134600160a060020a0360043516602435610af0565b34156103dd57600080fd5b610207600160a060020a0360043581169060243516610b94565b341561040257600080fd5b6102a2610bbf565b341561041557600080fd5b6102a2600160a060020a0360043516610c04565b60035474010000000000000000000000000000000000000000900460ff1681565b610452610ec0565b60408051908101604052600c81527f4d795769736820546f6b656e00000000000000000000000000000000000000006020820152905090565b60008115806104bd5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156104c857600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6003546000907501000000000000000000000000000000000000000000900460ff16158061057d5750600160a060020a03841660009081526004602052604090205460ff165b151561058857600080fd5b610593848484610c9f565b949350505050565b601290565b60035460009033600160a060020a039081169116146105be57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105e657600080fd5b6000546105f9908363ffffffff610dc916565b6000908155600160a060020a038416815260016020526040902054610624908363ffffffff610dc916565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60008082116106cc57600080fd5b5033600160a060020a0381166000908152600160205260409020546106f19083610dd8565b600160a060020a0382166000908152600160205260408120919091555461071e908363ffffffff610dd816565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6003547501000000000000000000000000000000000000000000900460ff1681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107e157600160a060020a033381166000908152600260209081526040808320938816835292905290812055610818565b6107f1818463ffffffff610dd816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b6000808083116108a857600080fd5b50600160a060020a038084166000818152600260209081526040808320339095168352938152838220549282526001905291909120546108ee908463ffffffff610dd816565b600160a060020a0385166000908152600160205260408120919091555461091b908463ffffffff610dd816565b60005561092e818463ffffffff610dd816565b600160a060020a038086166000818152600260209081526040808320339095168352939052829020929092557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59085905190815260200160405180910390a25060019392505050565b60035460009033600160a060020a039081169116146109b557600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b7f574953480000000000000000000000000000000000000000000000000000000090565b6003546000907501000000000000000000000000000000000000000000900460ff161580610a955750600160a060020a03331660009081526004602052604090205460ff165b1515610aa057600080fd5b610aaa8383610dea565b9392505050565b60035433600160a060020a03908116911614610acc57600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b28908363ffffffff610dc916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610bda57600080fd5b6003805475ff00000000000000000000000000000000000000000019169055610c01610997565b50565b60035433600160a060020a03908116911614610c1f57600080fd5b600160a060020a0381161515610c3457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600160a060020a0384161515610cb757600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610cfd908463ffffffff610dd816565b600160a060020a038087166000908152600160205260408082209390935590861681522054610d32908463ffffffff610dc916565b600160a060020a038516600090815260016020526040902055610d5b818463ffffffff610dd816565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b600082820183811015610aaa57fe5b600082821115610de457fe5b50900390565b6000600160a060020a0383161515610e0157600080fd5b600160a060020a033316600090815260016020526040902054610e2a908363ffffffff610dd816565b600160a060020a033381166000908152600160205260408082209390935590851681522054610e5f908363ffffffff610dc916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b602060405190810160405260008152905600a165627a7a72305820b0fcdaa47ec8f5b451fdeace4fbe4cfacf66881a5032e6524fd05619de3d504f0029

   Swarm Source:
bzzr://b0fcdaa47ec8f5b451fdeace4fbe4cfacf66881a5032e6524fd05619de3d504f

 

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