ETH Price: $2,578.36 (+2.66%)

Token

Saiex Token (SAIEX)
 

Overview

Max Total Supply

100,000,000 SAIEX

Holders

437

Market

Onchain Market Cap

$0.00

Circulating Supply Market Cap

-

Other Info

Token Contract (WITH 18 Decimals)

Filtered by Token Holder
burhank61.eth
Balance
2.57 SAIEX

Value
$0.00
0x7681ed0bbbcd36b55d98d911f97ccc0ad2eb2174
Loading...
Loading
Loading...
Loading
Loading...
Loading

Click here to update the token information / general information
# Exchange Pair Price  24H Volume % Volume

Contract Source Code Verified (Exact Match)

Contract Name:
SaiexToken

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-11-21
*/

pragma solidity ^0.4.24;

// File: node_modules/openzeppelin-solidity/contracts/math/SafeMath.sol

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

    c = _a * _b;
    assert(c / _a == _b);
    return c;
  }

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

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

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

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol

/**
 * @title ERC20Basic
 * @dev Simpler version of ERC20 interface
 * See https://github.com/ethereum/EIPs/issues/179
 */
contract ERC20Basic {
  function totalSupply() public view returns (uint256);
  function balanceOf(address _who) public view returns (uint256);
  function transfer(address _to, uint256 _value) public returns (bool);
  event Transfer(address indexed from, address indexed to, uint256 value);
}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/ERC20.sol

/**
 * @title ERC20 interface
 * @dev see https://github.com/ethereum/EIPs/issues/20
 */
contract ERC20 is ERC20Basic {
  function allowance(address _owner, address _spender)
    public view returns (uint256);

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

  function approve(address _spender, uint256 _value) public returns (bool);
  event Approval(
    address indexed owner,
    address indexed spender,
    uint256 value
  );
}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol

/**
 * @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(
    ERC20Basic _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));
  }
}

// File: node_modules/openzeppelin-solidity/contracts/crowdsale/Crowdsale.sol

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

// File: node_modules/openzeppelin-solidity/contracts/crowdsale/validation/TimedCrowdsale.sol

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

}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol

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

  mapping(address => uint256) internal balances;

  uint256 internal totalSupply_;

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

  /**
  * @dev Transfer token for a specified address
  * @param _to The address to transfer to.
  * @param _value The amount to be transferred.
  */
  function transfer(address _to, uint256 _value) 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 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];
  }

}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol

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

  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 {
    _burn(msg.sender, _value);
  }

  function _burn(address _who, uint256 _value) internal {
    require(_value <= balances[_who]);
    // no need to require value <= totalSupply, since that would imply the
    // sender's balance is greater than the totalSupply, which *should* be an assertion failure

    balances[_who] = balances[_who].sub(_value);
    totalSupply_ = totalSupply_.sub(_value);
    emit Burn(_who, _value);
    emit Transfer(_who, address(0), _value);
  }
}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol

/**
 * @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, BasicToken {

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


  /**
   * @dev Transfer tokens from one address to another
   * @param _from address The address which you want to send tokens from
   * @param _to address The address which you want to transfer to
   * @param _value uint256 the amount of tokens to be transferred
   */
  function transferFrom(
    address _from,
    address _to,
    uint256 _value
  )
    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 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 Function to check the amount of tokens that an owner allowed to a spender.
   * @param _owner address The address which owns the funds.
   * @param _spender address The address which will spend the funds.
   * @return A uint256 specifying the amount of tokens still available for the spender.
   */
  function allowance(
    address _owner,
    address _spender
   )
    public
    view
    returns (uint256)
  {
    return allowed[_owner][_spender];
  }

  /**
   * @dev Increase the amount of tokens that an owner allowed to a spender.
   * approve should be called when allowed[_spender] == 0. To increment
   * allowed value is better to use this function to avoid 2 calls (and wait until
   * the first transaction is mined)
   * From MonolithDAO Token.sol
   * @param _spender The address which will spend the funds.
   * @param _addedValue The amount of tokens to increase the allowance by.
   */
  function increaseApproval(
    address _spender,
    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;
  }

}

// File: node_modules/openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol

/**
 * @title Standard Burnable Token
 * @dev Adds burnFrom method to ERC20 implementations
 */
contract StandardBurnableToken is BurnableToken, StandardToken {

  /**
   * @dev Burns a specific amount of tokens from the target address and decrements allowance
   * @param _from address The address which you want to send tokens from
   * @param _value uint256 The amount of token to be burned
   */
  function burnFrom(address _from, uint256 _value) public {
    require(_value <= allowed[_from][msg.sender]);
    // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
    // this function needs to emit an event with the updated approval.
    allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
    _burn(_from, _value);
  }
}

// File: node_modules/openzeppelin-solidity/contracts/ownership/Ownable.sol

/**
 * @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 OwnershipRenounced(address indexed previousOwner);
  event OwnershipTransferred(
    address indexed previousOwner,
    address indexed newOwner
  );


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

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

  /**
   * @dev Allows the current owner to relinquish control of the contract.
   * @notice Renouncing to ownership will leave the contract without an owner.
   * It will not be possible to call the functions with the `onlyOwner`
   * modifier anymore.
   */
  function renounceOwnership() public onlyOwner {
    emit OwnershipRenounced(owner);
    owner = address(0);
  }

  /**
   * @dev Allows the current owner to transfer control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function transferOwnership(address _newOwner) public onlyOwner {
    _transferOwnership(_newOwner);
  }

  /**
   * @dev Transfers control of the contract to a newOwner.
   * @param _newOwner The address to transfer ownership to.
   */
  function _transferOwnership(address _newOwner) internal {
    require(_newOwner != address(0));
    emit OwnershipTransferred(owner, _newOwner);
    owner = _newOwner;
  }
}

// File: node_modules/openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol

/**
 * @title Contracts that should be able to recover tokens
 * @author SylTi
 * @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
 * This will prevent any accidental loss of tokens.
 */
contract CanReclaimToken is Ownable {
  using SafeERC20 for ERC20Basic;

  /**
   * @dev Reclaim all ERC20Basic compatible tokens
   * @param _token ERC20Basic The address of the token contract
   */
  function reclaimToken(ERC20Basic _token) external onlyOwner {
    uint256 balance = _token.balanceOf(this);
    _token.safeTransfer(owner, balance);
  }

}

// File: contracts/SaiexSale.sol

contract SaiexToken is StandardBurnableToken, Ownable {

  string public constant name = "Saiex Token";
  string public constant symbol = "SAIEX";
  uint8 public constant decimals = 18;

  constructor(uint _totalSupply, uint _crowdsaleSupply, uint _fundSupply, address _fundWallet) public {
    totalSupply_ = _totalSupply;

    // Allocate fixed supply to token Creator
    balances[msg.sender] = _crowdsaleSupply;
    emit Transfer(address(0), msg.sender, _crowdsaleSupply);

    // Allocate fixed supply to main Wallet
    balances[_fundWallet] = _fundSupply;
    emit Transfer(address(0), _fundWallet, _fundSupply);
  }
}


contract SaiexCrowdsale is TimedCrowdsale, CanReclaimToken {

  constructor(uint256 _openingTime, uint256 _closingTime, uint256 _rate, address _fundWallet, StandardBurnableToken _token, uint[] _timeBonus, uint[] _amountBonus) public
    Crowdsale(_rate, _fundWallet, _token)
    TimedCrowdsale(_openingTime, _closingTime)
  {
    // Setup time and amount bonus
    TimeBonusPricing(_timeBonus);
    AmountBonusPricing(_amountBonus);
  }

  // Override to extend the way in which ether is converted to tokens.
  function _getTokenAmount(uint256 _weiAmount)
    internal view returns (uint256)
  {
    uint256 currentRate = getCurrentRate(_weiAmount);
    return currentRate.mul(_weiAmount);
  }

  // Returns the rate of tokens per wei depending on time and amount
  function getCurrentRate(uint256 _weiAmount) public view returns (uint256) {
    uint256 currentRate;
    currentRate = rate;

    // Apply time bonus
    uint256 timeBonusRate;
    timeBonusRate = getCurrentTimeBonusRate();
    currentRate = currentRate.mul(timeBonusRate).div(100);

    // Apply amount bonus
    uint256 amountBonusRate;
    amountBonusRate = getCurrentAmountBonusRate(_weiAmount);
    currentRate = currentRate.mul(amountBonusRate).div(100);

    return currentRate;
  }


  struct Bonus {
    // Timestamp/Amount for bonus
    uint timeOrAmount;
    // Bonus rate multiplier, for example rate=120 means 20% Bonus
    uint rateMultiplier;
  }

  // Store bonuses in a fixed array, so that it can be seen in a blockchain explorer
  uint public constant MAX_BONUS = 10;
  Bonus[10] public timeBonus;
  Bonus[10] public amountBonus;

  // How many active time/amount Bonus we have
  uint public timeBonusCount;
  uint public amountBonusCount;

  // Get the current time bonus rateMultiplier
  function getCurrentTimeBonusRate() private constant returns (uint) {
    uint i;
    for(i=0; i<timeBonus.length; i++) {
      if(block.timestamp < timeBonus[i].timeOrAmount) {
        return timeBonus[i].rateMultiplier;
      }
    }
    return 100;
  }

  // Get the current amount bonus rateMultiplier
  // @param _weiAmount uint256 invested amount
  function getCurrentAmountBonusRate(uint256 _weiAmount) private constant returns (uint) {
    uint i;
    for(i=0; i<amountBonus.length; i++) {
      if(_weiAmount.mul(rate) >= amountBonus[i].timeOrAmount) {
        return amountBonus[i].rateMultiplier;
      }
    }
    return 100;
  }

  // @dev Construction, creating a list of time-based bonuses
  // @param _bonuses uint[] bonuses Pairs of (timeOrAmount, rateMultiplier)
  function TimeBonusPricing(uint[] _bonuses) internal {
    // Check array length, we need tuples
    require(!(_bonuses.length % 2 == 1 || _bonuses.length >= MAX_BONUS*2));
    timeBonusCount = _bonuses.length / 2;
    uint lastTimeOrAmount = 0;

    for(uint i=0; i<_bonuses.length/2; i++) {
      timeBonus[i].timeOrAmount  = _bonuses[i*2];
      timeBonus[i].rateMultiplier = _bonuses[i*2+1];

      // Next timestamp should be either 0 or later than previous one
      require(!((lastTimeOrAmount != 0) && (timeBonus[i].rateMultiplier != 100) && (timeBonus[i].timeOrAmount <= lastTimeOrAmount)));
      lastTimeOrAmount = timeBonus[i].timeOrAmount;
    }

    // Last rateMultiplier should be 100, indicating end of bonus
    require(timeBonus[timeBonusCount-1].rateMultiplier == 100);
  }

  // @dev Construction, creating a list of amount-based bonuses
  // @param _bonuses uint[] bonuses Pairs of (timeOrAmount, rateMultiplier)
  function AmountBonusPricing(uint[] _bonuses) internal {
    // Check array length, we need tuples
    require(!(_bonuses.length % 2 == 1 || _bonuses.length >= MAX_BONUS*2));
    amountBonusCount = _bonuses.length / 2;
    uint lastTimeOrAmount = 0;
    for(uint i=0; i<_bonuses.length/2; i++) {
      amountBonus[i].timeOrAmount  = _bonuses[i*2];
      amountBonus[i].rateMultiplier = _bonuses[i*2+1];

      // Next amount should be 0 or smaller
      require(!((lastTimeOrAmount != 0) && (amountBonus[i].timeOrAmount >= lastTimeOrAmount)));
      lastTimeOrAmount = amountBonus[i].timeOrAmount;
    }

    // Last rateMultiplier should be 100, indicating end of bonus
    require(amountBonus[amountBonusCount-1].rateMultiplier == 100);
  }

  // @dev allow Contract owner to change bonuses
  // @param _timeBonus uint[] bonuses Pairs of (timestamp, rateMultiplier)
  // @param _amountBonus uint[] bonuses Pairs of (wei amount, rateMultiplier)
  function changeBonuses(uint[] _timeBonus, uint[] _amountBonus) external {
    require(msg.sender == owner);
    TimeBonusPricing(_timeBonus);
    AmountBonusPricing(_amountBonus);
  }

  // @dev allow Contract owner to change start/stop time
  // @param _openingTime uint256  opening time
  // @param _closingTime uint256  closing time
  function changeOpeningClosingTime(uint256 _openingTime, uint256 _closingTime) external {
    require(msg.sender == owner);
    openingTime = _openingTime;
    closingTime = _closingTime;
  }

	// @dev allow Contract owner to change rate
  // @param _rate uint rate
  function changeRate(uint _rate) external {
    require(msg.sender == owner);
    rate = _rate;
  }
}

Contract Security Audit

Contract ABI

[{"constant":true,"inputs":[],"name":"name","outputs":[{"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":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burn","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_spender","type":"address"},{"name":"_subtractedValue","type":"uint256"}],"name":"decreaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_value","type":"uint256"}],"name":"burnFrom","outputs":[],"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":"","type":"string"}],"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":"_spender","type":"address"},{"name":"_addedValue","type":"uint256"}],"name":"increaseApproval","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"},{"name":"_spender","type":"address"}],"name":"allowance","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_totalSupply","type":"uint256"},{"name":"_crowdsaleSupply","type":"uint256"},{"name":"_fundSupply","type":"uint256"},{"name":"_fundWallet","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"}],"name":"OwnershipRenounced","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":"burner","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Burn","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"}]

608060405234801561001057600080fd5b50604051608080610c9b83398101604081815282516020808501518386015160609096015160038054600160a060020a03191633908117909155600185905560008181528085528681208490558388529551949792969295919490939192600080516020610c7b83398151915292908290030190a3600160a060020a03811660008181526020818152604080832086905580518681529051600080516020610c7b833981519152929181900390910190a350505050610ba7806100d46000396000f3006080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac57806323b872dd146101d3578063313ce567146101fd57806342966c6814610228578063661884631461024257806370a0823114610266578063715018a61461028757806379cc67901461029c5780638da5cb5b146102c057806395d89b41146102f1578063a9059cbb14610306578063d73dd6231461032a578063dd62ed3e1461034e578063f2fde38b14610375575b600080fd5b3480156100f657600080fd5b506100ff610396565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103cd565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c1610433565b60408051918252519081900360200190f35b3480156101df57600080fd5b50610198600160a060020a0360043581169060243516604435610439565b34801561020957600080fd5b506102126105ae565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b506102406004356105b3565b005b34801561024e57600080fd5b50610198600160a060020a03600435166024356105c0565b34801561027257600080fd5b506101c1600160a060020a03600435166106af565b34801561029357600080fd5b506102406106ca565b3480156102a857600080fd5b50610240600160a060020a0360043516602435610738565b3480156102cc57600080fd5b506102d56107ce565b60408051600160a060020a039092168252519081900360200190f35b3480156102fd57600080fd5b506100ff6107dd565b34801561031257600080fd5b50610198600160a060020a0360043516602435610814565b34801561033657600080fd5b50610198600160a060020a03600435166024356108f3565b34801561035a57600080fd5b506101c1600160a060020a036004358116906024351661098c565b34801561038157600080fd5b50610240600160a060020a03600435166109b7565b60408051808201909152600b81527f536169657820546f6b656e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a03831660009081526020819052604081205482111561045e57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561048e57600080fd5b600160a060020a03831615156104a357600080fd5b600160a060020a0384166000908152602081905260409020546104cc908363ffffffff6109d716565b600160a060020a038086166000908152602081905260408082209390935590851681522054610501908363ffffffff6109e916565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610543908363ffffffff6109d716565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b6105bd33826109fc565b50565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061061457336000908152600260209081526040808320600160a060020a0388168452909152812055610649565b610624818463ffffffff6109d716565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146106e157600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600160a060020a038216600090815260026020908152604080832033845290915290205481111561076857600080fd5b600160a060020a038216600090815260026020908152604080832033845290915290205461079c908263ffffffff6109d716565b600160a060020a03831660009081526002602090815260408083203384529091529020556107ca82826109fc565b5050565b600354600160a060020a031681565b60408051808201909152600581527f5341494558000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561083057600080fd5b600160a060020a038316151561084557600080fd5b33600090815260208190526040902054610865908363ffffffff6109d716565b3360009081526020819052604080822092909255600160a060020a03851681522054610897908363ffffffff6109e916565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610927908363ffffffff6109e916565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146109ce57600080fd5b6105bd81610afd565b6000828211156109e357fe5b50900390565b818101828110156109f657fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610a2157600080fd5b600160a060020a038216600090815260208190526040902054610a4a908263ffffffff6109d716565b600160a060020a038316600090815260208190526040902055600154610a76908263ffffffff6109d716565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600160a060020a0381161515610b1257600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582051df45db7b471edb2fbad030cd6d90da8729cf8109234e82d22f4e2ef81db62e0029ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef00000000000000000000000000000000000000000052b7d2dcc80cd2e4000000000000000000000000000000000000000000000000295be96e64066972000000000000000000000000000000000000000000000000295be96e640669720000000000000000000000000000002245384869c089f68c4167c0dc2e99ed0472400f

Deployed Bytecode

0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101ac57806323b872dd146101d3578063313ce567146101fd57806342966c6814610228578063661884631461024257806370a0823114610266578063715018a61461028757806379cc67901461029c5780638da5cb5b146102c057806395d89b41146102f1578063a9059cbb14610306578063d73dd6231461032a578063dd62ed3e1461034e578063f2fde38b14610375575b600080fd5b3480156100f657600080fd5b506100ff610396565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610139578181015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018057600080fd5b50610198600160a060020a03600435166024356103cd565b604080519115158252519081900360200190f35b3480156101b857600080fd5b506101c1610433565b60408051918252519081900360200190f35b3480156101df57600080fd5b50610198600160a060020a0360043581169060243516604435610439565b34801561020957600080fd5b506102126105ae565b6040805160ff9092168252519081900360200190f35b34801561023457600080fd5b506102406004356105b3565b005b34801561024e57600080fd5b50610198600160a060020a03600435166024356105c0565b34801561027257600080fd5b506101c1600160a060020a03600435166106af565b34801561029357600080fd5b506102406106ca565b3480156102a857600080fd5b50610240600160a060020a0360043516602435610738565b3480156102cc57600080fd5b506102d56107ce565b60408051600160a060020a039092168252519081900360200190f35b3480156102fd57600080fd5b506100ff6107dd565b34801561031257600080fd5b50610198600160a060020a0360043516602435610814565b34801561033657600080fd5b50610198600160a060020a03600435166024356108f3565b34801561035a57600080fd5b506101c1600160a060020a036004358116906024351661098c565b34801561038157600080fd5b50610240600160a060020a03600435166109b7565b60408051808201909152600b81527f536169657820546f6b656e000000000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a03831660009081526020819052604081205482111561045e57600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561048e57600080fd5b600160a060020a03831615156104a357600080fd5b600160a060020a0384166000908152602081905260409020546104cc908363ffffffff6109d716565b600160a060020a038086166000908152602081905260408082209390935590851681522054610501908363ffffffff6109e916565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610543908363ffffffff6109d716565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b601281565b6105bd33826109fc565b50565b336000908152600260209081526040808320600160a060020a038616845290915281205480831061061457336000908152600260209081526040808320600160a060020a0388168452909152812055610649565b610624818463ffffffff6109d716565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a031633146106e157600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600160a060020a038216600090815260026020908152604080832033845290915290205481111561076857600080fd5b600160a060020a038216600090815260026020908152604080832033845290915290205461079c908263ffffffff6109d716565b600160a060020a03831660009081526002602090815260408083203384529091529020556107ca82826109fc565b5050565b600354600160a060020a031681565b60408051808201909152600581527f5341494558000000000000000000000000000000000000000000000000000000602082015281565b3360009081526020819052604081205482111561083057600080fd5b600160a060020a038316151561084557600080fd5b33600090815260208190526040902054610865908363ffffffff6109d716565b3360009081526020819052604080822092909255600160a060020a03851681522054610897908363ffffffff6109e916565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610927908363ffffffff6109e916565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146109ce57600080fd5b6105bd81610afd565b6000828211156109e357fe5b50900390565b818101828110156109f657fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610a2157600080fd5b600160a060020a038216600090815260208190526040902054610a4a908263ffffffff6109d716565b600160a060020a038316600090815260208190526040902055600154610a76908263ffffffff6109d716565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b600160a060020a0381161515610b1257600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a7230582051df45db7b471edb2fbad030cd6d90da8729cf8109234e82d22f4e2ef81db62e0029

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

00000000000000000000000000000000000000000052b7d2dcc80cd2e4000000000000000000000000000000000000000000000000295be96e64066972000000000000000000000000000000000000000000000000295be96e640669720000000000000000000000000000002245384869c089f68c4167c0dc2e99ed0472400f

-----Decoded View---------------
Arg [0] : _totalSupply (uint256): 100000000000000000000000000
Arg [1] : _crowdsaleSupply (uint256): 50000000000000000000000000
Arg [2] : _fundSupply (uint256): 50000000000000000000000000
Arg [3] : _fundWallet (address): 0x2245384869c089F68c4167c0Dc2e99ed0472400F

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000052b7d2dcc80cd2e4000000
Arg [1] : 000000000000000000000000000000000000000000295be96e64066972000000
Arg [2] : 000000000000000000000000000000000000000000295be96e64066972000000
Arg [3] : 0000000000000000000000002245384869c089f68c4167c0dc2e99ed0472400f


Swarm Source

bzzr://51df45db7b471edb2fbad030cd6d90da8729cf8109234e82d22f4e2ef81db62e
Loading...
Loading
Loading...
Loading
[ Download: CSV Export  ]
[ Download: CSV Export  ]

A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.