Fetching of hat status may fail due to lack of input sanitization
The functions `_isActive()` and `_isEligible()` are used by `balanceOf()` and other functions, so they should not ever revert. However, they perform ABI decoding from external inputs.\\n```\\n        function _isActive(Hat memory _hat, uint256 _hatId) internal view  returns (bool) {\\n        bytes memory data = \\n             abi.encodeWithSignature("getHatStatus(uint256)", _hatId);\\n                (bool success, bytes memory returndata) = \\n        _hat.toggle.staticcall(data);\\n        if (success && returndata.length > 0) {\\n            return abi.decode(returndata, (bool));\\n                } else {\\n        return _getHatStatus(_hat);\\n                }\\n         }\\n```\\n\\nIf toggle returns invalid return data (whether malicious or by accident), `abi.decode()` would revert causing the entire function to revert.
Wrap the decoding operation for both affected functions in a try/catch statement. Fall back to the `_getHatStatus()` result if necessary. Checking that returndata size is correct is not enough as bool encoding must be 64-bit encoded 0 or 1.
```\\n        function _isActive(Hat memory _hat, uint256 _hatId) internal view  returns (bool) {\\n        bytes memory data = \\n             abi.encodeWithSignature("getHatStatus(uint256)", _hatId);\\n                (bool success, bytes memory returndata) = \\n        _hat.toggle.staticcall(data);\\n        if (success && returndata.length > 0) {\\n            return abi.decode(returndata, (bool));\\n                } else {\\n        return _getHatStatus(_hat);\\n                }\\n         }\\n```\\n