ETH Price: $2,533.63 (+4.13%)

Contract

0x1b22C32cD936cB97C28C5690a0695a82Abf688e6
 
Transaction Hash
Method
Block
From
To
Approve204534772024-08-04 6:44:4747 days ago1722753887IN
0x1b22C32c...2Abf688e6
0 ETH0.000080041.71443454
Transfer204534542024-08-04 6:40:1147 days ago1722753611IN
0x1b22C32c...2Abf688e6
0 ETH0.000205324.15798275
Approve203193662024-07-16 13:27:2365 days ago1721136443IN
0x1b22C32c...2Abf688e6
0 ETH0.000199598.2567842
Transfer196608362024-04-15 12:13:35158 days ago1713183215IN
0x1b22C32c...2Abf688e6
0 ETH0.0005937612.02399458
Transfer193583292024-03-04 0:49:59200 days ago1709513399IN
0x1b22C32c...2Abf688e6
0 ETH0.0019070959.09797202
Transfer189873622024-01-12 0:52:11252 days ago1705020731IN
0x1b22C32c...2Abf688e6
0 ETH0.0008886618
Transfer189792842024-01-10 21:39:23253 days ago1704922763IN
0x1b22C32c...2Abf688e6
0 ETH0.0029404259.52993067
Approve187506822023-12-09 19:15:11285 days ago1702149311IN
0x1b22C32c...2Abf688e6
0 ETH0.0014324130.72082189
Approve183445402023-10-13 22:46:47342 days ago1697237207IN
0x1b22C32c...2Abf688e6
0 ETH0.000308986.61821344
Approve183425892023-10-13 16:13:47342 days ago1697213627IN
0x1b22C32c...2Abf688e6
0 ETH0.0008664418.55852078
Approve183425742023-10-13 16:10:47342 days ago1697213447IN
0x1b22C32c...2Abf688e6
0 ETH0.0010792323.1223518
Approve183425682023-10-13 16:09:35342 days ago1697213375IN
0x1b22C32c...2Abf688e6
0 ETH0.000974120.86469206
Approve183425662023-10-13 16:09:11342 days ago1697213351IN
0x1b22C32c...2Abf688e6
0 ETH0.0009891521.18686025
Approve183425632023-10-13 16:08:35342 days ago1697213315IN
0x1b22C32c...2Abf688e6
0 ETH0.0010303722.06980375
Approve183425632023-10-13 16:08:35342 days ago1697213315IN
0x1b22C32c...2Abf688e6
0 ETH0.0048587104.06980375
Approve183425622023-10-13 16:08:23342 days ago1697213303IN
0x1b22C32c...2Abf688e6
0 ETH0.0009713120.80482675
Approve183425612023-10-13 16:08:11342 days ago1697213291IN
0x1b22C32c...2Abf688e6
0 ETH0.0009769420.92533756
Approve183425602023-10-13 16:07:59342 days ago1697213279IN
0x1b22C32c...2Abf688e6
0 ETH0.0009696420.76898807
Approve183425582023-10-13 16:07:35342 days ago1697213255IN
0x1b22C32c...2Abf688e6
0 ETH0.0009974221.36402001
Approve183425582023-10-13 16:07:35342 days ago1697213255IN
0x1b22C32c...2Abf688e6
0 ETH0.0009974221.36402001
Approve183425542023-10-13 16:06:47342 days ago1697213207IN
0x1b22C32c...2Abf688e6
0 ETH0.0010211221.87181968
Approve183400572023-10-13 7:43:35343 days ago1697183015IN
0x1b22C32c...2Abf688e6
0 ETH0.000122925.08501049
Transfer174518352023-06-10 19:26:35467 days ago1686425195IN
0x1b22C32c...2Abf688e6
0 ETH0.0007506115.203772
Transfer164861862023-01-25 20:21:23603 days ago1674678083IN
0x1b22C32c...2Abf688e6
0 ETH0.0016976934.3705021
Transfer163383362023-01-05 4:55:35624 days ago1672894535IN
0x1b22C32c...2Abf688e6
0 ETH0.000790316
View all transactions

Latest 1 internal transaction

Advanced mode:
Parent Transaction Hash Block From To
43977372017-10-20 20:37:162526 days ago1508531836  Contract Creation0 ETH
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
MyWishToken

Compiler Version
v0.4.18+commit.9cf6e910

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2017-10-20
*/

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 Security Audit

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"}]

606060405260038054750100000000000000000000000000000000000000000060a060020a61ffff021990911617600160a060020a03191633600160a060020a0316179055610efe806100536000396000f30060606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f457806323b872dd14610219578063313ce5671461024157806340c10f191461026a57806342966c681461028c5780635c975abb146102a457806366188463146102b757806370a08231146102d957806379cc6790146102f85780637d64bcb41461031a5780638da5cb5b1461032d57806395d89b411461035c578063a9059cbb1461036f578063a932157314610391578063d73dd623146103b0578063dd62ed3e146103d2578063ece84fd5146103f7578063f2fde38b1461040a575b600080fd5b341561012c57600080fd5b610134610429565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b61044a565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a036004351660243561048b565b34156101ff57600080fd5b610207610531565b60405190815260200160405180910390f35b341561022457600080fd5b610134600160a060020a0360043581169060243516604435610537565b341561024c57600080fd5b61025461059b565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b610134600160a060020a03600435166024356105a0565b341561029757600080fd5b6102a26004356106be565b005b34156102af57600080fd5b610134610762565b34156102c257600080fd5b610134600160a060020a0360043516602435610784565b34156102e457600080fd5b610207600160a060020a036004351661087e565b341561030357600080fd5b610134600160a060020a0360043516602435610899565b341561032557600080fd5b610134610997565b341561033857600080fd5b610340610a1c565b604051600160a060020a03909116815260200160405180910390f35b341561036757600080fd5b610207610a2b565b341561037a57600080fd5b610134600160a060020a0360043516602435610a4f565b341561039c57600080fd5b6102a2600160a060020a0360043516610ab1565b34156103bb57600080fd5b610134600160a060020a0360043516602435610af0565b34156103dd57600080fd5b610207600160a060020a0360043581169060243516610b94565b341561040257600080fd5b6102a2610bbf565b341561041557600080fd5b6102a2600160a060020a0360043516610c04565b60035474010000000000000000000000000000000000000000900460ff1681565b610452610ec0565b60408051908101604052600c81527f4d795769736820546f6b656e00000000000000000000000000000000000000006020820152905090565b60008115806104bd5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156104c857600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6003546000907501000000000000000000000000000000000000000000900460ff16158061057d5750600160a060020a03841660009081526004602052604090205460ff165b151561058857600080fd5b610593848484610c9f565b949350505050565b601290565b60035460009033600160a060020a039081169116146105be57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105e657600080fd5b6000546105f9908363ffffffff610dc916565b6000908155600160a060020a038416815260016020526040902054610624908363ffffffff610dc916565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60008082116106cc57600080fd5b5033600160a060020a0381166000908152600160205260409020546106f19083610dd8565b600160a060020a0382166000908152600160205260408120919091555461071e908363ffffffff610dd816565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6003547501000000000000000000000000000000000000000000900460ff1681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107e157600160a060020a033381166000908152600260209081526040808320938816835292905290812055610818565b6107f1818463ffffffff610dd816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b6000808083116108a857600080fd5b50600160a060020a038084166000818152600260209081526040808320339095168352938152838220549282526001905291909120546108ee908463ffffffff610dd816565b600160a060020a0385166000908152600160205260408120919091555461091b908463ffffffff610dd816565b60005561092e818463ffffffff610dd816565b600160a060020a038086166000818152600260209081526040808320339095168352939052829020929092557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59085905190815260200160405180910390a25060019392505050565b60035460009033600160a060020a039081169116146109b557600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b7f574953480000000000000000000000000000000000000000000000000000000090565b6003546000907501000000000000000000000000000000000000000000900460ff161580610a955750600160a060020a03331660009081526004602052604090205460ff165b1515610aa057600080fd5b610aaa8383610dea565b9392505050565b60035433600160a060020a03908116911614610acc57600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b28908363ffffffff610dc916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610bda57600080fd5b6003805475ff00000000000000000000000000000000000000000019169055610c01610997565b50565b60035433600160a060020a03908116911614610c1f57600080fd5b600160a060020a0381161515610c3457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600160a060020a0384161515610cb757600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610cfd908463ffffffff610dd816565b600160a060020a038087166000908152600160205260408082209390935590861681522054610d32908463ffffffff610dc916565b600160a060020a038516600090815260016020526040902055610d5b818463ffffffff610dd816565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b600082820183811015610aaa57fe5b600082821115610de457fe5b50900390565b6000600160a060020a0383161515610e0157600080fd5b600160a060020a033316600090815260016020526040902054610e2a908363ffffffff610dd816565b600160a060020a033381166000908152600160205260408082209390935590851681522054610e5f908363ffffffff610dc916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b602060405190810160405260008152905600a165627a7a72305820b0fcdaa47ec8f5b451fdeace4fbe4cfacf66881a5032e6524fd05619de3d504f0029

Deployed Bytecode

0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde0314610148578063095ea7b3146101d257806318160ddd146101f457806323b872dd14610219578063313ce5671461024157806340c10f191461026a57806342966c681461028c5780635c975abb146102a457806366188463146102b757806370a08231146102d957806379cc6790146102f85780637d64bcb41461031a5780638da5cb5b1461032d57806395d89b411461035c578063a9059cbb1461036f578063a932157314610391578063d73dd623146103b0578063dd62ed3e146103d2578063ece84fd5146103f7578063f2fde38b1461040a575b600080fd5b341561012c57600080fd5b610134610429565b604051901515815260200160405180910390f35b341561015357600080fd5b61015b61044a565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019757808201518382015260200161017f565b50505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dd57600080fd5b610134600160a060020a036004351660243561048b565b34156101ff57600080fd5b610207610531565b60405190815260200160405180910390f35b341561022457600080fd5b610134600160a060020a0360043581169060243516604435610537565b341561024c57600080fd5b61025461059b565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b610134600160a060020a03600435166024356105a0565b341561029757600080fd5b6102a26004356106be565b005b34156102af57600080fd5b610134610762565b34156102c257600080fd5b610134600160a060020a0360043516602435610784565b34156102e457600080fd5b610207600160a060020a036004351661087e565b341561030357600080fd5b610134600160a060020a0360043516602435610899565b341561032557600080fd5b610134610997565b341561033857600080fd5b610340610a1c565b604051600160a060020a03909116815260200160405180910390f35b341561036757600080fd5b610207610a2b565b341561037a57600080fd5b610134600160a060020a0360043516602435610a4f565b341561039c57600080fd5b6102a2600160a060020a0360043516610ab1565b34156103bb57600080fd5b610134600160a060020a0360043516602435610af0565b34156103dd57600080fd5b610207600160a060020a0360043581169060243516610b94565b341561040257600080fd5b6102a2610bbf565b341561041557600080fd5b6102a2600160a060020a0360043516610c04565b60035474010000000000000000000000000000000000000000900460ff1681565b610452610ec0565b60408051908101604052600c81527f4d795769736820546f6b656e00000000000000000000000000000000000000006020820152905090565b60008115806104bd5750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156104c857600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b6003546000907501000000000000000000000000000000000000000000900460ff16158061057d5750600160a060020a03841660009081526004602052604090205460ff165b151561058857600080fd5b610593848484610c9f565b949350505050565b601290565b60035460009033600160a060020a039081169116146105be57600080fd5b60035474010000000000000000000000000000000000000000900460ff16156105e657600080fd5b6000546105f9908363ffffffff610dc916565b6000908155600160a060020a038416815260016020526040902054610624908363ffffffff610dc916565b600160a060020a0384166000818152600160205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a282600160a060020a031660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60008082116106cc57600080fd5b5033600160a060020a0381166000908152600160205260409020546106f19083610dd8565b600160a060020a0382166000908152600160205260408120919091555461071e908363ffffffff610dd816565b600055600160a060020a0381167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a25050565b6003547501000000000000000000000000000000000000000000900460ff1681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156107e157600160a060020a033381166000908152600260209081526040808320938816835292905290812055610818565b6107f1818463ffffffff610dd816565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526001602052604090205490565b6000808083116108a857600080fd5b50600160a060020a038084166000818152600260209081526040808320339095168352938152838220549282526001905291909120546108ee908463ffffffff610dd816565b600160a060020a0385166000908152600160205260408120919091555461091b908463ffffffff610dd816565b60005561092e818463ffffffff610dd816565b600160a060020a038086166000818152600260209081526040808320339095168352939052829020929092557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59085905190815260200160405180910390a25060019392505050565b60035460009033600160a060020a039081169116146109b557600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600354600160a060020a031681565b7f574953480000000000000000000000000000000000000000000000000000000090565b6003546000907501000000000000000000000000000000000000000000900460ff161580610a955750600160a060020a03331660009081526004602052604090205460ff165b1515610aa057600080fd5b610aaa8383610dea565b9392505050565b60035433600160a060020a03908116911614610acc57600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610b28908363ffffffff610dc916565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610bda57600080fd5b6003805475ff00000000000000000000000000000000000000000019169055610c01610997565b50565b60035433600160a060020a03908116911614610c1f57600080fd5b600160a060020a0381161515610c3457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600080600160a060020a0384161515610cb757600080fd5b50600160a060020a03808516600081815260026020908152604080832033909516835293815283822054928252600190529190912054610cfd908463ffffffff610dd816565b600160a060020a038087166000908152600160205260408082209390935590861681522054610d32908463ffffffff610dc916565b600160a060020a038516600090815260016020526040902055610d5b818463ffffffff610dd816565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b600082820183811015610aaa57fe5b600082821115610de457fe5b50900390565b6000600160a060020a0383161515610e0157600080fd5b600160a060020a033316600090815260016020526040902054610e2a908363ffffffff610dd816565b600160a060020a033381166000908152600160205260408082209390935590851681522054610e5f908363ffffffff610dc916565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b602060405190810160405260008152905600a165627a7a72305820b0fcdaa47ec8f5b451fdeace4fbe4cfacf66881a5032e6524fd05619de3d504f0029

Swarm Source

bzzr://b0fcdaa47ec8f5b451fdeace4fbe4cfacf66881a5032e6524fd05619de3d504f

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.