contract CNYTokenPlus is PausableToken {
  using SafeMath for uint256;

  function () {
      //if ether is sent to this address, send it back.
      revert();
  }

  string public name = "CNYTokenPlus";
  string public symbol = "CTP";
  uint8 public decimals = 18;
  uint public totalSupply = 100000000000000000000000000;
  string public version = 'CNYt⁺ 3.0';
  // The nonce for avoid transfer replay attacks
  mapping(address => uint256) nonces;

  event Burn(address indexed burner, uint256 value);
  event TimeLock(address indexed to, uint value, uint time);

  function CNYTokenPlus() {
      balances[msg.sender] = totalSupply;              // Give the creator all initial tokens
  }

  /**
   * @dev transfer timelocked tokens
   */
  function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime)
    onlyOwner whenNotPaused returns (TokenTimelock) {

    TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime);
    transfer(timelock,_amount);
    emit TimeLock(_to, _amount,_releaseTime);

    return timelock;
  }

  /**
   * @dev Burns a specific amount of tokens.
   * @param _value The amount of token to be burned.
   */
  function burn(uint256 _value) onlyOwner whenNotPaused {
    _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);
  }

  /*
   * Proxy transfer HC token. When some users of the ethereum account don't have ether,
   * Who can authorize the agent for broadcast transactions, the agents may charge fees
   * @param _from
   * @param _to
   * @param _value
   * @param fee
   * @param _v
   * @param _r
   * @param _s
   * @param _comment
   */
  function transferProxy(address _from, address _to, uint256 _value, uint256 _fee,
      uint8 _v, bytes32 _r, bytes32 _s) whenNotPaused {

      require((balances[_from] >= _fee.add(_value)));
      require(balances[_to].add(_value) >= balances[_to]);
      require(balances[msg.sender].add(_fee) >= balances[msg.sender]);

      uint256 nonce = nonces[_from];
      bytes32 hash = keccak256(_from,_to,_value,_fee,nonce);
      bytes memory prefix = "\x19Ethereum Signed Message:\n32";
      bytes32 prefixedHash = keccak256(prefix, hash);
      require(_from == ecrecover(prefixedHash,_v,_r,_s));

      balances[_from] = balances[_from].sub(_value.add(_fee));
      balances[_to] = balances[_to].add(_value);
      balances[msg.sender] = balances[msg.sender].add(_fee);
      nonces[_from] = nonce.add(1);

      emit Transfer(_from, _to, _value);
      emit Transfer(_from, msg.sender, _fee);
  }
}
/**
 * @title CNYTokenPlus
 * @dev CNY Token Plus contract
 */
function transferTimelocked(address _to, uint256 _amount, uint256 _releaseTime)
    onlyOwner whenNotPaused returns (TokenTimelock) {

    TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime);
    transfer(timelock,_amount);
    emit TimeLock(_to, _amount,_releaseTime);

    return timelock;
  }
/**
 * @dev transfer timelocked tokens
 */