Hey guys, Im having this issue trying to use smart accounts with web3auth and pimlico paymaster. I succcesfully logged in but, after that, this error comes to the console
Uncaught (in promise) Error: No contracts found for version 1.3.0 chain 421614
at $h (index-C8IxXRWJ.js:50:632518)
at e8 (index-C8IxXRWJ.js:50:646941)
at Nv.getSmartAccount (index-C8IxXRWJ.js:50:657499)
at async iu.setupProvider (index-C8IxXRWJ.js:49:25953)
at async gk.setupSmartAccountForNewNetwork (EthereumController-9oaGq9RI.js:23:224124)
at async Gv. (EthereumController-9oaGq9RI.js:23:223794)
const init = async () => {
try {
setIsLoading(true);
const clientId = envParsed.WEB3AUTH_CLIENT_ID;
// Validate client ID
if (!clientId || clientId.trim() === "") {
throw new Error("Web3Auth client ID is missing or empty");
}
console.debug("Initializing Web3Auth with client ID:", clientId.substring(0, 10) + "...");
console.debug("Chain configuration:", {
chainId: chain.id,
chainName: chain.name,
rpcUrl: chain.rpcUrls.default.http[0],
});
// Check if Account Abstraction is supported for this chain
const supportsAccountAbstraction = isAccountAbstractionSupported(chain.id);
console.debug("Web3Auth configuration:", {
chainId: chain.id,
chainName: chain.name,
supportsAccountAbstraction,
environment: envParsed.NODE_ENV,
});
// Create base configuration
const baseConfig = {
modalConfig: {
connectors: {
metamask: {
label: "metamask",
showOnModal: false,
},
auth: {
label: "auth",
showOnModal: true,
},
},
},
clientId,
web3AuthNetwork: "sapphire_devnet" as const,
defaultChainId: `0x${chain.id.toString(16)}`,
chains: [
{
chainNamespace: "eip155" as const,
chainId: `0x${chain.id.toString(16)}`,
rpcTarget: chain.rpcUrls.default.http[0],
blockExplorerUrl: chain?.blockExplorers?.default.url ?? "",
ticker: chain.nativeCurrency.symbol,
logo: "",
tickerName: chain.nativeCurrency.name,
displayName: chain.name,
},
],
};
// Create different configs based on Account Abstraction support
let web3authConfig;
if (supportsAccountAbstraction) {
web3authConfig = {
...baseConfig,
accountAbstractionConfig: {
smartAccountType: "metamask" as const,
chains: [
{
chainId: `0x${chain.id.toString(16)}`,
bundlerConfig: {
url: envParsed.BUNDLER_URL,
},
paymasterConfig: {
url: envParsed.PAYMASTER_URL,
},
},
],
},
};
} else {
// For unsupported chains, use a minimal config without any Account Abstraction
// This should prevent Web3Auth from trying to use Account Abstraction
web3authConfig = {
modalConfig: {
connectors: {
metamask: {
label: "metamask",
showOnModal: false,
},
auth: {
label: "auth",
showOnModal: true,
},
},
},
clientId,
web3AuthNetwork: "sapphire_devnet" as const,
// Explicitly set to undefined to disable Account Abstraction
accountAbstractionConfig: undefined,
};
}
console.debug("Final Web3Auth config:", {
hasAccountAbstraction: !!web3authConfig.accountAbstractionConfig,
configKeys: Object.keys(web3authConfig),
chainId: chain.id,
chainName: chain.name,
supportsAccountAbstraction,
});
const web3authInstance = new Web3Auth(web3authConfig);
console.debug("Web3Auth instance created, initializing...");
await web3authInstance.init();
console.debug("Web3Auth initialized successfully");
setWeb3auth(web3authInstance);
setIsInitialized(true);
setInitError(null);
// Use the retry helper to check for an existing session
await retry(() => checkAndUpdateAuthState(web3authInstance), {
retries: 5,
delayMs: 2000,
});
} catch (error) {
console.error("Error initializing Web3Auth:", error);
setInitError(error instanceof Error ? error.message : "Unknown error");
// Provide more specific error information
if (error instanceof Error) {
if (error.message.includes("Failed to fetch")) {
console.error(
"Network error: Unable to connect to Web3Auth servers. Check your internet connection."
);
} else if (error.message.includes("client ID")) {
console.error(
"Configuration error: Check your VITE_WEB3AUTH_CLIENT_ID environment variable."
);
} else if (error.message.includes("CORS")) {
console.error("CORS error: Check your domain configuration in Web3Auth dashboard.");
} else if (error.message.includes("No contracts found")) {
console.error(
"Account Abstraction error: The current chain does not support Account Abstraction v1.3.0. " +
"This is expected for Arbitrum Sepolia. Account Abstraction is only supported on Arbitrum mainnet."
);
}
}
} finally {
setIsLoading(false);
}
};