ETH Price: $3,276.45 (+0.78%)
Gas: 1 Gwei

Contract

0x9f7695548e0bBe41e583dAc026866e2B10E11B3a
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Transfer69116702018-12-18 23:08:372047 days ago1545174517IN
0x9f769554...B10E11B3a
0.05 ETH0.0004310420
Transfer69116412018-12-18 23:01:422047 days ago1545174102IN
0x9f769554...B10E11B3a
0.053 ETH0.0002155210
Transfer67241332018-11-17 23:40:262078 days ago1542498026IN
0x9f769554...B10E11B3a
1 ETH0.00004312
Transfer67218342018-11-17 14:48:302078 days ago1542466110IN
0x9f769554...B10E11B3a
1 ETH0.00004312
Transfer67088132018-11-15 11:44:362080 days ago1542282276IN
0x9f769554...B10E11B3a
6.7 ETH0.0052952970
Transfer67088062018-11-15 11:42:162080 days ago1542282136IN
0x9f769554...B10E11B3a
32 ETH0.0017398823
Transfer67087892018-11-15 11:38:542080 days ago1542281934IN
0x9f769554...B10E11B3a
0.76 ETH0.0015129420
Transfer67086502018-11-15 11:03:032080 days ago1542279783IN
0x9f769554...B10E11B3a
3 ETH0.0012103516
Transfer67084252018-11-15 10:09:432080 days ago1542276583IN
0x9f769554...B10E11B3a
2.5 ETH0.0012859917
Transfer67053052018-11-14 21:49:382081 days ago1542232178IN
0x9f769554...B10E11B3a
1.05 ETH0.0022694130
Transfer67052812018-11-14 21:45:372081 days ago1542231937IN
0x9f769554...B10E11B3a
1.01 ETH0.0007339529.125
Transfer67046422018-11-14 19:22:562081 days ago1542223376IN
0x9f769554...B10E11B3a
0.08925 ETH0.000363886
Transfer67045922018-11-14 19:09:182081 days ago1542222558IN
0x9f769554...B10E11B3a
0.32 ETH0.000363886
Transfer67044702018-11-14 18:42:592081 days ago1542220979IN
0x9f769554...B10E11B3a
0.00082 ETH0.000485178
Transfer67039802018-11-14 16:43:522081 days ago1542213832IN
0x9f769554...B10E11B3a
1.1 ETH0.0003603614.30000001
Transfer67038232018-11-14 16:07:402081 days ago1542211660IN
0x9f769554...B10E11B3a
1.1 ETH0.00151260
Transfer67037722018-11-14 15:54:462081 days ago1542210886IN
0x9f769554...B10E11B3a
1.1 ETH0.0005449521.625
Transfer67037572018-11-14 15:50:342081 days ago1542210634IN
0x9f769554...B10E11B3a
1.11 ETH0.000277211
Transfer67031302018-11-14 13:25:442081 days ago1542201944IN
0x9f769554...B10E11B3a
2 ETH0.0009077612
Transfer67027412018-11-14 11:54:332081 days ago1542196473IN
0x9f769554...B10E11B3a
37.4725 ETH0.0006064710
Transfer67026212018-11-14 11:24:462081 days ago1542194686IN
0x9f769554...B10E11B3a
38.675 ETH0.000453886
Transfer66981952018-11-13 17:55:282082 days ago1542131728IN
0x9f769554...B10E11B3a
0.125 ETH0.000181943
Transfer66981742018-11-13 17:51:482082 days ago1542131508IN
0x9f769554...B10E11B3a
5.625 ETH0.000226943
Transfer66942382018-11-13 2:11:562083 days ago1542075116IN
0x9f769554...B10E11B3a
1 ETH0.000226943
Transfer66938012018-11-13 0:28:472083 days ago1542068927IN
0x9f769554...B10E11B3a
0.15980529 ETH0.000151292
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block From To
67088132018-11-15 11:44:362080 days ago1542282276
0x9f769554...B10E11B3a
6.7 ETH
67088062018-11-15 11:42:162080 days ago1542282136
0x9f769554...B10E11B3a
32 ETH
67087892018-11-15 11:38:542080 days ago1542281934
0x9f769554...B10E11B3a
0.76 ETH
67086502018-11-15 11:03:032080 days ago1542279783
0x9f769554...B10E11B3a
3 ETH
67084252018-11-15 10:09:432080 days ago1542276583
0x9f769554...B10E11B3a
2.5 ETH
67053052018-11-14 21:49:382081 days ago1542232178
0x9f769554...B10E11B3a
1.05 ETH
67046422018-11-14 19:22:562081 days ago1542223376
0x9f769554...B10E11B3a
0.08925 ETH
67045922018-11-14 19:09:182081 days ago1542222558
0x9f769554...B10E11B3a
0.32 ETH
67044702018-11-14 18:42:592081 days ago1542220979
0x9f769554...B10E11B3a
0.00082 ETH
67031302018-11-14 13:25:442081 days ago1542201944
0x9f769554...B10E11B3a
2 ETH
67027412018-11-14 11:54:332081 days ago1542196473
0x9f769554...B10E11B3a
37.4725 ETH
67026212018-11-14 11:24:462081 days ago1542194686
0x9f769554...B10E11B3a
38.675 ETH
66981952018-11-13 17:55:282082 days ago1542131728
0x9f769554...B10E11B3a
0.125 ETH
66981742018-11-13 17:51:482082 days ago1542131508
0x9f769554...B10E11B3a
5.625 ETH
66942382018-11-13 2:11:562083 days ago1542075116
0x9f769554...B10E11B3a
1 ETH
66938012018-11-13 0:28:472083 days ago1542068927
0x9f769554...B10E11B3a
0.15980529 ETH
66926522018-11-12 20:07:302083 days ago1542053250
0x9f769554...B10E11B3a
1 ETH
66924242018-11-12 19:12:212083 days ago1542049941
0x9f769554...B10E11B3a
2 ETH
66913912018-11-12 15:17:462083 days ago1542035866
0x9f769554...B10E11B3a
0.34 ETH
66911032018-11-12 14:10:042083 days ago1542031804
0x9f769554...B10E11B3a
0.6998 ETH
66570482018-11-07 0:16:092089 days ago1541549769
0x9f769554...B10E11B3a
0.025 ETH
66483482018-11-05 13:53:092090 days ago1541425989
0x9f769554...B10E11B3a
0.01 ETH
66244592018-11-01 15:46:282094 days ago1541087188
0x9f769554...B10E11B3a
0.075 ETH
66111842018-10-30 11:29:432096 days ago1540898983
0x9f769554...B10E11B3a
0.025 ETH
66059942018-10-29 15:12:282097 days ago1540825948
0x9f769554...B10E11B3a
0.004 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NmxCrowdsale

Compiler Version
v0.4.24+commit.e67f0147

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion

Contract Source Code (Solidity)

/**
 *Submitted for verification at Etherscan.io on 2018-09-11
*/

pragma solidity ^0.4.24;


/**
 * @title SafeMath
 * @dev Math operations with safety checks that throw on error
 */
library SafeMath {

  /**
  * @dev Multiplies two numbers, throws on overflow.
  */
  function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
    // Gas optimization: this is cheaper than asserting 'a' not being zero, but the
    // benefit is lost if 'b' is also tested.
    // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
    if (_a == 0) {
      return 0;
    }

    uint256 c = _a * _b;
    assert(c / _a == _b);

    return c;
  }

  /**
  * @dev Integer division of two numbers, truncating the quotient.
  */
  function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
    // assert(_b > 0); // Solidity automatically throws when dividing by 0
    uint256 c = _a / _b;
    // assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold

    return c;
  }

  /**
  * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
  */
  function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
    assert(_b <= _a);
    uint256 c = _a - _b;

    return c;
  }

  /**
  * @dev Adds two numbers, throws on overflow.
  */
  function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
    uint256 c = _a + _b;
    assert(c >= _a);

    return c;
  }
}


/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 {
  function totalSupply() public view returns (uint256);

  function balanceOf(address _who) public view returns (uint256);

  function allowance(address _owner, address _spender)
    public view returns (uint256);

  function transfer(address _to, uint256 _value) public returns (bool);

  function approve(address _spender, uint256 _value)
    public returns (bool);

  function transferFrom(address _from, address _to, uint256 _value)
    public returns (bool);

  event Transfer(
    address indexed from,
    address indexed to,
    uint256 value
  );

  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}


/**
 * @title Standard ERC20 token
 *
 * @dev Implementation of the basic standard token.
 * https://github.com/ethereum/EIPs/issues/20
 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
 */
contract StandardToken is ERC20 {
  using SafeMath for uint256;

  mapping(address => uint256) balances;

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

  uint256 totalSupply_;

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

  /**
  * @dev Gets the balance of the specified address.
  * @param _owner The address to query the the balance of.
  * @return An uint256 representing the amount owned by the passed address.
  */
  function balanceOf(address _owner) public view returns (uint256) {
    return balances[_owner];
  }

  /**
   * @dev Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(
    address _owner,
    address _spender
   )
    public
    view
    returns (uint256)
  {
    return allowed[_owner][_spender];
  }

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

    balances[msg.sender] = balances[msg.sender].sub(_value);
    balances[_to] = balances[_to].add(_value);
    emit Transfer(msg.sender, _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) public returns (bool) {
    allowed[msg.sender][_spender] = _value;
    emit Approval(msg.sender, _spender, _value);
    return true;
  }

  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(
    address _from,
    address _to,
    uint256 _value
  )
    public
    returns (bool)
  {
    require(_value <= balances[_from]);
    require(_value <= allowed[_from][msg.sender]);
    require(_to != address(0));

    balances[_from] = balances[_from].sub(_value);
    balances[_to] = balances[_to].add(_value);
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    emit Transfer(_from, _to, _value);
    return true;
  }

  /**
   * @dev 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,
    uint256 _addedValue
  )
    public
    returns (bool)
  {
    allowed[msg.sender][_spender] = (
      allowed[msg.sender][_spender].add(_addedValue));
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

  /**
   * @dev Decrease the amount of tokens that an owner allowed to a spender.
   * approve should be called when allowed[_spender] == 0. To decrement
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _subtractedValue The amount of tokens to decrease the allowance by.
   */
  function decreaseApproval(
    address _spender,
    uint256 _subtractedValue
  )
    public
    returns (bool)
  {
    uint256 oldValue = allowed[msg.sender][_spender];
    if (_subtractedValue >= oldValue) {
      allowed[msg.sender][_spender] = 0;
    } else {
      allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
    }
    emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
    return true;
  }

}


/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure.
 * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
  function safeTransfer(
    ERC20 _token,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transfer(_to, _value));
  }

  function safeTransferFrom(
    ERC20 _token,
    address _from,
    address _to,
    uint256 _value
  )
    internal
  {
    require(_token.transferFrom(_from, _to, _value));
  }

  function safeApprove(
    ERC20 _token,
    address _spender,
    uint256 _value
  )
    internal
  {
    require(_token.approve(_spender, _value));
  }
}


contract NmxToken is StandardToken {

  string public constant name = "Numex";
  string public constant symbol = "NMX";
  uint8 public constant decimals = 18;

  uint256 public constant INITIAL_SUPPLY = 1500000 * (10 ** uint256(decimals));

  /**
   * @dev Constructor that gives msg.sender all of existing tokens.
   */
  constructor() public {
    totalSupply_ = INITIAL_SUPPLY;
    balances[msg.sender] = INITIAL_SUPPLY;
    emit Transfer(address(0), msg.sender, INITIAL_SUPPLY);
  }
}


/**
 * @title Crowdsale
 * @dev Crowdsale is a base contract for managing a token crowdsale,
 * allowing investors to purchase tokens with ether. This contract implements
 * such functionality in its most fundamental form and can be extended to provide additional
 * functionality and/or custom behavior.
 * The external interface represents the basic interface for purchasing tokens, and conform
 * the base architecture for crowdsales. They are *not* intended to be modified / overridden.
 * The internal interface conforms the extensible and modifiable surface of crowdsales. Override
 * the methods to add functionality. Consider using 'super' where appropriate to concatenate
 * behavior.
 */
contract Crowdsale {
  using SafeMath for uint256;
  using SafeERC20 for ERC20;

  // The token being sold
  ERC20 public token;

  // Address where funds are collected
  address public wallet;

  // How many token units a buyer gets per wei.
  // The rate is the conversion between wei and the smallest and indivisible token unit.
  // So, if you are using a rate of 1 with a DetailedERC20 token with 3 decimals called TOK
  // 1 wei will give you 1 unit, or 0.001 TOK.
  uint256 public rate;

  // Amount of wei raised
  uint256 public weiRaised;

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

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

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

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

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

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

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

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

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

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

    _updatePurchasingState(_beneficiary, weiAmount);

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

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

  /**
   * @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use `super` in contracts that inherit from Crowdsale to extend their validations.
   * Example from CappedCrowdsale.sol's _preValidatePurchase method: 
   *   super._preValidatePurchase(_beneficiary, _weiAmount);
   *   require(weiRaised.add(_weiAmount) <= cap);
   * @param _beneficiary Address performing the token purchase
   * @param _weiAmount Value in wei involved in the purchase
   */
  function _preValidatePurchase(
    address _beneficiary,
    uint256 _weiAmount
  )
    internal
  {
    require(_beneficiary != address(0));
    require(_weiAmount != 0);
  }

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

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

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

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

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

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


/**
 * @title TimedCrowdsale
 * @dev Crowdsale accepting contributions only within a time frame.
 */
contract TimedCrowdsale is Crowdsale {
  using SafeMath for uint256;

  uint256 public openingTime;
  uint256 public closingTime;

  /**
   * @dev Reverts if not in crowdsale time range.
   */
  modifier onlyWhileOpen {
    // solium-disable-next-line security/no-block-members
    require(block.timestamp >= openingTime && block.timestamp <= closingTime);
    _;
  }

  /**
   * @dev Constructor, takes crowdsale opening and closing times.
   * @param _openingTime Crowdsale opening time
   * @param _closingTime Crowdsale closing time
   */
  constructor(uint256 _openingTime, uint256 _closingTime) public {
    // solium-disable-next-line security/no-block-members
    require(_openingTime >= block.timestamp);
    require(_closingTime >= _openingTime);

    openingTime = _openingTime;
    closingTime = _closingTime;
  }

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

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

}


/**
 * @title AllowanceCrowdsale
 * @dev Extension of Crowdsale where tokens are held by a wallet, which approves an allowance to the crowdsale.
 */
contract AllowanceCrowdsale is Crowdsale {
  using SafeMath for uint256;
  using SafeERC20 for ERC20;

  address public tokenWallet;

  /**
   * @dev Constructor, takes token wallet address.
   * @param _tokenWallet Address holding the tokens, which has approved allowance to the crowdsale
   */
  constructor(address _tokenWallet) public {
    require(_tokenWallet != address(0));
    tokenWallet = _tokenWallet;
  }

  /**
   * @dev Checks the amount of tokens left in the allowance.
   * @return Amount of tokens left in the allowance
   */
  function remainingTokens() public view returns (uint256) {
    return token.allowance(tokenWallet, this);
  }

  /**
   * @dev Overrides parent behavior by transferring tokens from wallet.
   * @param _beneficiary Token purchaser
   * @param _tokenAmount Amount of tokens purchased
   */
  function _deliverTokens(
    address _beneficiary,
    uint256 _tokenAmount
  )
    internal
  {
    token.safeTransferFrom(tokenWallet, _beneficiary, _tokenAmount);
  }
}


/**
 * @title IncreasingPriceCrowdsale
 * @dev Extension of Crowdsale contract that increases the price of tokens linearly in time.
 * Note that what should be provided to the constructor is the initial and final _rates_, that is,
 * the amount of tokens per wei contributed. Thus, the initial rate must be greater than the final rate.
 */
contract IncreasingPriceCrowdsale is TimedCrowdsale {
  using SafeMath for uint256;

  uint256 public initialRate;
  uint256 public finalRate;

  /**
   * @dev Constructor, takes initial and final rates of tokens received per wei contributed.
   * @param _initialRate Number of tokens a buyer gets per wei at the start of the crowdsale
   * @param _finalRate Number of tokens a buyer gets per wei at the end of the crowdsale
   */
  constructor(uint256 _initialRate, uint256 _finalRate) public {
    require(_initialRate >= _finalRate);
    require(_finalRate > 0);
    initialRate = _initialRate;
    finalRate = _finalRate;
  }

  /**
   * @dev Returns the rate of tokens per wei at the present time.
   * Note that, as price _increases_ with time, the rate _decreases_.
   * @return The number of tokens a buyer gets per wei at a given time
   */
  function getCurrentRate() public view returns (uint256) {
    // solium-disable-next-line security/no-block-members
    uint256 elapsedTime = block.timestamp.sub(openingTime);
    uint256 timeRange = closingTime.sub(openingTime);
    uint256 rateRange = initialRate.sub(finalRate);
    return initialRate.sub(elapsedTime.mul(rateRange).div(timeRange));
  }

  /**
   * @dev Overrides parent method taking into account variable rate.
   * @param _weiAmount The value in wei to be converted into tokens
   * @return The number of tokens _weiAmount wei will buy at present time
   */
  function _getTokenAmount(uint256 _weiAmount)
    internal view returns (uint256)
  {
    uint256 currentRate = getCurrentRate();
    return currentRate.mul(_weiAmount);
  }

}


/**
 * @title NmxCrowdsale
 * TimedCrowdsale - sets a time boundary for raising funds
 * AllowanceCrowdsale - allows to purchase tokens from external wallet
 */
contract NmxCrowdsale is AllowanceCrowdsale, IncreasingPriceCrowdsale {

  // solium-disable-next-line max-len
  event CrowdsaleCreated(address owner, uint256 openingTime, uint256 closingTime, uint256 rate);

  /**
   * @param _openingTime  time in Unix epoch - opening the crowdsale
   * @param _closingTime  time in Unix epoch - closing the crowdsale
   * @param _rate         how many tokens per 1 Ether in first stage
   * @param _ratePublic   how many tokens per 1 Ether in last stage
   * @param _wallet       wallet to collect Ether
   * @param _token        ERC20 token to put on sale
   * @param _tokenHolder  address of the token holder - to approve crowdsale
   */
  constructor(
    uint256 _openingTime,
    uint256 _closingTime,
    uint256 _rate,
    uint256 _ratePublic,
    address _wallet,
    StandardToken _token,
    address _tokenHolder
  )
    public
    Crowdsale(_rate, _wallet, _token)
    AllowanceCrowdsale(_tokenHolder)
    TimedCrowdsale(_openingTime, _closingTime)
    IncreasingPriceCrowdsale(_rate, _ratePublic)
  {
    emit CrowdsaleCreated(
      msg.sender, 
      _openingTime, 
      _closingTime, 
      _rate);
  }

  /**
  * There are only 2 rates: private and public - equally long
  */
  function getCurrentRate() public view returns (uint256) {
    // solium-disable-next-line security/no-block-members
    uint256 elapsedTime = block.timestamp.sub(openingTime);
    uint256 timeRange = closingTime.sub(openingTime);
    if (elapsedTime < timeRange.div(2)) {
      return initialRate;
    } else {
      return finalRate;
    }
  }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"hasClosed","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"finalRate","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":true,"inputs":[],"name":"weiRaised","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"closingTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"initialRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"openingTime","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"remainingTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tokenWallet","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_beneficiary","type":"address"}],"name":"buyTokens","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getCurrentRate","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"token","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_openingTime","type":"uint256"},{"name":"_closingTime","type":"uint256"},{"name":"_rate","type":"uint256"},{"name":"_ratePublic","type":"uint256"},{"name":"_wallet","type":"address"},{"name":"_token","type":"address"},{"name":"_tokenHolder","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"openingTime","type":"uint256"},{"indexed":false,"name":"closingTime","type":"uint256"},{"indexed":false,"name":"rate","type":"uint256"}],"name":"CrowdsaleCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"purchaser","type":"address"},{"indexed":true,"name":"beneficiary","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"amount","type":"uint256"}],"name":"TokenPurchase","type":"event"}]

608060405234801561001057600080fd5b5060405160e0806107da83398101604090815281516020830151918301516060840151608085015160a086015160c090960151939592939192909184848888848488886000831161006057600080fd5b600160a060020a038216151561007557600080fd5b600160a060020a038116151561008a57600080fd5b60029290925560018054600160a060020a0319908116600160a060020a03938416179091556000805490911692821692909217909155811615156100cd57600080fd5b60048054600160a060020a031916600160a060020a0392909216919091179055428210156100fa57600080fd5b8181101561010757600080fd5b6005919091556006558082101561011d57600080fd5b6000811161012a57600080fd5b60079190915560085560408051338152602081018990528082018890526060810187905290517f614b985e132cea6b04c91b8cfd1dc203e6903aebe45b9dd821679c41e9eb7ec99181900360800190a15050505050505061064a806101906000396000f3006080604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b81146100cf57806321106109146100f85780632c4e722e1461011f5780634042b66f146101345780634b6753bc14610149578063521eb2731461015e5780639e51051f1461018f578063b7a8807c146101a4578063bf583903146101b9578063bff99c6c146101ce578063ec8ac4d8146101e3578063f7fb07b0146101f7578063fc0c546a1461020c575b6100cd33610221565b005b3480156100db57600080fd5b506100e46102c3565b604080519115158252519081900360200190f35b34801561010457600080fd5b5061010d6102cb565b60408051918252519081900360200190f35b34801561012b57600080fd5b5061010d6102d1565b34801561014057600080fd5b5061010d6102d7565b34801561015557600080fd5b5061010d6102dd565b34801561016a57600080fd5b506101736102e3565b60408051600160a060020a039092168252519081900360200190f35b34801561019b57600080fd5b5061010d6102f2565b3480156101b057600080fd5b5061010d6102f8565b3480156101c557600080fd5b5061010d6102fe565b3480156101da57600080fd5b506101736103a1565b6100cd600160a060020a0360043516610221565b34801561020357600080fd5b5061010d6103b0565b34801561021857600080fd5b50610173610412565b34600061022e8383610421565b6102378261044e565b60035490915061024d908363ffffffff61047216565b60035561025a838261048c565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36102ac838361044a565b6102b4610496565b6102be838361044a565b505050565b600654421190565b60085481565b60025481565b60035481565b60065481565b600154600160a060020a031681565b60075481565b60055481565b6000805460048054604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03928316938101939093523060248401525192169163dd62ed3e9160448082019260209290919082900301818787803b15801561037057600080fd5b505af1158015610384573d6000803e3d6000fd5b505050506040513d602081101561039a57600080fd5b5051905090565b600454600160a060020a031681565b60008060006103ca600554426104d290919063ffffffff16565b91506103e36005546006546104d290919063ffffffff16565b90506103f681600263ffffffff6104e616565b82101561040757600754925061040d565b60085492505b505090565b600054600160a060020a031681565b600554421015801561043557506006544211155b151561044057600080fd5b61044a82826104fd565b5050565b6000806104596103b0565b905061046b818463ffffffff61051e16565b9392505050565b60008282018381101561048157fe5b8091505b5092915050565b61044a8282610549565b600154604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156104cf573d6000803e3d6000fd5b50565b600080838311156104df57fe5b5050900390565b60008082848115156104f457fe5b04949350505050565b600160a060020a038216151561051257600080fd5b80151561044a57600080fd5b6000808315156105315760009150610485565b5082820282848281151561054157fe5b041461048157fe5b60045460005461044a91600160a060020a039182169116848463ffffffff61056d16565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b1580156105e157600080fd5b505af11580156105f5573d6000803e3d6000fd5b505050506040513d602081101561060b57600080fd5b5051151561061857600080fd5b505050505600a165627a7a72305820eb53ea9191a801f22788b917715a6c7ac2145cabc5f6c12765964ef0185c57860029000000000000000000000000000000000000000000000000000000005b9cf440000000000000000000000000000000000000000000000000000000005bed5fc0000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000008d0f9b003566ed514de5bc9cf5b97d70e502fdac0000000000000000000000002c4f70babf05e0e467641809a205d869aefb2fb90000000000000000000000004026079d2d1d6d44b256a0bdb87f06bb341e1976

Deployed Bytecode

0x6080604052600436106100c45763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631515bc2b81146100cf57806321106109146100f85780632c4e722e1461011f5780634042b66f146101345780634b6753bc14610149578063521eb2731461015e5780639e51051f1461018f578063b7a8807c146101a4578063bf583903146101b9578063bff99c6c146101ce578063ec8ac4d8146101e3578063f7fb07b0146101f7578063fc0c546a1461020c575b6100cd33610221565b005b3480156100db57600080fd5b506100e46102c3565b604080519115158252519081900360200190f35b34801561010457600080fd5b5061010d6102cb565b60408051918252519081900360200190f35b34801561012b57600080fd5b5061010d6102d1565b34801561014057600080fd5b5061010d6102d7565b34801561015557600080fd5b5061010d6102dd565b34801561016a57600080fd5b506101736102e3565b60408051600160a060020a039092168252519081900360200190f35b34801561019b57600080fd5b5061010d6102f2565b3480156101b057600080fd5b5061010d6102f8565b3480156101c557600080fd5b5061010d6102fe565b3480156101da57600080fd5b506101736103a1565b6100cd600160a060020a0360043516610221565b34801561020357600080fd5b5061010d6103b0565b34801561021857600080fd5b50610173610412565b34600061022e8383610421565b6102378261044e565b60035490915061024d908363ffffffff61047216565b60035561025a838261048c565b60408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36102ac838361044a565b6102b4610496565b6102be838361044a565b505050565b600654421190565b60085481565b60025481565b60035481565b60065481565b600154600160a060020a031681565b60075481565b60055481565b6000805460048054604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a03928316938101939093523060248401525192169163dd62ed3e9160448082019260209290919082900301818787803b15801561037057600080fd5b505af1158015610384573d6000803e3d6000fd5b505050506040513d602081101561039a57600080fd5b5051905090565b600454600160a060020a031681565b60008060006103ca600554426104d290919063ffffffff16565b91506103e36005546006546104d290919063ffffffff16565b90506103f681600263ffffffff6104e616565b82101561040757600754925061040d565b60085492505b505090565b600054600160a060020a031681565b600554421015801561043557506006544211155b151561044057600080fd5b61044a82826104fd565b5050565b6000806104596103b0565b905061046b818463ffffffff61051e16565b9392505050565b60008282018381101561048157fe5b8091505b5092915050565b61044a8282610549565b600154604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156104cf573d6000803e3d6000fd5b50565b600080838311156104df57fe5b5050900390565b60008082848115156104f457fe5b04949350505050565b600160a060020a038216151561051257600080fd5b80151561044a57600080fd5b6000808315156105315760009150610485565b5082820282848281151561054157fe5b041461048157fe5b60045460005461044a91600160a060020a039182169116848463ffffffff61056d16565b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152600160a060020a0385811660048301528481166024830152604482018490529151918616916323b872dd916064808201926020929091908290030181600087803b1580156105e157600080fd5b505af11580156105f5573d6000803e3d6000fd5b505050506040513d602081101561060b57600080fd5b5051151561061857600080fd5b505050505600a165627a7a72305820eb53ea9191a801f22788b917715a6c7ac2145cabc5f6c12765964ef0185c57860029

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

000000000000000000000000000000000000000000000000000000005b9cf440000000000000000000000000000000000000000000000000000000005bed5fc0000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000000c80000000000000000000000008d0f9b003566ed514de5bc9cf5b97d70e502fdac0000000000000000000000002c4f70babf05e0e467641809a205d869aefb2fb90000000000000000000000004026079d2d1d6d44b256a0bdb87f06bb341e1976

-----Decoded View---------------
Arg [0] : _openingTime (uint256): 1537012800
Arg [1] : _closingTime (uint256): 1542283200
Arg [2] : _rate (uint256): 400
Arg [3] : _ratePublic (uint256): 200
Arg [4] : _wallet (address): 0x8D0f9b003566eD514De5BC9cf5b97d70e502fDac
Arg [5] : _token (address): 0x2C4f70baBF05e0e467641809a205d869aEFB2FB9
Arg [6] : _tokenHolder (address): 0x4026079d2D1d6d44B256A0BDb87f06bB341e1976

-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 000000000000000000000000000000000000000000000000000000005b9cf440
Arg [1] : 000000000000000000000000000000000000000000000000000000005bed5fc0
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000190
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [4] : 0000000000000000000000008d0f9b003566ed514de5bc9cf5b97d70e502fdac
Arg [5] : 0000000000000000000000002c4f70babf05e0e467641809a205d869aefb2fb9
Arg [6] : 0000000000000000000000004026079d2d1d6d44b256a0bdb87f06bb341e1976


Swarm Source

bzzr://eb53ea9191a801f22788b917715a6c7ac2145cabc5f6c12765964ef0185c5786

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.