-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Feature Request
Description
Implement ERC-165 supportsInterface in ModularSmartAccount to avoid
NoFallbackHandler error when checking for SSO account support.
Currently, calling supportsInterface(bytes4) on a ModularSmartAccount throws
a NoFallbackHandler error (0x48c9ceda) instead of returning a boolean value.
This requires consuming applications to implement error-catching workarounds to
determine if an account is an SSO account.
Rationale
Current State: The auth-server currently has to use this workaround in
useIsSsoAccount.ts:
try {
return await publicClient.readContract({
address: accountAddress,
abi: [
/* supportsInterface ABI */
],
functionName: "supportsInterface",
args: [ssoAccountInterfaceId],
});
} catch (err: unknown) {
// Handle NoFallbackHandler error (0x48c9ceda)
// WORKAROUND: ModularSmartAccount doesn't implement supportsInterface yet
// We treat NoFallbackHandler errors as SSO accounts in our dev environment
const errorString = err.toString?.() || String(err);
const errorMessage = (err as Error).message || "";
if (
errorMessage.includes("0x48c9ceda") ||
errorMessage.includes("NoFallbackHandler") ||
errorString.includes("0x48c9ceda") ||
errorString.includes("NoFallbackHandler")
) {
return true; // Assume it's an SSO account
}
return false;
}Why This Matters:
- Fragile Detection Logic: Error-based detection is brittle and can break
if error messages change or if other contracts throw similar errors - False Positives: Any contract that throws
NoFallbackHandlerwould be
incorrectly identified as an SSO account - Developer Experience: Developers integrating SSO accounts shouldn't need
to rely on error-catching patterns for standard interface detection - ERC-165 Compliance: The ERC-165 standard is designed specifically for
interface detection and should be the canonical way to check for supported
interfaces
Desired State: ModularSmartAccount should implement a fallback handler or
native support for supportsInterface(bytes4) that:
- Returns
truefor the SSO account interface ID (and any other supported
interfaces) - Returns
falsefor unsupported interfaces - Never throws
NoFallbackHandlererror when called
This would allow clean, standards-compliant detection:
const isSsoAccount = await publicClient.readContract({
address: accountAddress,
functionName: "supportsInterface",
args: [ssoAccountInterfaceId],
});
// Returns: true or false (no try/catch needed)Additional Context
- Current Error Code:
0x48c9ceda(NoFallbackHandler) - Affected Contract:
ModularSmartAccountin zksync-sso-contracts - Related Standard:
ERC-165: Standard Interface Detection - Current Workaround Location:
packages/auth-server/composables/useIsSsoAccount.ts
Implementation Suggestions:
- Add a fallback handler that implements
supportsInterface - OR add native
supportsInterfacefunction toModularSmartAccount - Return
truefor supported interfaces including the SSO account interface - Return
falsefor unsupported interfaces instead of reverting
This would align ModularSmartAccount with common smart contract wallet
patterns and improve interoperability with SSO-aware applications.