contract NYXToken is MintableToken, ERC23PayableToken {
    string public constant name = "NYX Token";
    string public constant symbol = "NYX";

    bool public transferEnabled = true;

    //The cap is 15 mln NYX
    uint private constant CAP = 15*(10**6);

    function mint(address _to, uint _amount){
        require(totalSupply.add(_amount) <= CAP);
        super.mint(_to, _amount);
    }

    function NYXToken(address team) {
        //Transfer ownership on the token to team on creation
        transferOwnership(team);
        // minter is the TokenSale contract
        minter = msg.sender; 
        /// Preserve 3 000 000 tokens for the team
        mint(team, 3000000);
    }

    /**
    * Overriding all transfers to check if transfers are enabled
    */
    function transferAndPay(address to, uint value, bytes data) payable{
        require(transferEnabled);
        super.transferAndPay(to, value, data);
    }

    function enableTransfer(bool enabled) onlyOwner{
        transferEnabled = enabled;
    }

}
/*************************************************************************
 * import "./include/ERC23PayableToken.sol" : end
 *************************************************************************/
function transferAndPay(address to, uint value, bytes data) payable{
    require(transferEnabled);
    super.transferAndPay(to, value, data);
}

/**
 * Overriding all transfers to check if transfers are enabled
 */