Contract Overview
Balance: 0 Ether
Ether Value: $0
Transactions: 14 txns
Token Tracker: ZCNY Token (ZCNY)
 Latest 14 txns

TxHash Age From To Value [TxFee]
0x916364a351bbb50a04115ab9f3caea246442d534df1767aafdbc03886bfe80083 days 15 hrs ago0x572ecf84342d5c272f30e2287c3f31cdf3200acf  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.00041514
0xbbb5ba69b16121a714946f64fe39a04d9ac30a428ac27730b77a42ea2abceff26 days 17 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.00011220924
0x989e4dfb833783a8e7c6eaeb30714dcfa128b0990130561a41241bc34c6dec1a6 days 17 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000166056
0xe60b7ed0410e7e661c75d009836fcbabdfb4d98ad94269849cea28f81ecbd9706 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000166056
0x689f50f3be61043683efd1ead6c866940831f17b21012ee224ac2974bba9923e6 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000167124
0x6641eca2ccdd7ef2571b5fbf1a61dc93844cfa994a4cd6ab1bb1c968f43896416 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000166056
0xd8059b9d0d99a0d85d7e55864d63e5232cc06d7aec3be2fb4602a1fceceb34326 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.00050502
0xe00c2252f7e02ef6d5a91515fdec12318bece8cbd078447aad921d481e780ded6 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000354
0xe34c094a312cb2b89cc55c39154671701df688ee0ede523d10b642dbfe0dcdb86 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000134226
0xb0f6cc5062871895b1ed30e8bbcbbe2666f0d67f2ec6c5c723fb857b997f98306 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000968776151
0x167b58142b681c26417cd749906ad28e146b2a61fbbd4eebdb3950a3b38894736 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000354
0x551c2e9a8261c946137bc87c560a30b0190be1cd9a83bf13b95cf7b89d382a916 days 18 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.0001629108
0x5ebde355032848986d33f6451c9fd5c76ee81b7a372e85a79a5214008ce129076 days 19 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN   0xc9475b6326bc9a5c4cf323927ae9818491cc528d0 Ether0.000393306
0xd4f440aee6fb2cb9ea1c45819d94b5b6691e7db4f67dcdad5b4ad018235d3bd87 days 4 hrs ago0xc9ad62f26aa7f79c095281cab10446ec9bc7a5e5  IN    Contract Creation0 Ether0.009698412
[ Download CSV Export  ] 
 Internal Transactions as a result of Contract Execution
View All
ParentTxHash Block Age From To Value
Contract Source Code Verified (Exact Match)
Contract Name: ZCNYToken
Compiler Text: v0.4.25+commit.59dbf8f1
Optimization Enabled: Yes
Runs (Optimiser):  200



  Contract Source Code   Find Similiar Contracts

/**
 * ZCNY Token Smart Contract: EIP-20 compatible token smart contract that
 * manages ZCNY tokens.
 */

/*
 * Safe Math Smart Contract.
 */
pragma solidity ^0.4.20;

/**
 * Provides methods to safely add, subtract and multiply uint256 numbers.
 */
contract SafeMath {
  uint256 constant private MAX_UINT256 =
    0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

  /**
   * Add two uint256 values, throw in case of overflow.
   *
   * @param x first value to add
   * @param y second value to add
   * @return x + y
   */
  function safeAdd (uint256 x, uint256 y)
  pure internal
  returns (uint256 z) {
    assert (x <= MAX_UINT256 - y);
    return x + y;
  }

  /**
   * Subtract one uint256 value from another, throw in case of underflow.
   *
   * @param x value to subtract from
   * @param y value to subtract
   * @return x - y
   */
  function safeSub (uint256 x, uint256 y)
  pure internal
  returns (uint256 z) {
    assert (x >= y);
    return x - y;
  }

  /**
   * Multiply two uint256 values, throw in case of overflow.
   *
   * @param x first value to multiply
   * @param y second value to multiply
   * @return x * y
   */
  function safeMul (uint256 x, uint256 y)
  pure internal
  returns (uint256 z) {
    if (y == 0) return 0; // Prevent division by zero at the next line
    assert (x <= MAX_UINT256 / y);
    return x * y;
  }
}

contract Token {
  /**
   * Get total number of tokens in circulation.
   *
   * @return total number of tokens in circulation
   */
  function totalSupply () public view returns (uint256 supply);

  /**
   * Get number of tokens currently belonging to given owner.
   *
   * @param _owner address to get number of tokens currently belonging to the
   *        owner of
   * @return number of tokens currently belonging to the owner of given address
   */
  function balanceOf (address _owner) public view returns (uint256 balance);

  /**
   * Transfer given number of tokens from message sender to given recipient.
   *
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer to the owner of given address
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transfer (address _to, uint256 _value)
  public payable returns (bool success);

  /**
   * Transfer given number of tokens from given owner to given recipient.
   *
   * @param _from address to transfer tokens from the owner of
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer from given owner to given
   *        recipient
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transferFrom (address _from, address _to, uint256 _value)
  public payable returns (bool success);

  /**
   * Allow given spender to transfer given number of tokens from message sender.
   *
   * @param _spender address to allow the owner of to transfer tokens from
   *        message sender
   * @param _value number of tokens to allow to transfer
   * @return true if token transfer was successfully approved, false otherwise
   */
  function approve (address _spender, uint256 _value)
  public payable returns (bool success);

  /**
   * Tell how many tokens given spender is currently allowed to transfer from
   * given owner.
   *
   * @param _owner address to get number of tokens allowed to be transferred
   *        from the owner of
   * @param _spender address to get number of tokens allowed to be transferred
   *        by the owner of
   * @return number of tokens given spender is currently allowed to transfer
   *         from given owner
   */
  function allowance (address _owner, address _spender)
  public view returns (uint256 remaining);

  /**
   * Logged when tokens were transferred from one owner to another.
   *
   * @param _from address of the owner, tokens were transferred from
   * @param _to address of the owner, tokens were transferred to
   * @param _value number of tokens transferred
   */
  event Transfer (address indexed _from, address indexed _to, uint256 _value);

  /**
   * Logged when owner approved his tokens to be transferred by some spender.
   *
   * @param _owner owner who approved his tokens to be transferred
   * @param _spender spender who were allowed to transfer the tokens belonging
   *        to the owner
   * @param _value number of tokens belonging to the owner, approved to be
   *        transferred by the spender
   */
  event Approval (
    address indexed _owner, address indexed _spender, uint256 _value);
}

contract AbstractToken is Token, SafeMath {
  /**
   * Create new Abstract Token contract.
   */
  function AbstractToken () public {
    // Do nothing
  }

  /**
   * Get number of tokens currently belonging to given owner.
   *
   * @param _owner address to get number of tokens currently belonging to the
   *        owner of
   * @return number of tokens currently belonging to the owner of given address
   */
  function balanceOf (address _owner) public view returns (uint256 balance) {
    return accounts [_owner];
  }

  /**
   * Transfer given number of tokens from message sender to given recipient.
   *
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer to the owner of given address
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transfer (address _to, uint256 _value)
  public payable returns (bool success) {
    uint256 fromBalance = accounts [msg.sender];
    if (fromBalance < _value) return false;
    if (_value > 0 && msg.sender != _to) {
      accounts [msg.sender] = safeSub (fromBalance, _value);
      accounts [_to] = safeAdd (accounts [_to], _value);
    }
    Transfer (msg.sender, _to, _value);
    return true;
  }

  /**
   * Transfer given number of tokens from given owner to given recipient.
   *
   * @param _from address to transfer tokens from the owner of
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer from given owner to given
   *        recipient
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transferFrom (address _from, address _to, uint256 _value)
  public payable returns (bool success) {
    uint256 spenderAllowance = allowances [_from][msg.sender];
    if (spenderAllowance < _value) return false;
    uint256 fromBalance = accounts [_from];
    if (fromBalance < _value) return false;

    allowances [_from][msg.sender] =
      safeSub (spenderAllowance, _value);

    if (_value > 0 && _from != _to) {
      accounts [_from] = safeSub (fromBalance, _value);
      accounts [_to] = safeAdd (accounts [_to], _value);
    }
    Transfer (_from, _to, _value);
    return true;
  }

  /**
   * Allow given spender to transfer given number of tokens from message sender.
   *
   * @param _spender address to allow the owner of to transfer tokens from
   *        message sender
   * @param _value number of tokens to allow to transfer
   * @return true if token transfer was successfully approved, false otherwise
   */
  function approve (address _spender, uint256 _value)
  public payable returns (bool success) {
    allowances [msg.sender][_spender] = _value;
    Approval (msg.sender, _spender, _value);

    return true;
  }

  /**
   * Tell how many tokens given spender is currently allowed to transfer from
   * given owner.
   *
   * @param _owner address to get number of tokens allowed to be transferred
   *        from the owner of
   * @param _spender address to get number of tokens allowed to be transferred
   *        by the owner of
   * @return number of tokens given spender is currently allowed to transfer
   *         from given owner
   */
  function allowance (address _owner, address _spender)
  public view returns (uint256 remaining) {
    return allowances [_owner][_spender];
  }

  /**
   * Mapping from addresses of token holders to the numbers of tokens belonging
   * to these token holders.
   */
  mapping (address => uint256) internal accounts;

  /**
   * Mapping from addresses of token holders to the mapping of addresses of
   * spenders to the allowances set by these token holders to these spenders.
   */
  mapping (address => mapping (address => uint256)) internal allowances;
}

contract ZCNYToken is AbstractToken {
  /**
   * Fee denominator (0.001%).
   */
  uint256 constant internal FEE_DENOMINATOR = 100000;

  /**
   * Maximum fee numerator (100%).
   */
  uint256 constant internal MAX_FEE_NUMERATOR = FEE_DENOMINATOR;

  /**
   * Minimum fee numerator (0%).
   */
  uint256 constant internal MIN_FEE_NUMERATIOR = 0;

  /**
   * Maximum allowed number of tokens in circulation.
   */
  uint256 constant internal MAX_TOKENS_COUNT =
    0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff /
    MAX_FEE_NUMERATOR;

  /**
   * Default transfer fee.
   */
  uint256 constant internal DEFAULT_FEE = 5e2;

  /**
   * Address flag that marks black listed addresses.
   */
  uint256 constant internal BLACK_LIST_FLAG = 0x01;

  /**
   * Address flag that marks zero fee addresses.
   */
  uint256 constant internal ZERO_FEE_FLAG = 0x02;

  modifier delegatable {
    if (delegate == address (0)) {
      require (msg.value == 0); // Non payable if not delegated
      _;
    } else {
      assembly {
        // Save owner
        let oldOwner := sload (owner_slot)

        // Save delegate
        let oldDelegate := sload (delegate_slot)

        // Solidity stores address of the beginning of free memory at 0x40
        let buffer := mload (0x40)

        // Copy message call data into buffer
        calldatacopy (buffer, 0, calldatasize)

        // Lets call our delegate
        let result := delegatecall (gas, oldDelegate, buffer, calldatasize, buffer, 0)

        // Check, whether owner was changed
        switch eq (oldOwner, sload (owner_slot))
        case 1 {} // Owner was not changed, fine
        default {revert (0, 0) } // Owner was changed, revert!

        // Check, whether delegate was changed
        switch eq (oldDelegate, sload (delegate_slot))
        case 1 {} // Delegate was not changed, fine
        default {revert (0, 0) } // Delegate was changed, revert!

        // Copy returned value into buffer
        returndatacopy (buffer, 0, returndatasize)

        // Check call status
        switch result
        case 0 { revert (buffer, returndatasize) } // Call failed, revert!
        default { return (buffer, returndatasize) } // Call succeeded, return
      }
    }
  }

  /**
   * Create ZCNY Token smart contract with message sender as an owner.
   *
   * @param _feeCollector address fees are sent to
   */
  function ZCNYToken (address _feeCollector) public {
    fixedFee = DEFAULT_FEE;
    minVariableFee = 0;
    maxVariableFee = 0;
    variableFeeNumerator = 0;

    owner = msg.sender;
    feeCollector = _feeCollector;
  }

  /**
   * Delegate unrecognized functions.
   */
  function () public delegatable payable {
    revert (); // Revert if not delegated
  }

  /**
   * Get name of the token.
   *
   * @return name of the token
   */
  function name () public delegatable view returns (string) {
    return "ZCNY Token";
  }

  /**
   * Get symbol of the token.
   *
   * @return symbol of the token
   */
  function symbol () public delegatable view returns (string) {
    return "ZCNY";
  }

  /**
   * Get number of decimals for the token.
   *
   * @return number of decimals for the token
   */
  function decimals () public delegatable view returns (uint8) {
    return 2;
  }

  /**
   * Get total number of tokens in circulation.
   *
   * @return total number of tokens in circulation
   */
  function totalSupply () public delegatable view returns (uint256) {
    return tokensCount;
  }

  /**
   * Get number of tokens currently belonging to given owner.
   *
   * @param _owner address to get number of tokens currently belonging to the
   *        owner of
   * @return number of tokens currently belonging to the owner of given address
   */
  function balanceOf (address _owner)
    public delegatable view returns (uint256 balance) {
    return AbstractToken.balanceOf (_owner);
  }

  /**
   * Transfer given number of tokens from message sender to given recipient.
   *
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer to the owner of given address
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transfer (address _to, uint256 _value)
  public delegatable payable returns (bool) {
    if (frozen) return false;
    else if (
      (addressFlags [msg.sender] | addressFlags [_to]) & BLACK_LIST_FLAG ==
      BLACK_LIST_FLAG)
      return false;
    else {
      uint256 fee =
        (addressFlags [msg.sender] | addressFlags [_to]) & ZERO_FEE_FLAG == ZERO_FEE_FLAG ?
          0 :
          calculateFee (_value);

      if (_value <= accounts [msg.sender] &&
          fee <= safeSub (accounts [msg.sender], _value)) {
        require (AbstractToken.transfer (_to, _value));
        require (AbstractToken.transfer (feeCollector, fee));
        return true;
      } else return false;
    }
  }

  /**
   * Transfer given number of tokens from given owner to given recipient.
   *
   * @param _from address to transfer tokens from the owner of
   * @param _to address to transfer tokens to the owner of
   * @param _value number of tokens to transfer from given owner to given
   *        recipient
   * @return true if tokens were transferred successfully, false otherwise
   */
  function transferFrom (address _from, address _to, uint256 _value)
  public delegatable payable returns (bool) {
    if (frozen) return false;
    else if (
      (addressFlags [_from] | addressFlags [_to]) & BLACK_LIST_FLAG ==
      BLACK_LIST_FLAG)
      return false;
    else {
      uint256 fee =
        (addressFlags [_from] | addressFlags [_to]) & ZERO_FEE_FLAG == ZERO_FEE_FLAG ?
          0 :
          calculateFee (_value);

      if (_value <= allowances [_from][msg.sender] &&
          fee <= safeSub (allowances [_from][msg.sender], _value) &&
          _value <= accounts [_from] &&
          fee <= safeSub (accounts [_from], _value)) {
        require (AbstractToken.transferFrom (_from, _to, _value));
        require (AbstractToken.transferFrom (_from, feeCollector, fee));
        return true;
      } else return false;
    }
  }

  /**
   * Allow given spender to transfer given number of tokens from message sender.
   *
   * @param _spender address to allow the owner of to transfer tokens from
   *        message sender
   * @param _value number of tokens to allow to transfer
   * @return true if token transfer was successfully approved, false otherwise
   */
  function approve (address _spender, uint256 _value)
  public delegatable payable returns (bool success) {
    return AbstractToken.approve (_spender, _value);
  }

  /**
   * Tell how many tokens given spender is currently allowed to transfer from
   * given owner.
   *
   * @param _owner address to get number of tokens allowed to be transferred
   *        from the owner of
   * @param _spender address to get number of tokens allowed to be transferred
   *        by the owner of
   * @return number of tokens given spender is currently allowed to transfer
   *         from given owner
   */
  function allowance (address _owner, address _spender)
  public delegatable view returns (uint256 remaining) {
    return AbstractToken.allowance (_owner, _spender);
  }

  /**
   * Transfer given number of token from the signed defined by digital signature
   * to given recipient.
   *
   * @param _to address to transfer token to the owner of
   * @param _value number of tokens to transfer
   * @param _fee number of tokens to give to message sender
   * @param _nonce nonce of the transfer
   * @param _v parameter V of digital signature
   * @param _r parameter R of digital signature
   * @param _s parameter S of digital signature
   */
  function delegatedTransfer (
    address _to, uint256 _value, uint256 _fee,
    uint256 _nonce, uint8 _v, bytes32 _r, bytes32 _s)
  public delegatable payable returns (bool) {
    if (frozen) return false;
    else {
      address _from = ecrecover (
        keccak256 (
          thisAddress (), messageSenderAddress (), _to, _value, _fee, _nonce),
        _v, _r, _s);

      if (_nonce != nonces [_from]) return false;

      if (
        (addressFlags [_from] | addressFlags [_to]) & BLACK_LIST_FLAG ==
        BLACK_LIST_FLAG)
        return false;

      uint256 fee =
        (addressFlags [_from] | addressFlags [_to]) & ZERO_FEE_FLAG == ZERO_FEE_FLAG ?
          0 :
          calculateFee (_value);

      uint256 balance = accounts [_from];
      if (_value > balance) return false;
      balance = safeSub (balance, _value);
      if (fee > balance) return false;
      balance = safeSub (balance, fee);
      if (_fee > balance) return false;
      balance = safeSub (balance, _fee);

      nonces [_from] = _nonce + 1;

      accounts [_from] = balance;
      accounts [_to] = safeAdd (accounts [_to], _value);
      accounts [feeCollector] = safeAdd (accounts [feeCollector], fee);
      accounts [msg.sender] = safeAdd (accounts [msg.sender], _fee);

      Transfer (_from, _to, _value);
      Transfer (_from, feeCollector, fee);
      Transfer (_from, msg.sender, _fee);

      return true;
    }
  }

  /**
   * Create tokens.
   *
   * @param _value number of tokens to be created.
   */
  function createTokens (uint256 _value)
  public delegatable payable returns (bool) {
    require (msg.sender == owner);

    if (_value > 0) {
      if (_value <= safeSub (MAX_TOKENS_COUNT, tokensCount)) {
        accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
        tokensCount = safeAdd (tokensCount, _value);

        Transfer (address (0), msg.sender, _value);

        return true;
      } else return false;
    } else return true;
  }

  /**
   * Burn tokens.
   *
   * @param _value number of tokens to burn
   */
  function burnTokens (uint256 _value)
  public delegatable payable returns (bool) {
    require (msg.sender == owner);

    if (_value > 0) {
      if (_value <= accounts [msg.sender]) {
        accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
        tokensCount = safeSub (tokensCount, _value);

        Transfer (msg.sender, address (0), _value);

        return true;
      } else return false;
    } else return true;
  }

  /**
   * Freeze token transfers.
   */
  function freezeTransfers () public delegatable payable {
    require (msg.sender == owner);

    if (!frozen) {
      frozen = true;

      Freeze ();
    }
  }

  /**
   * Unfreeze token transfers.
   */
  function unfreezeTransfers () public delegatable payable {
    require (msg.sender == owner);

    if (frozen) {
      frozen = false;

      Unfreeze ();
    }
  }

  /**
   * Set smart contract owner.
   *
   * @param _newOwner address of the new owner
   */
  function setOwner (address _newOwner) public {
    require (msg.sender == owner);

    owner = _newOwner;
  }

  /**
   * Set fee collector.
   *
   * @param _newFeeCollector address of the new fee collector
   */
  function setFeeCollector (address _newFeeCollector)
  public delegatable payable {
    require (msg.sender == owner);

    feeCollector = _newFeeCollector;
  }

  /**
   * Get current nonce for token holder with given address, i.e. nonce this
   * token holder should use for next delegated transfer.
   *
   * @param _owner address of the token holder to get nonce for
   * @return current nonce for token holder with give address
   */
  function nonce (address _owner) public view delegatable returns (uint256) {
    return nonces [_owner];
  }

  /**
   * Set fee parameters.
   *
   * @param _fixedFee fixed fee in token units
   * @param _minVariableFee minimum variable fee in token units
   * @param _maxVariableFee maximum variable fee in token units
   * @param _variableFeeNumerator variable fee numerator
   */
  function setFeeParameters (
    uint256 _fixedFee,
    uint256 _minVariableFee,
    uint256 _maxVariableFee,
    uint256 _variableFeeNumerator) public delegatable payable {
    require (msg.sender == owner);

    require (_minVariableFee <= _maxVariableFee);
    require (_variableFeeNumerator <= MAX_FEE_NUMERATOR);

    fixedFee = _fixedFee;
    minVariableFee = _minVariableFee;
    maxVariableFee = _maxVariableFee;
    variableFeeNumerator = _variableFeeNumerator;

    FeeChange (
      _fixedFee, _minVariableFee, _maxVariableFee, _variableFeeNumerator);
  }

  /**
   * Get fee parameters.
   *
   * @return fee parameters
   */
  function getFeeParameters () public delegatable view returns (
    uint256 _fixedFee,
    uint256 _minVariableFee,
    uint256 _maxVariableFee,
    uint256 _variableFeeNumnerator) {
    _fixedFee = fixedFee;
    _minVariableFee = minVariableFee;
    _maxVariableFee = maxVariableFee;
    _variableFeeNumnerator = variableFeeNumerator;
  }

  /**
   * Calculate fee for transfer of given number of tokens.
   *
   * @param _amount transfer amount to calculate fee for
   * @return fee for transfer of given amount
   */
  function calculateFee (uint256 _amount)
    public delegatable view returns (uint256 _fee) {
    require (_amount <= MAX_TOKENS_COUNT);

    _fee = safeMul (_amount, variableFeeNumerator) / FEE_DENOMINATOR;
    if (_fee < minVariableFee) _fee = minVariableFee;
    if (_fee > maxVariableFee) _fee = maxVariableFee;
    _fee = safeAdd (_fee, fixedFee);
  }

  /**
   * Set flags for given address.
   *
   * @param _address address to set flags for
   * @param _flags flags to set
   */
  function setFlags (address _address, uint256 _flags)
  public delegatable payable {
    require (msg.sender == owner);

    addressFlags [_address] = _flags;
  }

  /**
   * Get flags for given address.
   *
   * @param _address address to get flags for
   * @return flags for given address
   */
  function flags (address _address) public delegatable view returns (uint256) {
    return addressFlags [_address];
  }

  /**
   * Set address of smart contract to delegate execution of delegatable methods
   * to.
   *
   * @param _delegate address of smart contract to delegate execution of
   * delegatable methods to, or zero to not delegate delegatable methods
   * execution.
   */
  function setDelegate (address _delegate) public {
    require (msg.sender == owner);

    if (delegate != _delegate) {
      delegate = _delegate;
      Delegation (delegate);
    }
  }

  /**
   * Get address of this smart contract.
   *
   * @return address of this smart contract
   */
  function thisAddress () internal view returns (address) {
    return this;
  }

  /**
   * Get address of message sender.
   *
   * @return address of this smart contract
   */
  function messageSenderAddress () internal view returns (address) {
    return msg.sender;
  }

  /**
   * Owner of the smart contract.
   */
  address internal owner;

  /**
   * Address where fees are sent to.
   */
  address internal feeCollector;

  /**
   * Number of tokens in circulation.
   */
  uint256 internal tokensCount;

  /**
   * Whether token transfers are currently frozen.
   */
  bool internal frozen;

  /**
   * Mapping from sender's address to the next delegated transfer nonce.
   */
  mapping (address => uint256) internal nonces;

  /**
   * Fixed fee amount in token units.
   */
  uint256 internal fixedFee;

  /**
   * Minimum variable fee in token units.
   */
  uint256 internal minVariableFee;

  /**
   * Maximum variable fee in token units.
   */
  uint256 internal maxVariableFee;

  /**
   * Variable fee numerator.
   */
  uint256 internal variableFeeNumerator;

  /**
   * Maps address to its flags.
   */
  mapping (address => uint256) internal addressFlags;

  /**
   * Address of smart contract to delegate execution of delegatable methods to,
   * or zero to not delegate delegatable methods execution.
   */
  address internal delegate;

  /**
   * Logged when token transfers were frozen.
   */
  event Freeze ();

  /**
   * Logged when token transfers were unfrozen.
   */
  event Unfreeze ();

  /**
   * Logged when fee parameters were changed.
   *
   * @param fixedFee fixed fee in token units
   * @param minVariableFee minimum variable fee in token units
   * @param maxVariableFee maximum variable fee in token units
   * @param variableFeeNumerator variable fee numerator
   */
  event FeeChange (
    uint256 fixedFee,
    uint256 minVariableFee,
    uint256 maxVariableFee,
    uint256 variableFeeNumerator);

  /**
   * Logged when address of smart contract execution of delegatable methods is
   * delegated to was changed.
   *
   * @param delegate new address of smart contract execution of delegatable
   * methods is delegated to or zero if execution of delegatable methods is
   * oot delegated.
   */
  event Delegation (address delegate);
}

    Contract ABI  
[{"constant":false,"inputs":[],"name":"freezeTransfers","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"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":"success","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_newOwner","type":"address"}],"name":"setOwner","outputs":[],"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":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"decimals","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"unfreezeTransfers","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"getFeeParameters","outputs":[{"name":"_fixedFee","type":"uint256"},{"name":"_minVariableFee","type":"uint256"},{"name":"_maxVariableFee","type":"uint256"},{"name":"_variableFeeNumnerator","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"burnTokens","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"balanceOf","outputs":[{"name":"balance","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_owner","type":"address"}],"name":"nonce","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_value","type":"uint256"}],"name":"createTokens","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":true,"inputs":[],"name":"symbol","outputs":[{"name":"","type":"string"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_amount","type":"uint256"}],"name":"calculateFee","outputs":[{"name":"_fee","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"_address","type":"address"}],"name":"flags","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"_newFeeCollector","type":"address"}],"name":"setFeeCollector","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"}],"name":"transfer","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_address","type":"address"},{"name":"_flags","type":"uint256"}],"name":"setFlags","outputs":[],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_fee","type":"uint256"},{"name":"_nonce","type":"uint256"},{"name":"_v","type":"uint8"},{"name":"_r","type":"bytes32"},{"name":"_s","type":"bytes32"}],"name":"delegatedTransfer","outputs":[{"name":"","type":"bool"}],"payable":true,"stateMutability":"payable","type":"function"},{"constant":false,"inputs":[{"name":"_delegate","type":"address"}],"name":"setDelegate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"_fixedFee","type":"uint256"},{"name":"_minVariableFee","type":"uint256"},{"name":"_maxVariableFee","type":"uint256"},{"name":"_variableFeeNumerator","type":"uint256"}],"name":"setFeeParameters","outputs":[],"payable":true,"stateMutability":"payable","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"},{"inputs":[{"name":"_feeCollector","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[],"name":"Freeze","type":"event"},{"anonymous":false,"inputs":[],"name":"Unfreeze","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"fixedFee","type":"uint256"},{"indexed":false,"name":"minVariableFee","type":"uint256"},{"indexed":false,"name":"maxVariableFee","type":"uint256"},{"indexed":false,"name":"variableFeeNumerator","type":"uint256"}],"name":"FeeChange","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"delegate","type":"address"}],"name":"Delegation","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"},{"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"}]

  Contract Creation Code Switch To Opcodes View
608060405234801561001057600080fd5b5060405160208061167683398101604052516101f4600755600060088190556009819055600a5560028054600160a060020a0319908116331790915560038054600160a060020a0390931692909116919091179055611602806100746000396000f3006080604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630150246081146101a657806306fdde03146101ae578063095ea7b31461023857806313af40351461026357806318160ddd1461028457806323b872dd146102ab578063313ce567146102c857806331c420d4146102f35780634722b4a5146102fb5780636d1b229d1461033657806370a082311461034157806370ae92d2146103625780637e1f2bb81461038357806395d89b411461038e57806399a5d747146103a35780639fef0c01146103bb578063a42dce80146103dc578063a9059cbb146103f0578063addd9cef14610407578063c97e84801461041e578063ca5eb5e114610447578063d5bf2dbe14610468578063dd62ed3e1461047c575b600c54600160a060020a0316151561015457341561014f57600080fd5b600080fd5b600254600c5460405136600082376000813683855af460025484146001811461017c57600080fd5b50600c5483146001811461018f57600080fd5b503d6000833e8080156101a0573d83f35b3d83fd5b005b6101a46104a3565b3480156101ba57600080fd5b506101c361051c565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101fd5781810151838201526020016101e5565b50505050905090810190601f16801561022a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61024f600160a060020a0360043516602435610575565b604080519115158252519081900360200190f35b34801561026f57600080fd5b506101a4600160a060020a03600435166105a8565b34801561029057600080fd5b506102996105ee565b60408051918252519081900360200190f35b61024f600160a060020a0360043581169060243516604435610617565b3480156102d457600080fd5b506102dd6107cd565b6040805160ff9092168252519081900360200190f35b6101a46107f5565b34801561030757600080fd5b5061031061086c565b604080519485526020850193909352838301919091526060830152519081900360800190f35b61024f6004356108a9565b34801561034d57600080fd5b50610299600160a060020a0360043516610978565b34801561036e57600080fd5b50610299600160a060020a03600435166109a8565b61024f6004356109e7565b34801561039a57600080fd5b506101c3610aa8565b3480156103af57600080fd5b50610299600435610b02565b3480156103c757600080fd5b50610299600160a060020a0360043516610b93565b6101a4600160a060020a0360043516610bd2565b61024f600160a060020a0360043516602435610c32565b6101a4600160a060020a0360043516602435610d64565b61024f600160a060020a036004351660243560443560643560ff6084351660a43560c435610db5565b34801561045357600080fd5b506101a4600160a060020a0360043516611126565b6101a46004356024356044356064356111b9565b34801561048857600080fd5b50610299600160a060020a036004358116906024351661126b565b600c54600160a060020a031615156101545734156104c057600080fd5b600254600160a060020a031633146104d757600080fd5b60055460ff16151561051a576005805460ff191660011790556040517f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de90600090a15b565b600c54606090600160a060020a0316151561015457341561053c57600080fd5b5060408051808201909152600a81527f5a434e5920546f6b656e0000000000000000000000000000000000000000000060208201525b90565b600c54600090600160a060020a0316151561015457341561059557600080fd5b61059f8383611295565b90505b92915050565b600254600160a060020a031633146105bf57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600c54600090600160a060020a0316151561015457341561060e57600080fd5b50600454610572565b600c546000908190600160a060020a0316151561015457341561063957600080fd5b60055460ff161561064d57600091506107c5565b600160a060020a038085166000908152600b6020526040808220549288168252902054176001908116141561068557600091506107c5565b600160a060020a038085166000908152600b6020526040808220549288168252902054176002908116146106c1576106bc83610b02565b6106c4565b60005b600160a060020a038616600090815260016020908152604080832033845290915290205490915083118015906107275750600160a060020a038516600090815260016020908152604080832033845290915290205461072390846112fb565b8111155b801561074b5750600160a060020a0385166000908152602081905260409020548311155b80156107795750600160a060020a03851660009081526020819052604090205461077590846112fb565b8111155b156107c05761078985858561130d565b151561079457600080fd5b6003546107ac908690600160a060020a03168361130d565b15156107b757600080fd5b600191506107c5565b600091505b509392505050565b600c54600090600160a060020a031615156101545734156107ed57600080fd5b506002610572565b600c54600160a060020a0316151561015457341561081257600080fd5b600254600160a060020a0316331461082957600080fd5b60055460ff161561051a576005805460ff191690556040517f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded90600090a161051a565b600c54600090819081908190600160a060020a0316151561015457341561089257600080fd5b5050600754600854600954600a5492959194509250565b600c54600090600160a060020a031615156101545734156108c957600080fd5b600254600160a060020a031633146108e057600080fd5b600082111561096f57336000908152602081905260409020548211610967573360009081526020819052604090205461091990836112fb565b3360009081526020819052604090205560045461093690836112fb565b60045560408051838152905160009133916000805160206115b78339815191529181900360200190a3506001610973565b506000610973565b5060015b919050565b600c54600090600160a060020a0316151561015457341561099857600080fd5b6109a18261145e565b9050610973565b600c54600090600160a060020a031615156101545734156109c857600080fd5b50600160a060020a038116600090815260066020526040902054610973565b600c54600090600160a060020a03161515610154573415610a0757600080fd5b600254600160a060020a03163314610a1e57600080fd5b600082111561096f57610a3a620186a0600019046004546112fb565b82116109675733600090815260208190526040902054610a5a9083611479565b33600090815260208190526040902055600454610a779083611479565b60045560408051838152905133916000916000805160206115b78339815191529181900360200190a3506001610973565b600c54606090600160a060020a03161515610154573415610ac857600080fd5b5060408051808201909152600481527f5a434e59000000000000000000000000000000000000000000000000000000006020820152610572565b600c54600090600160a060020a03161515610154573415610b2257600080fd5b7da7c5ac471b4784230fcf80dc33721d53cddd6e04c059210385c67dfe32a0821115610b4d57600080fd5b620186a0610b5d83600a5461148f565b811515610b6657fe5b049050600854811015610b7857506008545b600954811115610b8757506009545b6109a181600754611479565b600c54600090600160a060020a03161515610154573415610bb357600080fd5b50600160a060020a0381166000908152600b6020526040902054610973565b600c54600160a060020a03161515610154573415610bef57600080fd5b600254600160a060020a03163314610c0657600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b600c546000908190600160a060020a03161515610154573415610c5457600080fd5b60055460ff1615610c685760009150610d5d565b600160a060020a0384166000908152600b6020526040808220543383529120541760019081161415610c9d5760009150610d5d565b600160a060020a0384166000908152600b60205260408082205433835291205417600290811614610cd657610cd183610b02565b610cd9565b60005b336000908152602081905260409020549091508311801590610d14575033600090815260208190526040902054610d1090846112fb565b8111155b15610d5857610d2384846114bc565b1515610d2e57600080fd5b600354610d4490600160a060020a0316826114bc565b1515610d4f57600080fd5b60019150610d5d565b600091505b5092915050565b600c54600160a060020a03161515610154573415610d8157600080fd5b600254600160a060020a03163314610d9857600080fd5b600160a060020a03919091166000908152600b6020526040902055565b600c54600090819081908190600160a060020a03161515610154573415610ddb57600080fd5b60055460ff1615610def5760009350611118565b6001610df9611583565b610e01611587565b604080516c01000000000000000000000000600160a060020a039485168102825292841683026014820152928f169091026028830152603c82018d9052605c82018c9052607c82018b9052805191829003609c018220600080845260208481018085529290925260ff8c1684840152606084018b9052608084018a9052915160a0808501949293601f198301938390039091019190865af1158015610eaa573d6000803e3d6000fd5b505060408051601f190151600160a060020a03811660009081526006602052919091205490945089149050610ee25760009350611118565b600160a060020a03808c166000908152600b60205260408082205492861682529020541760019081161415610f1a5760009350611118565b600160a060020a03808c166000908152600b602052604080822054928616825290205417600290811614610f5657610f518a610b02565b610f59565b60005b600160a060020a0384166000908152602081905260409020549092509050808a1115610f885760009350611118565b610f92818b6112fb565b905080821115610fa55760009350611118565b610faf81836112fb565b905080891115610fc25760009350611118565b610fcc818a6112fb565b600160a060020a03808516600090815260066020908152604080832060018e01905590829052808220849055918e168152205490915061100c908b611479565b600160a060020a03808d16600090815260208190526040808220939093556003549091168152205461103e9083611479565b600354600160a060020a031660009081526020819052604080822092909255338152205461106c908a611479565b33600090815260208181526040918290209290925580518c81529051600160a060020a038e811693908716926000805160206115b7833981519152929081900390910190a3600354604080518481529051600160a060020a03928316928616916000805160206115b7833981519152919081900360200190a3604080518a815290513391600160a060020a038616916000805160206115b78339815191529181900360200190a3600193505b505050979650505050505050565b600254600160a060020a0316331461113d57600080fd5b600c54600160a060020a03828116911614610c2f57600c805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116919091179182905560408051929091168252517f600005b3559a025151f4a40f36d9939d94cf5194016895d4ef6362b211e4c3b5916020908290030190a150565b600c54600160a060020a031615156101545734156111d657600080fd5b600254600160a060020a031633146111ed57600080fd5b818311156111fa57600080fd5b620186a081111561120a57600080fd5b600784905560088390556009829055600a81905560408051858152602081018590528082018490526060810183905290517f650bf5314bb5924368ffebaf7dffcfaa4a0f99c2ab08264c26bf0547f8c459e99181900360800190a150505050565b600c54600090600160a060020a0316151561015457341561128b57600080fd5b61059f838361158b565b336000818152600160209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60008183101561130757fe5b50900390565b600160a060020a038316600090815260016020908152604080832033845290915281205481838210156113435760009250611455565b50600160a060020a0385166000908152602081905260409020548381101561136e5760009250611455565b61137882856112fb565b600160a060020a0387166000908152600160209081526040808320338452909152812091909155841180156113bf575084600160a060020a031686600160a060020a031614155b15611417576113ce81856112fb565b600160a060020a0380881660009081526020819052604080822093909355908716815220546113fd9085611479565b600160a060020a0386166000908152602081905260409020555b84600160a060020a031686600160a060020a03166000805160206115b7833981519152866040518082815260200191505060405180910390a3600192505b50509392505050565b600160a060020a031660009081526020819052604090205490565b600060001982900383111561148a57fe5b500190565b60008115156114a0575060006105a2565b816000198115156114ad57fe5b048311156114b757fe5b500290565b33600090815260208190526040812054828110156114dd5760009150610d5d565b6000831180156114f6575033600160a060020a03851614155b1561154b5761150581846112fb565b3360009081526020819052604080822092909255600160a060020a038616815220546115319084611479565b600160a060020a0385166000908152602081905260409020555b604080518481529051600160a060020a0386169133916000805160206115b78339815191529181900360200190a35060019392505050565b3090565b3390565b600160a060020a039182166000908152600160209081526040808320939094168252919091522054905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201cd4915b0a806024f1ce691dc7312674b030bdc46e64b17f632e01d68dd060940029

   Swarm Source:
bzzr://1cd4915b0a806024f1ce691dc7312674b030bdc46e64b17f632e01d68dd06094

 

View All
Block Age transaction Difficulty GasUsed Reward
View All
Block Age UncleNumber Difficulty GasUsed Reward
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.