contract HadePayToken is StandardToken {

    using SafeMath for uint256;

    /**********************************
     *  Events
     */
    event Mint(address indexed to, uint256 amount);
    event Burn(address indexed burner, uint256 value);
    event ChangeOwnerAddress(uint256  blockTimeStamp, address indexed ownerAddress);
    event ChangeServerAddress(uint256  blockTimeStamp, address indexed serverAddress);

    /**********************************
     *  Storage
     */

    // name of the token
    string public name = "HadePay";
    string public symbol = "HPAY";

    // token supply and precision
    uint8 public decimals = 18;
    uint256 public totalSupply = 75000000 * 10**18;

    // important addresses
    address public hPayMultiSig;
    address public serverAddress;

    /**********************************
     *  Constructor
     */
    constructor(address _hPayMultiSig) public {

        hPayMultiSig = _hPayMultiSig;
        balances[_hPayMultiSig] = totalSupply;
    }

    /**********************************
     *  Fallback
     */
    function() public {
        revert();
    }

    /**********************************
     *  Modifiers
     */
    modifier nonZeroAddress(address _to) {
        require(_to != 0x0);
        _;
    }

    modifier onlyOwner() {
        require(msg.sender == hPayMultiSig);
        _;
    }

    /**********************************
     *  Owner Functions
     */
     // @title mint sends new coin to the specificed recepiant
     // @param _to is the recepiant the new coins
     // @param _value is the number of coins to mint
     function mint(address _to, uint256 _value) external onlyOwner {

         require(_to != address(0));
         require(_value > 0);
         totalSupply.add(_value);
         balances[_to].add(_value);
         emit Mint(_to, _value);
         emit Transfer(address(0), _to, _value);
     }

     // @title burn allows the administrator to burn their own tokens
     // @param _value is the number of tokens to burn
     // @dev note that admin can only burn their own tokens
     function burn(uint256 _value) external onlyOwner {

         require(_value > 0 && balances[msg.sender] >= _value);
         totalSupply.sub(_value);
         balances[msg.sender].sub(_value);
         emit Burn(msg.sender, _value);
     }

     // @title changeAdminAddress allows to update the owner wallet
     // @param _newAddress is the address of the new admin wallet
     // @dev only callable by current owner
     function setOwnerAddress(address _newAddress)

     external
     onlyOwner
     nonZeroAddress(_newAddress)
     {
         hPayMultiSig = _newAddress;
         emit ChangeOwnerAddress(now, hPayMultiSig);
     }

     function setServerAddress(address _newAddress)

     external
     onlyOwner
     nonZeroAddress(_newAddress)
     {
         serverAddress = _newAddress;
         emit ChangeServerAddress(now, serverAddress);
     }

     function getOwnerAddress() external view returns (address) {
         return hPayMultiSig;
     }

     function getServerAddress() external view returns (address) {
         return serverAddress;
     }
}
function mint(address _to, uint256 _value) external onlyOwner {

    require(_to != address(0));
    require(_value > 0);
    totalSupply.add(_value);
    balances[_to].add(_value);
    emit Mint(_to, _value);
    emit Transfer(address(0), _to, _value);
}

// @title mint sends new coin to the specificed recepiant
// @param _to is the recepiant the new coins
// @param _value is the number of coins to mint