contract XmedBaseLoyaltyToken is Pausable, ERC20Mintable, ERC20Burnable, ERC20Details {

    /**
    * @param _tokenSymbol token symbol
    * @param _tokenName token name
    * @param _tokenDecimals token decimals
    */
    constructor(
        string memory _tokenSymbol,
        string memory _tokenName,
        uint8 _tokenDecimals
        ) public {
        _symbol = _tokenSymbol;
        _name = _tokenName;
        _decimals = _tokenDecimals;
    }

    // Function that handles change of total supply.
    // Intended to be overriden in child contracts.
    // Call super.onTotalSupplyChange in child contract overriden method to invoke the event.
    function onTotalSupplyChange() internal {
        emit TotalSupplyChanged();
    }

    function award(address to, uint256 loyaltyAmount) public onlyOwner {
        _mint(to, loyaltyAmount);
        emit Award(to, _symbol, loyaltyAmount);
        onTotalSupplyChange();
    }

    function redeem(address from, uint256 loyaltyAmount) public onlyOwner {
        _burn(from, loyaltyAmount);
        emit Redeem(from, _symbol, loyaltyAmount);
        onTotalSupplyChange();
    }

    function burn(uint256 amount) public onlyOwner {
        _burn(msg.sender, amount);
        emit Burn(_symbol, amount);
        onTotalSupplyChange();
    }

    // emitted when the award method is called
    event Award(address to, string tokenSymbol, uint256 tokenAmount);
    // emitted when the redeem method is called
    event Redeem(address from, string tokenSymbol, uint256 tokenAmount);
    // emitted when the burn method is called
    event Burn(string tokenSymbol, uint256 tokenAmount);
    // emitted when the total supply is changed
    event TotalSupplyChanged();
}
function onTotalSupplyChange() internal {
    emit TotalSupplyChanged();
}

// Function that handles change of total supply.
// Intended to be overriden in child contracts.
// Call super.onTotalSupplyChange in child contract overriden method to invoke the event.